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
tutorial:adm:notification_-_identity_s_last_contract_is_ending [2021/04/28 11:08]
cabelkal [Set up the Long running task (LRT) to notify owner of the contract]
tutorial:adm:notification_-_identity_s_last_contract_is_ending [2021/11/22 12:38] (current)
kucerar changed params names
Line 1: Line 1:
 ====== Notification - the end of identity's last contract ====== ====== Notification - the end of identity's last contract ======
  
-<note tip>This notification is a part of the [[devel:documentation:modules_extras|Extras module]].</note>+<note tip>This notification is a part of the [[:devel:documentation:modules_extras|Extras module]].</note>
  
 The LRT LastContractEndNotificationTask sends an email notification to holders of a specified role and optionally the manager of a contract that a user's last contract is ending, i. e., the user is leaving. The recipients of the notification can be modified in the LRT setup and the notification template can be modified as well. The LRT LastContractEndNotificationTask sends an email notification to holders of a specified role and optionally the manager of a contract that a user's last contract is ending, i. e., the user is leaving. The recipients of the notification can be modified in the LRT setup and the notification template can be modified as well.
  
 There are two different notifications this LRT can send: There are two different notifications this LRT can send:
 +
   - notification sent a specified number of days before the end of identity's last contract   - notification sent a specified number of days before the end of identity's last contract
   - notification sent the day that identity's last contract ends   - notification sent the day that identity's last contract ends
 +
 Each notification can use a different notification template (and must use a different topic). Each notification can use a different notification template (and must use a different topic).
  
Line 16: Line 18:
 The visual part of the notification can be configured since standard templates are used. Extras comes with two basic stub templates which can be used here. The visual part of the notification can be configured since standard templates are used. Extras comes with two basic stub templates which can be used here.
  
-To set it up, go the left panel, choose Notifications>Templates. Look for templates 'ContractEndInFuture' and 'ContractEndNow'. If you see them, you can edit them by clicking the magnifying glass if you want (see below). +To set it up, go the left panel, choose Notifications>Templates. Look for templates 'ContractEndInFuture' and 'ContractEndNow'. If you see them, you can edit them by clicking the magnifying glass if you want (see below).
  
-{{ :tutorial:adm:01_real_notification_search.png?direct&1200 |}}+{{  .:01_real_notification_search.png?direct&1200  }}
  
 If you don't see them, you will have to create them from the xml files with corresponding names. They can easily be found [[https://github.com/bcvsolutions/czechidm-extras/tree/develop/Realization/backend/idm-extras/src/main/resources/eu/bcvsolutions/idm/templates|here]]. If you don't see them, you will have to create them from the xml files with corresponding names. They can easily be found [[https://github.com/bcvsolutions/czechidm-extras/tree/develop/Realization/backend/idm-extras/src/main/resources/eu/bcvsolutions/idm/templates|here]].
  
-{{ :tutorial:adm:02_contract_end_in_future_template.png?direct&1200 |}}+{{  .:02_contract_end_in_future_template.png?direct&1200  }}
  
-{{ :tutorial:adm:03_contract_end_now_template.png?direct&1200 |}}+{{  .:03_contract_end_now_template.png?direct&1200  }}
  
 You can create your own template by modifying the stubs. You have these objects available: You can create your own template by modifying the stubs. You have these objects available:
 +
   * user's full name (first name, last name, login, e. g., "Petra Šťastná, pstasna", String only)   * user's full name (first name, last name, login, e. g., "Petra Šťastná, pstasna", String only)
   * user's department from tree node (String only)   * user's department from tree node (String only)
Line 32: Line 35:
   * user's manager (full IdmIdentityDto)   * user's manager (full IdmIdentityDto)
   * user (full IdmIdentityDto), since Extras 1.7.0   * user (full IdmIdentityDto), since Extras 1.7.0
 +
 +since version 3.2.3
 +
 +  * userIdentity - full IdmIdentityDto
 +  * user - full name as String
 +  * department - department from tree node as String
 +  * ppvEnd - date of contract end as String
 +  * manager - full IdmIdentityDto of user's manager
 +  * identityUrl - URL to user's dashboard
 +  * identityEav - user's EAV as list of IdmFormInstanceDto
 +  * identityEavMap - user's EAV as Map of name of EAV and it's value as String
 +  * identityContract - user's contract as IdmIdentitycontractDto
 +  * rolesAllNames - list of all user's roles as names, sorted alphabeticaly
 +  * rolesAllDto - list of all user's roles as IdmRoleDto
 +  * rolesDirectNames - list of directly assigned user's roles as names
 +  * rolesAutoNames - list of automaticly assigned user's roles as names
  
 ===== Configure topics ===== ===== Configure topics =====
  
-Next, we have to define the topics for the notification. In the left panel, click Notifications>Configuration and search topics extras:contractEnd and extras:contractEndInXDays. +Next, we have to define the topics for the notification. In the left panel, click Notifications>Configuration and search topics extras:contractEnd and extras:contractEndInXDays.
  
-{{ :tutorial:adm:01_notification_search.png?direct&1200 |}}+{{  .:01_notification_search.png?direct&1200  }}
  
 If you don't find them, click the green button Add and fill them out as shown below: If you don't find them, click the green button Add and fill them out as shown below:
  
-{{ :tutorial:adm:04_create_topic_end_in_future.png?direct&600 |}} +{{  .:04_create_topic_end_in_future.png?direct&600  }}{{  .:05_create_topic_end_now.png?direct&600  }}
-{{ :tutorial:adm:05_create_topic_end_now.png?direct&600 |}}+
  
 You can specify additional recipients of the notification in the topic description. You can specify additional recipients of the notification in the topic description.
Line 50: Line 68:
 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. 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:06_define_lrt.png?direct&600 |}}+{{  .:06_define_lrt.png?direct&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.+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> <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>
Line 58: Line 76:
 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 define multiple LRTs. 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 define multiple LRTs.
  
-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!  +Since 3.2.0, you can also select whether the notification should be sent if the user is manually disabled. By default, this is set to true. 
 + 
 +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 ===== ===== Set up the Long running task (LRT) with technical identities =====
Line 66: Line 86:
 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. 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:lastcpont1.png?600 |}}+{{  .:lastcpont1.png?600  }}
  
 You can specify how many days before the contract's end the notification should be sent. You can specify how many days before the contract's end the notification should be sent.
Line 72: Line 92:
 <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> <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 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!
-* 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:** **There is also support for technical identities. There are two options:**
  
-* If you 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.  +* If you 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. * If you select a role in "Code of the role used for technical identities" then it will look if identity with ending contract has some subordinates with this role.
-* If you select a role in "Code of the role used for technical identities" then it will look if identity with ending contract has some subordinates with this role.+
  
 <note important>Do not use a combination of these two. Create a new task if both needed!</note> <note important>Do not use a combination of these two. Create a new task if both needed!</note>
Line 86: Line 104:
 ===== Set up the Long running task (LRT) to notify owner of the contract ===== ===== Set up the Long running task (LRT) to notify owner of the contract =====
  
-<note important>Notification for owner is supported since 2.8.0 of the extras module.</note> +<note important>Notification for owner is supported since 2.8.0 of the extras module.</note> For notification of owner of the contract 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.
-For notification of owner of the contract 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.+
  
 IE. you can use this setup for sending extra notification directly to identity via sms (selected in notification topic). IE. you can use this setup for sending extra notification directly to identity via sms (selected in notification topic).
  
-{{ :tutorial:adm:lrt_end_contract_owner.png?600 |}} +{{  .:lrt_end_contract_owner.png?600  }}
  
 You check "Should the owner of the contract receive the notification?" and you can fill name of the topic for notification. If you dont select any topic default will be selected. You check "Should the owner of the contract receive the notification?" and you can fill name of the topic for notification. If you dont select any topic default will be selected.
Line 98: Line 114:
 Notification is set in the left panel, click Notifications>Configuration and search topics extras:contractEnd and extras:contractEndInXDays. Notification is set in the left panel, click Notifications>Configuration and search topics extras:contractEnd and extras:contractEndInXDays.
  
-{{ :tutorial:adm:lrt_notification_topic_extras.png?600 |}}+{{  .:lrt_notification_topic_extras.png?600  }}
  
 Notification is set for sending via SMS channel. Notification is set for sending via SMS channel.
 +
 +===== LRT setting from version 3.2.3 =====
 +
 +From version 3.2.3 there are additional options for this LRT.
 +
 +  * User type - You can select user type (projection). Only users of selected type will be processed. Leave it empty to process all users
 +  * Account on system - If you want process only users with account on some system you can select one. Leave empty to process all users
 +  * Tree node - Process users only in selected node (no recursion!)
 +
 +{{  .:lastcontract.png?nolink&947x779  }}
  
 ===== Run the long running task (LRT) ===== ===== Run the long running task (LRT) =====
Line 108: Line 134:
 <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>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 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. Since 3.2.0, however, if the contract is extended, it will be removed from the processed queue. Once the end of its validity approaches again, the notification will be sent. This isn't the case in earlier versions.)</note> 
-This is true even if the contract's validity changes (eg., if the contract is extended after the notification is sent, it will not be sent again.)</note>+ 
  • by cabelkal