11.0:documentation:application_configuration:dev:scheduled_tasks

To be merged into TUTORIAL

Long running tasks

Long running tasks (LRT) in CzechIdM are available at the menu Settings → Task scheduler. LRT is a task which start is planned in advance and the instance runs at the background. Examples of LRT are identity lifecycle processes. The run of the LRT can be planned as one time run or periodically.
The first card of the form is Running tasks. It consists of the list of all currently running tasks. Progress bar of each running task is also available, if the LRT type supports it. Progress bar values are approximate and the total object count can change during LRT runs in some cases. In other words the LRT can start with progress 0/3598 which in a moment changes into na 0/1568 since there is some other change being done on the background of the aplication.

The next card Scheduled tasks shows the list of all available LRT. On the card one can create/delete tasks as well as plan the runs of the tasks or start the immediate run.

When clicking on green button Add in the right upper corner we create a new LRT. On the popup window we choose the type of the task. In our example we choose the task that realize identity lifecycle process "end of user contract". We can also type the task description which will be then viewable at the list of all task. The last configurable option is instance, which defines the instance of CzechIdM that the task will run on. This choice has purpose only if the CzechIdM is installed in several instances. So in majority of cases the default value of idm-primary is the best choice. Then we save our new task by clicking on Save. Creating new LRT does not start the run instantly.

In previous step we prepared new LRT, run of which we now want to plan. In our example we want that the LRT will run every day at 1:15 AM. To do so we click on the green button Add in the row with our previously created LRT and the column Planned runs. In next popup window, we can choose from these three options:

  • One time run - By choosing the date via calendar we plan one run of the LRT. If the time was entered in the past, then the task is launched right away.
  • Cron - Periodical runs. Syntax of this option follows the CRON syntax, if you are not familiar with the CRON syntax, click on the link Expression on the window. In our example we set the cron to a value of 0 15 1 * * ?
  • Dependent task - By choosing the other task - when other task successfully ends, then this task will run.

Every LRT can have several planned runs in the future. Planned run can be of course deleted. We can do that by clicking on the red cross sign next the planned run in the column Planned runs.

We can also start the LRT instantly. Use the green button with the sign of triable in the row with chosen LRT.

On card All tasks there is a list of all runs of all LRT (including currently running ones).

After clicking on magnifying glass next to the task there is task detail available. We can see the information about the running time, processed objects etc…

Dry Run is tool in CzechIdm which allowes us to run current Long Running Task with no changes after. Only results which this current task will produce in future non-DryRun run are displayed.

You can reach this tool by going to Task scheduler-Scheduled tasks and than you hit blue play button (Example in the picture below). Than in detail page of current Long Running Task you can see Basic information about task but mostly connected with Dry Run, Processed items and Queue.

Processed items

This agenda showes you all entities which were processed by current task or in case of Dry Run it will showes all entities which are in queue. It is displayed with sign "Not executed" which means that this process was just in demo-run(Dry Run).

Queue

Queue is basically list of items which were already processed by this Scheduled task(executed-not Dry Run).

If we open detail of our Long Running Task than we can choose from three other pages:

  • Basic information
  • Processed items
  • Queue

Both pages Processed items and Queue is same in Dry Run. It is up to user if it is processed with Dry Run or normal run.

Basic information

This page contains basic information about Long Running Task:

  • Created: timestamp when was this Long Running Task created at the page Scheduled tasks
  • Started: timestamp when was this Long Running Task runned at the page All tasks
  • Task type: type of current task
  • Instance
  • Parameters: other parameters of this task
  • Description
  • Processed: two numbers- Number of items with result executed/ How many should be processed
  • Task duration: How long does the task last - if you roll over with mouse than you can see exact time
  • Result