Task Scheduler - planning a task and configuration
Task scheduler is a tool in CzechIdM which manages long running operations. One can plan for tasks to run automatically at scheduled times or start them manually. Tasks manage personnel processes such as End of contract or Enabled contract, to name but a few. Password expiration, automatic roles assigning and other tasks are also administered by the task scheduler.
We can make use of this tool by selecting Settings in menu, than choose Task Scheduler. Now it gives you the option of three tabs at the top of the window.
Currently we are on the Running tasks tab. This tab will show you the detailed information of all running tasks which are processed at the moment. Example of this page will be shown bellow.
Scheduled Tasks
Let's move to another tab named Scheduled Tasks. On this tab, we can add new Scheduled tasks by clicking on the Add button in the right corner of the window.
This will create a new Scheduled task in the table located on this tab.
The information in this Create Task window is optional.
Task Type: Usually refers to what the current task does. In the picture, we have an HrEndContractProcess task which will find all contracts with expired validity and take them out.
Description: This column is optional, to be filled in by the person who creates this Scheduled task.
Instance: We currently support only Idm-primary.
Task Parameters: Not every task has parameters filled. Just a few of them have some parameters. (For example AddNewAutomaticRoleTaskExecutor has the parameter roleTreeNode).
Scheduled Starts: Here we can schedule start of this Scheduled Task by clicking on the Add button or we can see its scheduled time.
Actions: We can see three buttons here
- Red Bin Button deletes this task.
- Blue DryRun Button run demo process (shows only what items it will process in the future run).
- Green Run Button run this Scheduled Task and creates a Long Running Task in All Tasks tab.
The difference between a Scheduled Task and a Long Running Task
ScheduledTask is created on page Scheduled tasks by clicking on the Add button in the right corner of the page. After that we have a ScheduledTask which has its own list of processed items empty, of course. The first run of this ScheduledTask is created when we hit the Run button.
The run creates a LongRunningTask that is available on the page All tasks. A new LongRunningTask, let's say ”A”, works with the ScheduleTask A history of the processed items and won’t process them again.
All Tasks
On this tab we can find our created Long Running Tasks. Let's take a closer look at columns in this table.
State: Shows the result of Long Running Task or created instead.
Created: Date and time when was this Long Running Task created on page Scheduled Task(Run button or DryRun button were hit).
Task Type: Refers to Task Type of Scheduled Task.
Parameters: Refers to Parameters of Scheduled Task.
Description: Refers to Description of Scheduled Task.
Processed: How many entities were processed by this Task.
Id: This is identifier of Long Running Task.
As shown in the picture, if you have a Created-state Task and want to process it, then you need to hit the Run all created tasks button in the right corner of the table or select the respective row and then choose Run the selected task in the right corner of the table.
Detail of a Long Running Task
Created: Date and time when this Long Running Task was created on page Scheduled Task (Run button or DryRun button were hit).
Instance: Refers to Instance of a Scheduled Task.
Task Type: Refers to Task Type of a Scheduled Task.
Parameters: Refers to Parameters of a Scheduled Task.
Description: Refers to Description of a Scheduled Task.
Processed: How many entities were processed by this Task.
Task Duration: How long the process takes. You can see the time if you roll over the information.
Started: When the Task started.
Processed items
There is also a table of the processed items. The table shows what items were processed by this task. You can also create a table of all processed items using this Scheduled Task by clicking on the History of processed entities button.
Queue
On this page we can delete items. When we delete some item than in next run of our Scheduled Task this item will be processed too.
Dry-run
This feature allows you to see a preview of items which will be processed by this task without actually processing them. Basically, you initiate this task with the blue Run button which sets the task parameter Dryrun to True.
The final result will show the table items which were “dry-run” and but won’t be included in the history table.