Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Check the Number of active assignee

vvaibhav
New Contributor II
New Contributor II

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

11 REPLIES 11

NM
Honored Contributor II
Honored Contributor II

@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 ..

vvaibhav
New Contributor II
New Contributor II

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

Can you share your workflow wiring screenshot and logs


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

vvaibhav
New Contributor II
New Contributor II

Hi @rushikeshvartak @NM ,

Thank you so much!!

It worked finally. 

Regards,

Vikash

NM
Honored Contributor II
Honored Contributor II

Hi @vvaibhav share the solution to help other in community.

vvaibhav
New Contributor II
New Contributor II

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

NM
Honored Contributor II
Honored Contributor II

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 !

vvaibhav
New Contributor II
New Contributor II

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

NM
Honored Contributor II
Honored Contributor II

@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 !

vvaibhav
New Contributor II
New Contributor II

Hi @NM ,

I am not sure why, but when i am joining and using "users" table attribute which are not present in table "Usergroup_users" (for eg. - statuskey) inside "com.saviynt.ecm.identitywarehouse.domain.Usergroup_users()", It is throwing an error and does not let me submit the request. so i thought to use only "Usergroup_users" table and then it worked.

Regards,

Vikash

Use below query

(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.id AND u.statuskey=1")?.size() != 0)


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.