3.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 the other 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. That 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
Defining an outcome for the timer
<boundaryEvent id="managerApprovalTimer" cancelActivity="true" attachedToRef="managerApproval">
    <extensionElements>
        <cuba:outcome>approve</cuba:outcome>
    </extensionElements>
</boundaryEvent>

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