File Poller

The File Poller activity is a process starter activity that polls for files or directories with the specified name and starts a process, when a change (creation, modification, or deletion) is detected.

General

The General tab has the following fields.

Field Literal Value/Process Property/Module Property Description
Name None The name to be displayed as the label for the activity in the process.
Filename Yes The path and name of the file or directory to monitor.

You can also use wildcard characters to monitor a directory for files that match the provided specification. For example, C:\files\*.log must match any change to a file in the files directory with an extension of .log.

Polling Interval(sec) Yes The polling interval (in seconds) to check for the specified file.
Include Existing Files None Check for the specific file among the files that existed before the process engine starts.
  • When selected - the existing file matching the specification in the Filename field creates a new process instance, when a process engine starts.
  • When not selected - any existing file matching the specification in the Filename field is ignored, unless there is a change in the file.
Exclude File Content None Specifies not to load the data from the file into this activity’s output. If selected, the contents of the file are not available to the subsequent activities in the process.
Content as Yes The type of content in the file which can be either Text or Binary. This field is available only when the Exclude File Content check box is not selected.
Encoding Yes The character encoding for the file (when Text is specified in the Content as field). This field is visible only when Content as value is set to Text.
Include Timestamp None Select the check box to display timestamp, in addition to the date.

Description

Provide a short description of the activity.

Advanced

The Advanced tab has the following fields.

Field Description
Sequence Key This field can contain an XPath expression that specifies which processes should run in order. Process instances with sequencing keys that evaluate to the same value are executed sequentially in the order the process instance was created.
Custom Job Id This field can contain an XPath expression that specifies a custom ID for the process instance.
Poll for Create Events Select this check box to start a new process when a file or directory matching the specification in the Filename field is created.

If not selected, the newly created files or directories are ignored.

Poll for Modify Events Select this check box to start a new process when a file or directory matching the specification in the Filename field is modified.

If not selected, the modifications to the files or directories are ignored.

Poll for Delete Events Select this check box to start a new process when a file or directory matching the specification in the Filename field is deleted.

If not selected, deletions of files or directories are ignored.

Include Sub-Directories Select this check box to enable monitoring of the events that occur in subdirectories of the specified directory.

If not selected, only the directory is monitored and subdirectories are ignored.

Mode Select the type of polling to perform from the following modes in the drop-down list:
  • Only Files: only tracks the specified changes for files.
  • Only Directories: only tracks the specified changes for directories.
  • Files and Directories: tracks the specified changes for both files and directories.
Sort by Specifies the order in which the files should be processed, if more than one file is detected. You can sort by File Name, Date Modified, or None.

The files are processed as the polling interval occurs. Hence, the Sort By field applies to all files that have changed since the last polling interval. The field is useful for processing the files in a specific order when the process engine starts and the Include Existing Files field is selected (then all existing files are processed in the specified order).

Note: The File Poller activity starts process instances based on the specified Sort By order, but the process instances may not complete in the same order. If you want to guarantee that processes start and complete in a specified order, specify Max Jobs = 1, and set the engine persistence mode to group or datastore.
Sort Order Specifies whether the order specified in the Sort By field is Ascending or Descending. This field is only applicable if the Filename or Date Modified is selected in the Sort By field.

Output

The following is the output for the activity.

Output item Datatype Description
action string The occurred event to trigger the File Poller activity. The possible values are: create, remove, or modify.
timeOccured integer The time when the File Poller activity detected the change in the file.

The time is defined as the amount of time in milliseconds. For example, since midnight, January 1, 2013 UTC.

fileInfo complex This element contains the fileName, location, type, readProtected, writeProtected, and size data.
fullName string The name of the file, including the path information.
fileName string The name of the file without the path information.
location string The path to the file.
configuredFileName string The name of the file or directory this activity is configured to operate on.
type string The file type.
readProtected boolean Signifies whether the file or directory is protected from reading
writeProtected boolean Signifies whether the file or directory is protected from writing
size integer The size of the file in bytes.
lastModified string The timestamp indicating when the file was last modified.
fileContent complex The element containing the textContent and binaryContent data.
textContent string The content of the file (text files), if the Exclude File Contents check box is not selected on the General tab.
binaryContent binary The content of the file (binary files), if the Exclude File Contents check box is not selected on the General tab. Only available only if type is set to binary.
encoding string The character encoding for the file. This field is present only if Content as field is set the value as Text.