Chapter 24. Timing

Timing is a mechanism for scheduling actions and is used by Timer Intermediate and Timer Start events. It enables you to delay further execution of a process or task.

Note

A timer event can be triggered only after the transaction is commited, while the timer countdown starts right after entering the node, that is the attached node in case of a boundary event. In other words, a timer event is only designed for those use cases where there is a wait state, such as a User Task. If you want to be notified of the timeout of a synchronous operation without a wait state, a boundary timer event is not suitable.

The timing strategy is defined by the following timer properties:

Time Duration
Defines the period for which the execution of the event is put on hold. The execution continues after the defined period has elapsed. The timer is applied only once.
Time Cycle
This defines the time between subsequent timer activations. If the period is 0, the timer is triggered only once.

The value for these properties can be provided as either Cron or as an expression by defining the, Time Cycle Language property.

Cron
[#d][\#h][\#m][\#s][#[ms]]

Example 24.1. Timer Period With Literal Values

1d 2h 3m 4s 5ms

The element will be executed after 1 day, 2 hours, 3 minutes, 4 seconds, and 5 milliseconds.

Any valid ISO8601 date format that supports both one shot timers and repeatable timers can be used. Timers can be defined as date and time representation, time duration or repeating intervals. For example:

Date
2013-12-24T20:00:00.000+02:00 - fires exactly at Christmas Eve at 8PM
Duration
PT2S - fires once after 2 seconds
Repetable Intervals
R/PT1S - fires every second, no limit, alternatively R5/PT1S will fire 5 times every second
None
#{expression}

Example 24.2. Timer period with expression

myVariable.getValue()

The element will be executed after time period returned by the call myVariable.getValue().