File Monitors

A File Monitor checks a file location for specific files and file types, and then launches an Event (to execute a Business Process) as a result of detection.

You can configure these objects to also move, rename, overwrite, and archive the files they detect. Since File Monitors work primarily with .xml, .txt, and .csv files, they are not useful when your source data is from a database.

Business Use

Every day your processing department receives orders from a customer’s FTP site, and places them in a specific directory on your network to be processed. A File Monitor checks the directory every hour; when a file is detected, it launches an Event to begin processing the file, and also archives the file to another directory.

Or, your back-end ERP’s outbound process writes documents to a specific directory; in this case, the File Monitor detects the file and launches an Event that processes the outbound invoice.

In addition to the above example, another Event could be associated with the File Monitor to generate and send you an email each time an incoming document arrives in the monitored directory.

This object is a simple but effective way to capture source interface data and begin transformation activity. File Monitors transport files into Clarify, and prompt some type of action to occur through the use of an Event.

Substitution Variables and Regular Expressions

Substitution Variables are replacement values resolved at runtime that supply input to the New Name field if the Rename file checkbox is selected. Multiple Substitution Variables and constant values may be used to define the new name.

The four types of Substitution Variables that can be used with a File Monitor are:

  • Next Number – To use an incremented number in the file name, the value provided must match the name of a Next Number object.
  • Date/Time – To use the current date/time, the value provided must be a Java-supported date and time pattern.
  • Generate UUID – A value consisting of characters and numbers that cannot be duplicated.
  • Original Filename – The original filename of the document received by the File Monitor.

A Regular Expression is a sequence of characters that forms a search pattern, mainly for use in pattern matching with string values. They can be used to define the File Name Filter field to select documents that conform to the Regular Expression pattern.

Two examples of Regular Expressions are:

.* Any Character, zero or more times
\. A backslash can be used prior to indicating a literal value

Process Summary

To use this object, you must:

  • Create the object.
  • Define the object by indicating the target directory, related filters, monitor frequency, and the Event to be launched.
  • Enable the File Monitor either manually, with a Business Process, or set it to run as a service.