====== Scheduled task for automatic role(s) recalculation ======
IdM offers [[devel:documentation:scheduled_task|scheduled tasks]] for recalculation of automatic roles.
There are two types of automatic roles - based on organisation structure and based on attribute. There are also two types of scheduled tasks - to recalculate single automatic role and to recalculate all roles of specific types. Combination of these gives us 4 basic scheduled tasks as listed in following table:
^ Scheduled task name ^ Scheduled task code ^
| Recalculate automatic role by attribute | ProcessAutomaticRoleByAttributeTaskExecutor |
| Recalculate all automatic roles by attribute | ProcessAllAutomaticRoleByAttributeTaskExecutor |
| Recalculate automatic role by tree structure for contracts and positions | ProcessAutomaticRoleByTreeTaskExecutor |
| Recalculate all automatic roles by tree structure for contracts and positions | ProcessAllAutomaticRoleByTreeTaskExecutor |
These task are not created in scheduled tasks by default, but they can be [[tutorial:adm:how_to_work_with_task_scheduler|added and run manually]]. Once added they can also be [[tutorial:adm:create_and_configure_trigger|scheduled]] to run later or repeatedly.
When using filter in scheduled tasks or adding new scheduled task and searching in dropbox, you can paste there string //AutomaticRoleBy//. All four scheduled task code have that in common so you can easily find them all and then select which is needed.
When adding //Recalculate all automatic roles by attribute// or //Recalculate all automatic roles by tree structure for contracts and positions//, you simply add them as they have no parameters.
For //Recalculate all automatic roles by attribute// and //Recalculate automatic role by tree structure for contracts and positions// you always need to set as parameter specific automatic role from dropbox.