and more in a single search tool across platforms. Read the announcement here. |
04/04/2024 01:48 AM - edited 04/04/2024 01:49 AM
Hello folks, hope anyone can help with the below requirement.
Context : Email in Access Approval Workflow
Requirement : Display all requested roles to Role Owners to ease their approval decision
Use Case : We have configured an approval workflow with 2 steps :
If multiple roles are being requested with different role owners, Role owners will get the roles they need to approve inside the rolesshtmltablerows variables.
We identified another binding variable named rolemap which includes all requested roles in the following format : [307:S4HANA_Accountant Project Manager - BEST Madrid - Multi Div - PRODUCTION, 284:S4HANA_Trade Marketing Manager/Director - Iberia Hub - Multi Div - PRODUCTION]
The pattern is [<rolekey1>:<role_name1>,<rolekey2>:<role_name2>,...]
Does anyone know if from this list we can retrieve the actual role objects to display :
I have tried the below but it sends be "null" value :
${for(int i=0; i>rolemap.size();i++){rolemap[i] + ', '}}
Thanks for your help
Solved! Go to Solution.
04/04/2024 10:08 PM
04/05/2024 01:46 AM
Hi @rushikeshvartak ,
04/09/2024 07:57 PM
Please share
To get what variables are present to use in the email template, check using the below expression. By putting it in the email body, it will print all variable names with values, and then accordingly, you can use it:
${this.binding.variables.each {k,v -> println "$k = $v" + "" + "br" + ">"}}
04/11/2024 10:22 AM
That's exactly what I used to retrieve the below variable and value :
rolemap : [307:S4HANA_Accountant Project Manager - BEST Madrid - Multi Div - PRODUCTION, 284:S4HANA_Trade Marketing Manager/Director - Iberia Hub - Multi Div - PRODUCTION]
My question is more to understand if anyone knows how, from this map, how to get the associated role display names and applications for each role in the map.
I did try the below but it returned null :
${for(int i=0; i>rolemap.size();i++){rolemap[i] + ', '}}
So i'm asking for some sample script that would actually work.
04/11/2024 07:57 PM
rolemap.each { roleId, roleName -> def roleNameParts = roleName.split('_') def application = roleNameParts[0] def displayName = roleNameParts[1..-1].join('_') println "Role ID: $roleId, Display Name: $displayName, Application: $application" }
04/17/2024 02:37 AM
Hi @rushikeshvartak,
Thanks for the sample code given.
My use case would be to catch the role's information for each role in the map.
Is there a method to get the role's data from the roleId or roleName (e.g risk, customproperties, attached endpoint, etc.) ?
04/17/2024 03:02 AM
Hi @rushikeshvartak,
After some testing we were able to achieve the requirement using the below :
${rolemap.each{roleId, roleName -> println 'RoleId : ' + roleId + ' - ' + roleName + ' - DisplayName : '+ com.saviynt.ecm.identitywarehouse.domain.Roles.findById(roleId).displayname + ' - Description : '+ com.saviynt.ecm.identitywarehouse.domain.Roles.findById(roleId).description + ' - Endpoint : '+ com.saviynt.ecm.identitywarehouse.domain.Endpoints.findById(com.saviynt.ecm.identitywarehouse.domain.Roles.findById(roleId).endpointkey).displayName + ', '}}