Schedule your flow
You can schedule a flow to run at a particular date and time, when a file arrives, or a combination of these. You schedule a flow using an event.
Run a flow at a specific time
In the flow definition
Procedure
From the command line
Procedure
Run a flow at multiple times on a single date
Procedure
- In the Flow Editor, open the flow definition.
- Right-click in an empty space in the flow definition and select Flow Attribute. The Flow Attributes dialog box displays.
- Click the Triggering Events tab.
- Click Add to define an event to trigger the flow. The Trigger Flow with Events dialog box displays.
- In the Select type of event field, select Time Event.
- In the Calendar name field, select the calendar that resolves to the dates on which you want this flow to run.
- In the Time zone section, specify the time zone for this time event.
- In the Hours and Minutes fields, specify an expression that resolves to the times when you want the flow to start running. Be sure to specify the times as they appear on a 24-hour clock, where valid values for hours are from 0 to 23. For the syntax of the time expression, see Specifying time expressions.
- In the Duration of event field, specify the number of minutes after the specified times that the flow can start. This is especially useful if the flow is triggered by multiple events, requiring that you define a time window in which the flow can start. If the flow must start exactly at the specified time, leave the duration at 1 minute.
- Optional. In the End after ... occurrences field, specify the maximum number of occurrences of this time event before you want it to end.
- Click OK. The Triggering Event(s) tab reappears, and the time event you defined appears in the list.
- Click OK.
- From the Action menu, select Submit to submit the flow. The flow definition is submitted to Process Manager, where it will be scheduled at the specified times, each day the calendar is true.
Specifying time expressions
You can specify several times for the event to trigger. You can:
Procedure
Run a flow based on file activity
In the flow definition
Procedure
Examples
Triggering when a file exists
The following file event triggers the flow when the file /tmp/core exists:
When triggering a flow when a file exists, keep the following in mind:
Process Manager polls periodically to see if the file exists. When it does, the flow is triggered. The default polling interval is 30 seconds. Check with your Process Manager administrator to see what your polling interval is set to.
Unless the file is deleted, after the flow is triggered, it will trigger again each time Process Manager polls and finds the file exists, unless you combine this event with another such as a time event.
Triggering when a file is deleted
The following file event triggers the flow when the file tmp/update is deleted:
After the flow is triggered, it will trigger again each time Process Manager polls and finds the file does not exist, unless you combine this event with another such as a time event.
Triggering when a file is more than 15 minutes old
The following file event triggers the flow when the file /tmp/data is more than 15 minutes old:
Triggering whenever a file arrives
The following file event triggers the flow every time a tar file arrives in the tmp directory:
From the command line
Procedure
jsub -F “file_event” flow_file_name
where file_event is the definition of the file event that triggers this flow and flow_file_name is the full path name of the file containing the flow definition. For example:
jsub -F "arrival(/tmp/*.tar)" testflow.xml