Time triggers

Introduction to time triggers

Time triggers are interrupts which signal that a certain time has passed since a case has entered a scope or activity. They can be attached to scopes and activities. A time trigger attached to a scope is initialized when a case has entered this scope. Scopes can have several time triggers. A time trigger attached to an activity is initialized when this activity has been executed. An activity can have only one time trigger. The actions which should be performed when the configured time has passed need to be scripted in an automatic activity connected to the trigger.

Examples for the use of time triggers:

Process logic with time triggers

The following general logic applies to time triggers:

The time measuring of a trigger is started (i.e., the trigger is initialized) when the case enters the scope / activity. It stops (i.e., the trigger fires) when the defined period of time which has been set as fixed value (minutes / hours / days) or the manually defined time has elapsed.

  1. The trigger is initialized, i.e., the time measuring is started, when the case enters the scope or activity.

  2. The trigger fires when the defined period of time has elapsed.

    • For manual triggers at activities, this is the time which the user sets when he executes the activity.

    • For automatic triggers at activities or scopes, this is the time defined in minutes, hours and days.

    • It is possible to set another time when the timer is initialized or running, see Modifying timers in scripts.

    If the time measuring should consider a business calendar, you need to set the Use calendar option and assign a business calendar to the queue, see Using a business calendar.

  3. When the trigger fires, the trigger script is executed. If it returns true, the following automatic activity or decision node with two following automatic activities is executed.

Available settings for time triggers

The following settings are available for time triggers:

Tasks

Using a business calendar

By default, the calculation of the time when a trigger fires is based on absolute times. You can use a business calendar to adapt the calculation to your working hours. This avoids that time triggers fire during the weekend or outside your business hours.

Please perform the following steps to use a business calendar:

  1. Define a business calendar, see Calendars.

  2. Assign the business calendar to the queues which use the workflow, see Queues.

  3. Select the checkbox Use calendar for all time triggers to which the business calendar should apply, see Available settings for time triggers.

Example: A time trigger is set to fire after 1 day.

Without business calendar:

The trigger fires 24 hours later, i.e., at the same time on the next day.

With business calendar:

There is a business calendar which defines the working hours as Monday to Friday from 9am to 5pm. The trigger fires 24 business hours later.

The following figure shows an example of business calendars used to calculate SLA times.

Figure 14: ConSol CM - Business calendar

You can use the methods of the class BusinessCalendarUtil to calculate time periods which are based on a business calendar.

Modifying timers in scripts

You can modify timers in several ways, depending on the current point within the process.

Timer is initialized

The timer is initialized when the case enters the respective scope or activity. At this point, the timer can be modified using the initialization script. This script can be used, for example, to calculate the reaction time based on the case priority, or to disable the timer if it is not relevant for the case.

The trigger is implicitly available as trigger (class TimerTrigger) in the script. There are two actions you can perform in the script:

Timer is running

The timer runs as long as the case is located in the scope or activity where the trigger is attached. You can modify the timer using workflowApi methods.

These operations need to performed in an activity outside the trigger flow. The trigger is referenced by its path.

Time has elapsed

The trigger fires when the configured time has elapsed. Then, the trigger script is executed. If it returns true, the automatic activity or decision node after the trigger is executed. If it returns false, they are not executed, i.e., the trigger has no effect for the case.