Timer Event

🌐 This document is available in both English and Ukrainian. Use the language toggle in the top right corner to switch between versions.

1. Overview

A Timer Event is an event that is activated by a defined timer. It can be a defined time and date, or a time interval, for example, "every Monday". Each timer has its own waiting time and corresponding configuration.

timer event 01

Timer can’t be an end event, due to process approach.
We differentiate 2 types of Timer Events currently supported by the Platform:
  • Time Intermediate Boundary Interrupting Event — an event that works like a stopwatch and processes events by activating a timer. When the timer triggers (for example, after a certain interval), a sequence flow that comes from the intermediate timer event is executed. The current flow of business process execution is not paused during the event waiting period.

Basically, when an event execution is triggered, provided the event has an interconnected boundary event, the flow is continued. When a timer is triggered, for example, after a certain interval, the activity is nullified, and an alternative sequence flow that comes from the timer event is executed.

timer event 02

  • Time Intermediate Catch Event — an event that acts like a stopwatch or an alarm clock, and cuts business process execution at a certain point, waiting for the execution of the next element of the business process (continuing the sequence flow execution). The current flow of business process execution is paused during the event waiting period.

timer event 03

2. Timer types and their configuration

The timers used in Timer Events modeling can be defined by:

Date

Date timer sets a moment in time, defined as a combined representation of date and time according to ISO 8601 standard. Optionally, it can contain time zone identificator. For example, 2019-10-02T08:09:40+02:00[Europe/Kyiv] (follow the link more info).

Duration

Duration timer is set according to the ISO 8601 duration format, which defines the amount of time in a certain time period. For example, P14DT1H30M — 14 days, 1 hour and 30 minutes (follow the link more info).

If the duration is set to zero or a negative value, the timer will trigger immediately.
Cycle

Cycle timer is defined as ISO 8601 repeated interval format; it includes duration and the number of cycles. For example, R5/PT10S — repeat every 10 seconds, 5 times (follow the link more info).

If the number of cycles is not set, the timer will trigger infinitely, until canceled.

3. Time Intermediate Boundary Interrupting Event modeling

To model Time Intermediate Boundary Interrupting Event, take the following steps:

  1. Open Camunda Modeler application and create a new BPMN diagram by clicking BPMN diagram. This will open the new diagram window.

    bp 1

  1. Add the Intermediate Boundary Interrupting Event element

    • Select Create Intermediate/Boundary Event on the panel on the left and drag it onto the modelled task (in this case — user task).

      To add a timer, you can use any type of task: user, service, script, etc.

      timer event 1 timer event 2

    • Select an event, define its type by clicking the key icon (Change type) and selecting Timer Boundary Event from the menu.

    timer event 3

  2. Click the Timer Boundary Event element, navigate to the configuration panel and configure the event:

    • In the Name field, enter element name (optional). It can be a timer purpose, or business-related name.

    • In the Timer Definition Type field, set timer type by selecting one from the dropdown. For example, Duration (follow the link more info)

      timer event 4

    • In the Timer Definition field, define timer duration. For example, PT3S for 3 seconds.

      In Camunda, date and time for timers are set in a special format, according to ISO 8601 standard (follow the link more info).

    timer event 5

As a result, your Time Intermediate Boundary Interrupting Event is modeled and configured.

4. Time Intermediate Catch Event modeling

To model Time Intermediate Catch Event, make the following steps:

  1. Open Camunda Modeler application and create a new BPMN diagram by clicking BPMN diagram. This will open the new diagram window.

    bp 1

  2. First, model a start event and a user task.

  3. Add the Time Intermediate Catch Event element:

    • On the left panel, select Create Intermediate/Boundary Event and drag it to the modeling canvas.

      timer event 1

      timer event 6

    • * Select an event, define its type by clicking the key icon (Change type) and selecting Timer Intermediate Catch Event from the menu.

      timer event 7

  4. Click the Timer Intermediate Catch Event element, navigate to a configuration panel and set up the event:

    • In the Name field, enter element name (optional). It can be a timer purpose, or business-related name.

    • In the Timer Definition Type field, set timer type by selecting one from the dropdown. For example, Duration (follow the link more info)

    • In the Timer Definition field, set time and date for the timer. For example, 2022-15-05T16:30:00+03:00[Europe/Kyiv] — timer will trigger on May 15th, 2022 at 16:30 Kyiv time (UTC+3).

      In Camunda, date and time for timers are set in a special format, according to ISO 8601 standard (follow the link more info).

      timer event 8

As a result, your Time Intermediate Catch Event is modeled and configured.

5. Example of using Timer Events in a business process

In this example, we will review the logic of two types of Timer Event, using a simple synthetic business process, which registers transactions as a bank service.

timer event 9

  1. Start event initiates the process.

  2. The bank service awaits money transfer to the client’s account or card. A Time Intermediate Boundary Interrupting Event modeled in the service task has a timer set on a certain date (15.05.2022).

  3. If the transfer is made before 15.05.2022, the next element of the main sequence flow will initiate.

  4. If the transfer wasn’t made before 15.05.2022, main flow activity is nullified, and an alternative sequence flow that comes from the timer is executed — the service must form a report on account balance and end the process. In this case, we see that the event canceled the main flow, and the token went along the alternative branch.

  5. The money was transferred, and the service must wait 2 hours, as Time Intermediate Catch Event is configured. In this case, activity is not interrupted, and the main flow is suspended for the timer period.

  6. After the 2 hours passed, the main flow continued, the service will send the client a notification about the money transfer, and end the process.