Structure - Set notification when new tree node is created
What is it doing?
Basically, when a new tree node in the organization structure is created it will send a new notification. Who will receive this notification? This notification is sent to each person with a role by your choice. You can set this role in the configuration.
How to start it?
1) First of all, we need to have some role, which will receive this notification. See this tutorial for creating a new role.
2) Now we can set this configuration property in Setting → Configuration → green button Add → add following code: idm.sec.extras.treeNodeRecipient=MyRoleName
3) We need to set configuration for notification template. Go to Notifications → Configuration → green button Add
- Topic = this has to be set to extras:newTreeNode
- Level = this has to be set to "SUCCESS"
- Channel = it can be email or just log in IDM
- Template = you can use extras:newTreeNode - this template is provided out of the box. Or you can use your own specific email template, which accepts the same set of variables (treeNodeName, treeNodeCode, uid, created).
4) We need to active the processor which will send the notification. Go to Settings → Modules → Processors, find extras: new-node-processor and click Activate
Additional filters
You may not want to be notified about every tree node created. You can set the following filters to limit the notifications sent.
Parent filter
You can set a filter that will only send the notification if the tree node is a child of one of the specified tree nodes.
Set this property: idm.sec.extras.parentTreeNodeCodessForNotification with the codes of tree nodes for whose children you want to send the notification. Multiple tree nodes can be used, separate them by semicolon ';'.
Tree type filter
You can set a filter that will only send the notification if the tree node belongs to a specific tree type.
Set this property: idm.sec.extras.treeStructureTypeCodesForNotification with the codes of tree type for which you want to send the notification. Multiple tree types can be used, separate them by semicolon ';'.
Objects in notification
The following objects are available if you wish to create your own notification template:
- treeNodeName - name of the tree node
- treeNodeCode - code of the tree node
- parentsPath - the entire path to the tree node (parent / sub / tree node)
- treeNodeDto - the entire IdmTreeNodeDto
- url - URL to the tree node
- created - time of creation
- uid - ID of the tree node