Try OpenEdge Now
skip to main content
Developing BPM Applications with Developer Studio
Defining rules with Rule Wizards : Using the File Poller Rule wizard
 

Using the File Poller Rule wizard

You can use the File Poller rule wizard to poll a file system for a specific event or pattern of a folder or file, which triggers a user-defined rule to process that event. You can also use the file system to asynchronously interact with external applications without needing to develop application-specific adapters. This wizard also collects statistical data on the number of messages received by action type and a count of the successful processing of such events. This information is collected in Statistics and Configuration infopads. The Statistics infopad dynamically adds a row whenever a new event or folder is detected.
This type of rule wizard can only be applied to a process, not a workstep.
To apply a File Poller rule to a process:
1. From the Integration category, drag the FilePoller () icon to the Content pane, opening the File Poller wizard.
2. From the Description page, review the description of the rule wizard, then click Next to continue. Click Cancel, at any time, to exit the wizard.
3. From the second page, you can enter the name of the rule group, as well as specify the Poll start time and interval.
a. Enter the name for the rule template you want to create in the Name box.
b. From the Poll Start Time section, you can define when the file polling action is activated.
*If you select the Duration option, you can define the duration of time to elapse before the action is activated. as discussed in 2.b.
*If you select the Deadline option, you can set the specific date and time when the action will be activated. as discussed in 2.b.
c. From the Poll Interval section, click the ellipsis button provided to open the Duration dialog box where you can set the time interval between file polls.
d. Click Next to continue.
4. From the Defining Folders page, you can specify the parent root of the folder that you want to poll, as well as the file name pattern and other settings.
a. To select the root folder, click the ellipsis button next to the Root Folder box, then browse to and select the root folder.
b. To specify the folder under the root folder that will be polled, click the ellipsis button next to the Folder Name box, opening the Folder Name dialog box.
*Enter the name of the folder to be polled in the Folder Name box.
*If required, add a prefix or suffix to the polled folder, in the supported date format, by selecting the appropriate option.
c. From the File Name Pattern section, you can select any of the following pattern options for the file polling.
*RegExp Pattern option to specify the Regular Expression pattern for files in the folder that is to be polled. For example, this pattern accepts a text representing the file name with an extension or you can enter a regular expression that the actual files need to match, example, entering .+.log matches any file name with a log extension.
*Name Prefix option to specify a file name pattern. Click the adjoining ellipsis button, opening the Name Prefix dialog box, where you can specify the name of the file in the File Name box. Optionally, you can select an appropriate option from the File Name Prefix/Suffix section to poll files by the date format that is prefixed or suffixed to a String value.
*External Filter option to specify a user-defined Java class that implements the java.io.FilenameFilter interface. You must implement this class and keep its compiled version in the classpath of the BPM Events server under the workspace/<ApplicationName>/adapters folder.
d. From the Sort Using drop-down list, you can control the order in which the FileFound events are fired (in the case that multiple files have changed). The available sorting options are Size (file size), Name (file name), Extension (file extension), and Modification Time (the default selection).
e. From the Order By drop-down list, select either ASC (ascending) or DESC (descending) option.
f. Click Next to continue.
5. From the Actions page, you can select any of the following actions from the drop-down list provided, then click Add. You need to define at least one action.
*Create Process Instance creates a process instance as a result of the polling of specified files.
a. In the Creator box, define the user ID (must be a valid Application User) to be used as the name of the creator of the process instance. If you use the default, "{manager}", it is replaced by the user ID of the process manager.
b. In the Instance Name Prefix box, enter the name of the process instance to be created. This name is automatically assigned a suffix that contains "#", followed by the unique system-generated ID of the process instance. If you use the default, "{docname}", it is replaced by the file name of the incoming document that triggers this rule.
c. Select an option from the Priority drop-down list to specify the priority of the process instance.
d. The Document Dataslot(s) drop-down list displays all the available Document dataslots in the current process template. Select the dataslot in which the incoming document is uploaded when creating the process instance.You can also initialize the Document dataslots by clicking Add to open the Select Dataslots dialog box. Select a Document dataslot from the list and click OK.
*The procedures to define the remaining actions are similar to as described in Step 5 for Process Path Wizard. The only exception is for Send Mail action, you can only specify e-mail addresses in the To and From boxes, and the e-mail subject and message in the respective boxes.
6. From the Summary page, review the summary of the parameters you have selected for the File Poller rule wizard. Click Next to continue, or click Back to return to previous pages if you need to return to previous pages and make corrections.
7. From the Save As page, modify (if required) the name of the rule file in the File name box, or click the adjoining ellipsis button to change the location of the rule file.
8. Click Finish to create the new rule file in the specified location and apply it to the process.