Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
tutorial:adm:create_and_configure_trigger [2018/12/28 13:47]
kotisovam
tutorial:adm:create_and_configure_trigger [2019/07/10 07:00]
doischert
Line 1: Line 1:
 +====== 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 [[tutorial:adm:how_to_work_with_task_scheduler|scheduled tasks]])
 +
 +{{ :tutorial:adm:scheduled_tasks_trigger_01.png |}}
 +
 +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.
 +
 +{{ :tutorial:adm:scheduled_tasks_trigger_02.png |}}
 +
 +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.
 +
 +{{ :tutorial:adm:scheduled_tasks_trigger_03.png |}}
 +
 +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**.
 +
 +{{ :tutorial:adm:scheduled_tasks_trigger_04.png |}}
 +
 +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.
 +( 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
 +
 +{{ :tutorial:adm:scheduled_tasks_trigger_05.png |}}
 +
 +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.
 +
 +{{ :tutorial:adm:scheduled_tasks_trigger_06.png |}}
 +
 +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**.
 +
 +{{ :tutorial:adm:scheduled_tasks_trigger_07.png |}}
 +
 +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.
 +
 +{{ :tutorial:adm:scheduled_tasks_trigger_08.png |}}
 +
 +If we click on the scheduled task in trigger, a pop-up will show the details of that scheduled task.
  • by apeterova