Configuration
Timers are only fired when the Job Executor is enabled.Defining a Timer
Timers are configured using an ISO 8601 time format. A timer definition must have exactly one of the following elements.Time Date
This format specifies a fixed time and date in adhering to the ISO 8601 format, when the trigger will be fired. Example:Time Duration
To specify how long the timer should run before it is fired, a timeDuration can be specified as a sub-element of timerEventDefinition. It is possible to define the duration in two different ISO 8601 Durations formats:- PnYnMnDTnHnMnS
- PnW
Time Cycle
Specifies repeating intervals, which can be useful for starting process periodically, or for sending multiple reminders for overdue user tasks. A time cycle element can be in two formats. One option is the format of recurring time duration, as specified by the ISO 8601 Repeating Intervals standard. Example (3 repeating intervals, each lasting 10 hours):Modify a Time Cycle
A timer’s repeat cycle can be controlled via the REST API or by calling the ManagementService. By setting the due date of a timer, it is possible to change the point in time when a timer is executed.cascade flag (when using the REST API) or use the following Java API method:
Expressions
You can use expressions for the timer event definitions. By doing so you can influence the timer definition based on process variables. The process variables must contain the ISO 8601 (or cron for cycle type) string for the appropriate timer type.Re-evaluate a time cycle
A timer’s repeat cycle can be updated if the defined expression is changed. This is achieved by re-evaluation of the expression next time when a timer is fired. So the new cycle will be effective from the next scheduled timer. Let’s observe a scenario with the following timer defined wheremyBean.getCycle()="R3/PT2H":
myBean.getCycle()="R2/PT30M". In effect, the timer will still be triggered at 5 p.m. (as initially scheduled and calculated by the previous cycle). Afterward, it will fire at 5:30 p.m. and 6 p.m. (based on the new cycle).
The feature is disabled by default. To enable it, set the reevaluateTimeCycleWhenDue property to true in the process engine configuration.
Heads-up!To enforce an immediate re-evaluation of a time cycle, follow the steps:
- Change the expression of the time cycle (e.g., Adjust the Spring bean that resolves the cycle).
- Update the current timer job due date:
- via Java API: ManagementService#setJobDuedate
- via REST API: Job/operation/setJobDuedate
- via Cockpit: Navigate to the Job view of the currently running process instance and select “Change due date for this Job” button.
Handling of Timezones
The configuration2022-03-11T12:13:14 does not specify a time zone. At runtime, such a date is interpreted in the local time zone of the JVM executing the process. This can be problematic in various cases, such as when running multiple ASEE Flow nodes in different time zones or when you cannot assume the time zone the platform runs in. Furthermore, there can be glitches with respect to daylight saving time (DST). If in doubt, specify the time in UTC (e.g., 2022-03-11T12:13:14Z) or with a UTC-relative offset (e.g., 2022-03-11T12:13:14+01).
ASEE Flow Extensions
| Attributes | camunda:asyncBefore, camunda:asyncAfter, camunda:exclusive, camunda:jobPriority |
|---|---|
| Extension Elements | camunda:failedJobRetryTimeCycle, camunda:inputOutput |
| Constraints | – |
Timer Start Event
A timer start event is used to create process instance at a given time. It can be used both for processes which should start only once and for processes that should start in specific time intervals. Note: A subprocess cannot have a timer start event. Note: A timer start event is scheduled as soon as process is deployed. There is no need to callstartProcessInstanceBy..., although calling start process methods is not restricted and will cause one more start of the process at the time of the startProcessInstanceBy... invocation.
The XML representation of a timer start event is the normal start event declaration, with a timer definition sub-element. The following example process will start 4 times, in 5 minute intervals, starting on 11th of March 2022, at 12:13 (UTC +01, 24 hour clock system):