Timers

Timeouts can be defined on intermediate timer event, a boundary timer events (both interrupting and non-interrupting). When process execution encounters a timer node, the timeouts are evaluated, process waits for specified time and then resumes.

Image

A timer node has two important settings namely, Timer Definition Type and Timer Definition.

Timer Definition Type

Date supports regular, irregular and repeating intervals specified as ISO 8601 periods or milliseconds. Duration supports milliseconds and single ISO 8601 period string. Cycle supports infinite repeating intervals specified in milliseconds.

Of the three types (Date, Duration and Cycle), it is advised to use Timer Definition Type Date as it is most versatile of all and covers scenario tendered by other two types.

Timer Definition The timer definition value is evaluated as an expression. This means you can specify a direct value or use dollar expressions in the timer definition string. e.g. R3/${pv('startAt')}/P1D. The evaluated timer-definition is treated as follows:

Image

  • If the result is a Date instance, it is used as target time at which timer expires.

  • If result is a valid number, it is used as milliseconds from now when the timer will expire.

  • If result is a string that parses to a valid date, parsed date output is treated as target timeout value.

  • If result string starts with P, it is treated as ISO 8601 period definition.

    Image

    • If string is period definition of the form PnYnMnDTnHnMnS then period is evaluated relative to current time and result is treated as timer expiry.
    • If string contains two or more period definitions separated by #, all periods are evaluated relative to current time. A non-interrupting boundary timer triggers at each of the calculated timeout. For intermediate timer event or interrupting boundary timer the first timeout resumes the process, marking timer as completed and remaining timeouts are ignored.
    • Multiple periods separated by # can be used when non-interrupting timeouts are at irregular intervals.
  • If result string starts with R, it is treated as repeating intervals. Similar to irregular itnervals explained above, repeating intervals apply only to non-interrupting boundary timer events.

    Image

    • Rn/<period> is treated as n repeating intervals starting at now + period. For example, R3/P2D will trigger at 2 days, 4 days and 6 days from now.
    • Rn/<start>/<period> is treated as n repeating intervals starting at specified start date. For example R2/2020-02-25T00:00:00.000Z/P1D will trigger at 2020-Feb-25 and 2020-Feb-26 at (T00:00:00.000Z).
    • Value of format Rn/<periodOne>/<periodTwo>, triggers at now + periodOne followed by n-1 equal intervals of periodTwo. For example R3/P5D/P1D is treated as three timeouts of 5 days, 6 days and 7 days from now.
    • If n (in Rn/...) is not a valid number, default value of 1 is used. (R/ , Rxxx/, R#/, R$/ etc are all treated as R1/)
    • Use R0/ if infinite intervals until the boundary task completion is required. Specification R0/P7D/P1D would trigger a daily reminder 7th day onwards until any action is taken by user on underlying user task.

Other settings like job priority and retry time cycle are unused on the timer node.