Task Scheduler - create and configure a trigger

A trigger is a tool in CzechIdM that initiates scheduled tasks. At the moment, there are three types of triggers. We can schedule a task to commence just once, periodically or after another scheduled task has successfully finished. Let's start with newly created scheduled tasks. (Tutorial for scheduled tasks)

So we have three scheduled tasks, none of them has any trigger. Let´s start with the first scheduled task (by description). Click on the Add button in Scheduled starts and a pop-up window will show up.

We have four types of triggers:

  • Once time start trigger - task starts once in configured date and time.
  • Repeated start trigger - configure period to repeated task start. Configured period is converted to cron expression on the background.
  • Cron trigger - cron expression can be configured directly.
  • Other task trigger - task is started after other (dependent) task ends.

On the first scheduled task we will configure a trigger which will start the scheduled task just once. For type, choose One-time start and in Fire time by clicking on "calendar" select the date and at the bottom of the calendar menu click on "hours" and select the time.

We have now configured a scheduled task and a date is set when it will be initiated. After that start, the trigger will disappear and we can select a new trigger. Now click the Add trigger button next to the second scheduled task.

Now select the trigger type Repeated start. We can choose interval from prepared options which could start the scheduled task periodically from given valid date. Configured period is converted to cron expression on the background. Behavior is the same as cron trigger, which is described below.

Now select the trigger type Cron. In Cron expression field you can add an expression which could start the scheduled task periodically. We set 0 0 7 * * ?, meaning the scheduled task will be started every day at 7 AM. When valid date is configured, then first start of the task will be postponed to given date.

Cron expression tutorial: http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html

Other common combinations:

  • 0 0 * * * ? - start the task every hour
  • 0 0 7 * * ? - start the task every day at 7 AM
  • 0 0 5 ? * MON - start the task every monday at 5 AM
  • 0 0 11/12 * * ? - start the task twice every day - at 11 AM and at 11 PM

In the picture above, we can see another trigger and the next scheduled start is tomorrow on 31st January at 7 AM. This trigger will not disappear after that date, but will be updated to another start.

Now we add the trigger to the last scheduled task and in Type select Other task. In Other task field select another scheduled task, but as you can see on the picture above, scheduled tasks are represented by their description, because there can be more scheduled tasks with same task type. In this tutorial we selected the second scheduled task.

In the picture above, you can see the third scheduled task has a trigger with another task. After this task (in our case the second task) has successfully finished, the third scheduled task will start.

If we click on the scheduled task in trigger, a pop-up will show the details of that scheduled task.

  • by apeterova