11.11. Timers

Timers wait for a predefined amount of time before triggering, once or repeatedly. You can use timers to trigger certain logic after a certain period, or to repeat some action at regular intervals.
Configuring timer with delay and period

A Timer node is set up with a delay and a period. The delay specifies the amount of time to wait after node activation before triggering the timer for the first time. The period defines the time between subsequent trigger activations. A period of 0 results in a one-shot timer. The (period and delay) expression must be of the form [#d][#h][#m][#s][#[ms]]. You can specify the amount of days, hours, minutes, seconds, and milliseconds. Milliseconds is the default value. For example, the expression 1h waits one hour before triggering the timer again.

Configuring timer ISO-8601 date format

You can configure timers version 6 timers with valid ISO8601 date format that supports both one shot timers and repeatable timers. You can define timers 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 - PT1S - fires once after 1 second
    Repeatable intervals - R/PT1S - fires every second, no limit. Alternatively R5/PT1S fires 5 times every second

Configuring timer with process variables

In addition to the above mentioned configuration options, you can specify timers using process variable that consists of string representation of either delay and period or ISO8601 date format. By specifying #{variable}, the engine dynamically extracts process variable and uses it as timer expression. The timer service is responsible for making sure that timers get triggered at the appropriate times. You can cancel timers so that they are no longer triggered. You can use timers in the following ways inside a process:

  • You can add a timer event to a process flow. The process activation starts the timer, and when it triggers, once or repeatedly, it activates the timer node's successor. Subsequently, the outgoing connection of a timer with a positive period is triggered multiple times. Canceling a Timer node also cancels the associated timer, after which no more triggers occur.
  • You can associate timer with a sub-process or tasks as a boundary event.