cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass PCo server name to MII transaction thru File monitor agent?

senthil_kumar44
Participant
0 Kudos
323

Hello All,

We need one help on PCo 15. In our requirement, we need to pass the Server name of PCo where it is installed on whenever the file is updated in the folder. We need help on below points.

1. How to check the file update in the folder by using File monitor agent? We need to trigger MII transaction whenever any change or update happens in particular files like TEST*.xml. So any change or data update in TEST1 or TEST2.xml files, we need to trigger the MII transaction. We checked this by using File monitor agent. But it always trigger the message as File is present in the folder. We need to trigger only if any update or change in the files.

2. When triggering the MII transaction, we need to send the PCo server name. As MII transaction is common for multiple servers, we need to capture the PCo server name from where it is called the transaction. We are able to get the file name but we need to pass the server name with it. Along with previous question, whenever any change or update in the files in folder, we need to send the PCo server name to MII transaction.

Can you please help on this?

Thanks,

Senthil

Accepted Solutions (1)

Accepted Solutions (1)

Kevin_Hunter
Product and Topic Expert
Product and Topic Expert

Hi Senthil,

For question 1, the standard product doesn't support monitoring of updates but I can suggest a few possible workarounds.

a) Depending on the software that generates your xml file - configure PCo to move the file when the PCo agent find it, this will force the software that writes the xml to create a new one every time new data needs to be written, this has the added benefit of only passing the changes to MII rather than the complete file which is more efficient.

b)The .Net Framework has something called a File System Watcher that does support the triggering of an event when a file is updated, so you could use the PCo SDK and write your own source system that will support updates. One point to be careful with is that the event is triggered as soon as the update starts, you have to make sure you wait until the update finishes before reading the file.

c)Similar to b, if you dont want to play with the SDK , create a simple .Net application that watches for changes and copies the file to another folder which PCo can monitor.

Please note that if you choose the file system watcher route then be careful if the folder you are monitoring is a network drive as this can be unreliable.

Question 2 is much easier, add a hard coded variable to your output message with the server name.

Hope this helps

Kevin

Answers (0)