4.9. Completing a Task by Timer

To complete a task after a certain time interval, you should:

  • Add the Boundary timer event node to the task node.

  • Draw the flow from the timer node to another required node.

  • Define an expression for the time interval in the Time duration property of the timer node. For example, PT15M is an expression for 15 minutes interval.

  • Set the Cancel activity property to true. It will cancel the current task when the timer is fired.

  • In the Timer outcome property, define the task outcome that should be used when the task is completed by the timer.

TimerEdit
Figure 27. Timer Edit

Defining an outcome for the timer:

<boundaryEvent id="managerApprovalTimer" cancelActivity="true" attachedToRef="managerApproval">
    <extensionElements>
        <cuba:outcome>approve</cuba:outcome>
    </extensionElements>
</boundaryEvent>
Tip

By default, the Job executor for processing timers is disabled. To enable it, set the application property bpm.activiti.asyncExecutorEnabled = true.