Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/28/2024 10:54 PM - edited 09/29/2024 04:33 AM
Hi team,
Can we check the number (count) of active assignee in the 'if else' block of workflow ? I have a condition in which if
1. user raise a request for approver and there is no other active approver present in the user group - approval should route to approver's manager
2. Approver request for self and no other active approver is present in user group - approval should route to approver's manager
Please help me out achieving this.
Regards,
Vikash
09/29/2024 04:11 AM - edited 09/29/2024 04:12 AM
@vvaibhav try this
(com.saviynt.ecm.identitywarehouse.domain.Usergroup_users.executeQuery("select count(*) from Usergroup_users ugu, Users u where ugu.user_groupkey = 'groupkey' AND ugu.userkey=u.usekey AND u.status=1")?.size() != 0)
And then else condition would be approval to manager ..
09/29/2024 05:22 AM
Hi @NM
Thank you for looking into it.
Unfortunately, It did not work. I am not able to submit the request itself. Could you please suggest if there is any other work around. Also, please take a look to my query once more as i have edited it and removed one of the condition.
Regards,
Vikash
09/29/2024 05:44 AM
Can you share your workflow wiring screenshot and logs
09/29/2024 06:09 AM
09/29/2024 06:33 AM
Hi @vvaibhav share the solution to help other in community.
09/29/2024 06:39 AM - edited 09/29/2024 06:41 AM
Hi @NM ,
I used the below condition which satisfied the conditions mentioned above :
(com.saviynt.ecm.identitywarehouse.domain.Usergroup_users.executeQuery("select ugu.id from Usergroup_users ugu where ugu.user_groupkey = 'groupkey' AND ugu.userkey != '${user?.id}'")?.size() != 0)
Regards,
Vikash
09/29/2024 06:50 AM - edited 09/29/2024 06:53 AM
Hi @vvaibhav good that it worked..and tha ks for sharing.
But as per your initial problem statment you mentioned to check if there is no active users in user group.
User.id will check for the person request is raised for.
And In my opinion if person is part of the user group request automatically flows to the other members.
If solution helped you out please hit kudos button and accept the solution
Thanks !
09/29/2024 06:54 AM
Hi @rushikeshvartak @NM ,
Just out of curiosity, asking this:
Can we join or combine two groovy expression in one 'if else' block? ( for eg. -
"com.saviynt.ecm.identitywarehouse.domain.Usergroup_users", "com.saviynt.ecm.identitywarehouse.domain.Users" )
Let's say, I also have to check one more condition for a member present in user group ( if status is active or inactive). Now, we'll have to use "com.saviynt.ecm.identitywarehouse.domain.Users" to check user's status as "usergroup_users" table do not have statuskey stored.
Please suggest.
Regards,
Vikash
09/29/2024 06:56 AM - edited 09/29/2024 06:56 AM
@vvaibhav check the above query i mentioned.. internally joined the table with users. Just add condition u.sttauskey=1
solution helped you out please hit kudos button and accept the solution
Thanks !