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:notification_-_identity_s_last_contract_is_ending [2019/10/30 13:44]
cirkval [Run the LRT]
tutorial:adm:notification_-_identity_s_last_contract_is_ending [2020/04/23 08:27]
klementm [Set up the Long running task (LRT)]
Line 31: Line 31:
   * the date of the end of the user's contract (String only)   * the date of the end of the user's contract (String only)
   * user's manager (full IdmIdentityDto)   * user's manager (full IdmIdentityDto)
 +  * user (full IdmIdentityDto), since Extras 1.7.0
  
 ===== Configure topics ===== ===== Configure topics =====
Line 59: Line 60:
 And finally, you can check the box and select whether the user's manager is to be notified as well. Only one manager will receive the notification!   And finally, you can check the box and select whether the user's manager is to be notified as well. Only one manager will receive the notification!  
  
 +===== Set up the Long running task (LRT) with technical identities =====
 +
 +<note important>Technical identities are supported in this task since version 1.9.0 of the extras module.</note>
 +
 +Finally, we can set up the LRT. In the left menu, go to Settings>Task scheduler>Scheduled tasks and click the green button Add. Select the task type LastContractEndNotificationTask and specify the configuration of the LRT.
 +
 +{{ :tutorial:adm:task-.png?600 |}}
 +
 +You can specify how many days before the contract's end the notification should be sent. If you set it to 0 the notification will be sent the day the contract ends and the extras:contractEnd topic will be used. If you write a positive integer x (1, 2, ...) the notification will be sent x days before the contract ends and the extras:contractEndInXDays topic will be used.
 +
 +<note tip>The notification is sent x days before the end of the contract or sooner. This is useful if for some reason the LRT did not run one day, it will simply be sent the next day.</note>
 +
 +You can select the role that the recipients of the notification will have assigned. You can only select one so if you need multiple ones, you have defined multiple LRTs.
 +
 +You can also check the box and select whether the user's manager is to be notified as well. Only one manager will receive the notification!
 +
 +There is also support for technical identities. There are two options:
 +
 +1) If you tick "Identity is owner of admin account with this prefix" and provide prefix, then the task will look for username with this prefix (for identity whose contract is going to end). If some are found, then it sends the notification. 
 +
 +2) If you just set prefix with **not ticking** "Identity is owner of admin account with this prefix" then it will look for subordinates with this prefix of ending users. If some are found, then manager for ending identity is notified (or also some role holders according to other settings).
 +
 +The last option (Send invalid contracts) is if you want to send only valid users or all. The reason for putting this option to this setting is this case: Task did not run couple of days and some users are already not valid. So it admin can decide if those identities will be sent too.
 ===== Run the long running task (LRT) ===== ===== Run the long running task (LRT) =====
  
 The last thing remaining is to run the LRT using the green arrow button. You can user CRON to plan when the LRT should be run. The last thing remaining is to run the LRT using the green arrow button. You can user CRON to plan when the LRT should be run.
  
-<note important>I highly recommend you turn off sending emails before the first run which will send notification about the end of all contracts in x days.</note>+<note important>I highly recommend you turn off sending emails before the first run which will send notification about the end of all contracts in x days. Alternatively, for the first time you run the LRT, send the notification without recipients.</note>
  
-<note important>Each entity will only be processed once by the LRT. If the notification about the end of a contract was sent before, the same LRT will not send it again.</note>+<note important>Each entity will only be processed once by the LRT. If the notification about the end of a contract was sent before, the same LRT will not send it again.  
 +This is true even if the contract's validity changes (e. g., if the contract is extended after the notification is sent, it will not be sent again.)</note>
  • by kucerar