Processes Waiting on Events
Processes can wait for one or more events, this forms the basis of event-driven process scheduling. You specify as many events as you need to be waited on. The processes based upon those process definitions cannot be executed before the events upon which they are dependent are raised. When a process is created for a process definition, it inherits all the events to be raised, and must wait for those.
A process waits only once for a specific event. So if the event was raised but the process did not start (for example, due to the closing of a queue), the process does not wait again for an event from the same event definition the next time the queue is released.
When a process waits for an event it gets the EventWait status.
Automatically started processes
An event-waiting process can be auto-started when the event is raised. Make sure that all parameters (if any) have default parameter values and a default queue is set. You can set auto-start to:
- Never - A process will never be submitted.
- Always - A process will always be submitted.
- Only one - Only submit a process when there is no process of the same process definition in a pre-running state, a process definition that has not yet reached status Running.
note
An event-waiting process must first be scheduled before it gets the EventWait status.
Restricting When to Wait for an Event
Events can have restrictions applied, for example, only be used on Sundays; in this case processes ignore the event on other days.
Clearing Events
The process that is triggered by the event should clear the event, so that another event-waiter (created later) will wait for another occurrence of the event.
Values
Tab | Field | Description | Default Value |
---|---|---|---|
Wait Events | Event Definition | The event definition the process will be waiting for. | |
Wait Events | Auto Submit | Should the process start automatically each time this event is raised? | Never. |
Wait Events | Clears Event | Should the start of the process clear the event? | No. |
Wait Events | Clear Comment | ||
Wait Events | Only Waited For When > Time Window | Time window to use for restricting when the event is used, either open or closed in the specified time zone or the default time zone, when omitted. | |
Wait Events | Only Waited For When > Expression | Boolean REL expression (returning either true or false ) |
Examples
Attach an Event on Weekends
- Attach an event to wait on Weekends.
- Choose "Definitions > Processes".
- On the Wait Events tab, choose Add.
- Select an event definition, fill
Workdays
in the Time Window field, select System_Week_WorkDays, select closed in the is field. - Choose Save to save the chain definition.
Attach an Event when other Events are Raised
- Attach an event to be raised by process 1 of the first step for status Error only if any of two other events are raised.
- Choose "Definitions > Chains".
- Choose process 1 of the first step.
- Choose Raise Events, choose and select an event definition.
- In the When expression field, fill
=Event.isEventRaised('Mypartition.MyEvent1') || Event.isEventRaised('Mypartition.MyEvent2')
- Choose Save and Close to save the chain definition and close the dialog.
JobChain JobDefinition ProcessDefinition