Modeling delays, escalations, and timeouts by using timer events

To specify when an activity occurs or when another path in the process should be taken, use intermediate and boundary events of the timer type.

Before you begin

To perform this task, you must be in the IBM® Process Designer desktop editor.

About this task

In a business process definition (BPD), use timer events to control when activities occur within a process flow or when a process flow takes a specific path. That is, use timer events to do the following things:
  • Create a delay to prevent an event or activity from immediately triggering.
  • Create an escalation to handle when an activity fails to complete in a timely fashion.
  • Create a timeout to prevent a flow from waiting indefinitely.
Each timer event has an associated timer. The time interval for the timer is calculated according to the configuration that you specify in the implementation properties for the timer event. Normally, when the specified time interval elapses, the timer event triggers and the sequence flow goes out from the timer event to a subsequent node. However, when a BPD instance suspends, the timer events do not trigger. All of the timers within the timer events continue to track the passage of time though. If any timers elapse while the instance is suspended, their associated timer events wait for the BPD instance to resume before they trigger.

For modeling delays, use timer intermediate events that have sequence flow lines that are entering it and sequence flow lines that are leaving it.

An intermediate timer event that is connected to a start node and to an activity through sequence flow lines
The process waits for the timer in the timer event to elapse before it proceeds to the next node. For example, if your BPD has an activity that emails offers to customers and an activity that has the sales team contact these customers two days later, model a delay by using a timer intermediate event between the two activities. The delay ensures that two days pass between the emails and when the sales team starts contacting the customers.

For modeling escalations, use timer boundary intermediate events. Timer boundary events are attached to an activity in a BPD.

An activity with a timer boundary intermediary event. A sequence flow line connects the timer boundary event to an activity to create an escalation path.
When a running process instance reaches an activity that has a timer boundary event, a timer starts. When the timer elapses, the process follows the sequence flow from the timer boundary event to a subsequent activity. For an example, see Hiring tutorial: Add a timer intermediate event in the Hiring Tutorial or see the Hiring Sample.

For modeling timeouts, use timer intermediate events that are included in event gateways. If the other intermediate events in the event gateway group do not trigger before the timer elapses, the timer intermediate event triggers instead. When you add an event gateway, Process Designer automatically adds a timer intermediate event and a message event to the event gateway group. You configure the timer intermediate event to specify the timeout period.

Event gateway that includes a message event and a timer intermediate event
For information about creating an event gateway, see Modeling event gateways.

Procedure

To model a delay, escalation, or timeout:

  1. Open the Process Designer desktop editor.
  2. Open a BPD in the Designer view.
  3. Drag an intermediate event icon from the palette.
    • To create a delay, drop the intermediate event into a blank area of the canvas.
    • To create an escalation, drop the intermediate event onto an activity. This action attaches the intermediate event as a boundary event. To verify that you have created a boundary event, select the activity and check that the outline of the activity includes the event icon.

      To have multiple escalations, attach more than one intermediate events to the activity. Each boundary event triggers a different escalation path.

    • To create a timeout, drop the intermediate event into an event gateway group.
  4. Select the intermediate event and open its Implementation properties.
  5. From the list of Intermediate Event types, select Timer.
  6. If you are creating an escalation and you want the activity to remain open after the timer is triggered, in the Boundary Event Details section clear the Interrupt Activity check box. For example, imagine that you create a timer boundary event for a user task. The human service that is associated with the user task has coaches. If you want the users to complete the coaches even after the timer elapses, clear the Interrupt Activity check box. If you clear the Interrupt Activity check box, you can choose to have the escalation occur only once by clearing the Repeatable check box.
  7. Specify when to start the timer for the timer event by setting the Timer properties:
    1. Set what starts the timer with the Trigger On field. For example, to start the timer when the due date for an activity elapses, select After Due Date. The due date is calculated according to the work schedule for the BPD and the priority settings for the activity. For more information, see Setting the work schedule for a BPD.
      Note: To trigger the timer event before or after a custom date, you can enter the JavaScript to determine the custom date in the Custom Date field. Your JavaScript must return a Date object, which specifies when to start the timer.
    2. To modify the trigger, use the Before or after difference field. For example, if you want start the timer a day after the due date of the activity, type 1 into the field and select Days from the associated list.
      Note: When you select to run the timer event repeatedly, make sure that you set the Before or after difference to at least 1 minute. When the timer is set to Repeatable, an escalation notice is sent each time that the specified interval elapses until the activity is completed. However, if this interval is 0, it causes high CPU load because the escalation notices are continuously sent, without an interval, until the activity completes.
    3. Optional: To further modify the trigger, use the Tolerance Interval field. For example, specify a tolerance level of one hour if you want the escalation to occur one day and one hour after the due date of the activity.
  8. If you are creating an escalation or timeout, create the flow that the process uses after the timer elapses. The escalation path is the logic that the process performs if the timer elapses before the activity it is attached to finishes. Similarly, the timeout path is the logic that the process performs if the timer elapses before another event in the event gateway group triggers.
  9. Connect the timer event:
    • For a delay, use the Sequence Flow tool to connect the timer event to the rest of the process.
    • For an escalation or timeout, connect the timer event to the escalation or timeout path.