Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
devel:documentation:application_configuration:dev:scheduled_tasks:task-scheduler [2019/11/19 13:49] tomiskar [DeleteLongRunningTaskExecutor] |
devel:documentation:application_configuration:dev:scheduled_tasks:task-scheduler [2020/05/25 05:59] husniko |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Tasks scheduler ====== | ====== Tasks scheduler ====== | ||
- | {{tag> scheduler}} | + | {{tag> scheduler |
The task can be scheduled in three different ways - types of '' | The task can be scheduled in three different ways - types of '' | ||
Line 36: | Line 36: | ||
==== Example ==== | ==== Example ==== | ||
- | Example of an implementing task - you will find everything that has been mentioned [[https:// | + | Example of an implementing task - you will find everything that has been mentioned [[https:// |
===== Stateful task executors ===== | ===== Stateful task executors ===== | ||
Line 59: | Line 59: | ||
* '' | * '' | ||
* '' | * '' | ||
+ | * '' | ||
<note warning> | <note warning> | ||
+ | |||
+ | ===== Recoverable tasks ===== | ||
+ | |||
+ | @since 10.2.0 | ||
+ | |||
+ | Task can be executed repetitively without reschedule is needed. When task is canceled (e.g. by server is restarted), then task can be executed again (~recovered) directly from long running task agenda. New task will be created and executed with the same configuration as original task. **When task** is stateful and **supports queue**, then **already processed items will not be processed again**. | ||
+ | |||
+ | |||
+ | < | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | |||
===== Implemented task types ===== | ===== Implemented task types ===== | ||
Line 69: | Line 85: | ||
Sends warning notification before password expires. Notification is **not send to disabled identities**. Days before has to be given as task's parameter (number greater than zero). More task could be configured e.g. for sending warning notification 14,7,3 days before password expires. Default notification topic is configured to email sender. | Sends warning notification before password expires. Notification is **not send to disabled identities**. Days before has to be given as task's parameter (number greater than zero). More task could be configured e.g. for sending warning notification 14,7,3 days before password expires. Default notification topic is configured to email sender. | ||
+ | |||
+ | <note tip> | ||
==== PasswordExpiredTaskExecutor ==== | ==== PasswordExpiredTaskExecutor ==== | ||
Sends warning notification after password expires. Notification is **not send to disabled identities**. Default notification topic is configured to email sender. | Sends warning notification after password expires. Notification is **not send to disabled identities**. Default notification topic is configured to email sender. | ||
+ | |||
+ | <note tip>Task is scheduled by default on the start of day: ** 0 5 0 ? * * ** - passwords which expired yesterday will be processed and proper notification will be send.</ | ||
==== AccountProtectionExpirationTaskExecutor ==== | ==== AccountProtectionExpirationTaskExecutor ==== | ||
Line 193: | Line 213: | ||
* ``System`` - Delete operations with given system only. | * ``System`` - Delete operations with given system only. | ||
* ``Empty provisioning`` - Delete provisioning operations only without attributes. Operation with DELETE type is not considered as empty (even haven' | * ``Empty provisioning`` - Delete provisioning operations only without attributes. Operation with DELETE type is not considered as empty (even haven' | ||
+ | |||
+ | <code sql> | ||
+ | -- PostgreSql | ||
+ | -- Delete archives | ||
+ | DELETE FROM sys_provisioning_archive WHERE created < now() - INTERVAL '90 day'; | ||
+ | -- Delete attributes | ||
+ | DELETE FROM sys_provisioning_attribute attr WHERE NOT EXISTS (SELECT FROM sys_provisioning_archive arch where attr.provisioning_id = arch.id) AND NOT EXISTS (SELECT FROM sys_provisioning_operation oper where attr.provisioning_id = oper.id); | ||
+ | </ | ||
==== DeleteExecutedEventTaskExecutor ==== | ==== DeleteExecutedEventTaskExecutor ==== | ||
Line 202: | Line 230: | ||
=== Parameters === | === Parameters === | ||
* ``Number of days`` - Delete events older than given number of days. | * ``Number of days`` - Delete events older than given number of days. | ||
+ | |||
+ | <code sql> | ||
+ | -- PostgreSql | ||
+ | -- Delete events older then 3 days | ||
+ | delete from idm_entity_event where result_state=' | ||
+ | vacuum full idm_entity_event; | ||
+ | </ | ||
==== DeleteLongRunningTaskExecutor==== | ==== DeleteLongRunningTaskExecutor==== | ||
Line 225: | Line 260: | ||
<note tip>When long running task is deleted, then processed items are removed too. Scheduled task has another processed items - " | <note tip>When long running task is deleted, then processed items are removed too. Scheduled task has another processed items - " | ||
+ | ==== DeleteNotificationTaskExecutor==== | ||
+ | |||
+ | @since 9.7.12 | ||
+ | |||
+ | Delete notifications. | ||
+ | |||
+ | === Parameters === | ||
+ | * ``Number of days`` - Delete notifications older than given number of days. | ||
+ | * ``Sent only`` - Delete sent notifications only. All notifications older than given number of days will be deleted otherwise. | ||
+ | |||
+ | <code sql> | ||
+ | -- PostgreSql | ||
+ | -- Delete common notification | ||
+ | DELETE FROM idm_notification WHERE created < now() - interval '180 day'; | ||
+ | -- Delete all related notification by type | ||
+ | DELETE FROM idm_notification_console WHERE id NOT IN (SELECT id FROM idm_notification); | ||
+ | DELETE FROM idm_notification_email WHERE id NOT IN (SELECT id FROM idm_notification); | ||
+ | DELETE FROM idm_notification_log WHERE id NOT IN (SELECT id FROM idm_notification); | ||
+ | DELETE FROM idm_notification_sms WHERE id NOT IN (SELECT id FROM idm_notification); | ||
+ | DELETE FROM idm_notification_websocket WHERE id NOT IN (SELECT id FROM idm_notification); | ||
+ | -- Delete recipients | ||
+ | DELETE FROM idm_notification_recipient WHERE notification_id NOT IN (SELECT id FROM idm_notification); | ||
+ | </ | ||
+ | |||
+ | ==== DeleteSynchronizationLogTaskExecutor ==== | ||
+ | |||
+ | @since 9.7.12 | ||
+ | |||
+ | Delete synchronization logs. | ||
+ | |||
+ | === Parameters === | ||
+ | * ``Number of days`` - Delete synchronization logsolder than given number of days. | ||
+ | * ``System`` - Delete logs on the given system only. | ||
+ | |||
+ | <code sql> | ||
+ | -- PostgreSql | ||
+ | -- Delete logs | ||
+ | DELETE FROM sys_sync_log WHERE created < now() - INTERVAL '180 day'; | ||
+ | -- Delete actions | ||
+ | DELETE FROM sys_sync_action_log WHERE sync_log_id NOT IN (SELECT id FROM sys_sync_log); | ||
+ | -- Delete items | ||
+ | DELETE FROM sys_sync_item_log WHERE sync_action_log_id NOT IN (SELECT id FROM sys_sync_action_log); | ||
+ | </ | ||
+ | |||
+ | ==== DeleteWorkflowHistoricInstanceTaskExecutor==== | ||
+ | |||
+ | @since 9.7.12 | ||
+ | |||
+ | Delete historic workflow process instances. | ||
+ | |||
+ | === Parameters === | ||
+ | * ``Number of days`` - Delete historic workflow processes older than given number of days. | ||
+ | * ``Workflow definition`` - Delete historic workflow processes with this definition only. | ||
+ | |||
+ | ==== VsSystemGeneratorTaskExecutor ==== | ||
+ | |||
+ | @since 10.4.0 | ||
+ | |||
+ | Task generates given number of virtual systems, roles and identities. All generated entities are evenly distributed among themselves. I.e. Roles assigned to users and connected to generated systems. Task serves for generating required scenario and following performance test. | ||
+ | |||
+ | === Parameters === | ||
+ | * ``Item prefix`` - A name prefix of all generated entities. Serves for easier searching of entities in IdM. | ||
+ | * ``System count`` - Number of generated virtual systems. | ||
+ | * ``Role count`` - Number of generated roles. | ||
+ | * ``User count`` - Number of generated identities. | ||
===== Testing tips ===== | ===== Testing tips ===== | ||
Line 240: | Line 340: | ||
* Support for the check of the competition of the running tasks. Now it is on the task implementation to check if it should be run or not. This could be extracted to the general. | * Support for the check of the competition of the running tasks. Now it is on the task implementation to check if it should be run or not. This could be extracted to the general. | ||
- | | + | * Display of the scheduled triggers in the detail of the scheduled job. |
- | | + | * Recover canceled task by server is restarted automatically. |