A File System Monitor service event type is defined to monitor a specified directory on the Agentry Server’s host file system for changes. When a file system monitor service event is defined and published to the Server, the Server will begin monitoring the directory the service event has been defined to watch, which is then the source back end system for the service event. When a change occurs to the contents of this directory, the Server will attempt to open each file in the directory for reading. Once a file is opened successfully, the service event’s defined command will be executed, followed by its read, data state, and update step definitions to update the destination back end system.
If the Agentry Server is unable to open a file for reading, it will wait a short period and attempt the operation again. If it is unable to open the file after this second attempt, it will skip the file and process the next on found in the directory. When a file is successfully opened, the defined command for the service event is executed for that file. The service events child step usage definitions are then processed. Once this is complete, the next file in the directory is processed according this same procedure. Note that the Agentry Server will delete all files from the directory that it successfully processes. To prevent this behavior, the command should include copying the file to a different location, or rename the file to one that does not match the File Filter attribute of the service event definition.
The command defined for this service event type is primarily intended to prepare files for transfer or reading by the service event. The command can be any executable file type and is a Windows batch file (.bat) by default. The file type may be changed by editing the file extension of the file name in the File attribute of the Command tab.
A file system monitor service event includes the document mapping child definition type. The service event may contain one or more of these child definitions, each of which will map a file or file-related data to the properties of the object type targeted by the service event; or alternately one of the other data components of the application.