Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Multi level workflow on User onboarding and Update user request

Venu_Kumar
New Contributor II
New Contributor II

Requirement is to setup Multi level workflow ( 1st Level is Sponsor Manager approval, 2nd Level is Business team approval) in New User onboarding/ update user request

 

Built workflow with two level approvals, where 1st level is to assign it to sponsor manager for the user onboarding, Built a custom query component where workflow should be assigned to Sponsor manager filled in form by using below queries:

 

  1. select u.userkey from users u, ars_requests ar, request_access ra, request_access_attrs raa

where ar.requestkey=ra.requestkey and ra.REQUEST_ACCESSKEY =raa.REQUEST_ACCESS_KEY and raa.ATTRIBUTE_NAME  like 'owner' and raa.ATTRIBUTE_VALUE=u.username

  and ar.requestkey = (select ar1.requestkey from ars_requests ar1 where ar1.JBPMPROCESSINSTANCEID = concat('Venu_GID_2Level_WF2.',${ARSREQUEST.id}))

 

  1. select u.userkey from users u, ars_requests ar, request_access ra, request_access_attrs raa

where ar.requestkey=ra.requestkey and ra.REQUEST_ACCESSKEY =raa.REQUEST_ACCESS_KEY and raa.ATTRIBUTE_NAME  like 'owner' and raa.ATTRIBUTE_VALUE=u.username

  and ar.requestkey = ${ARSREQUEST.id} and  ar.REQUESTTYPE=18

 

3.select userkey from users where username == ${dynamicAttributes.SIESponsorManagerGID}

 

4.select userkey from users where username = ${SIE_Sponsor.SIESponsorManagerGID}

 

  1. select username as id from users where username = (select Left(Right(${dynamicAttributes.SIE_Sponsor},11),10)

 

6.select userkey from users where username in (select distinct raa.attribute_value from request_access_attrs raa , ars_requests ar, request_access ra WHERE ar.REQUESTKEY = ra.REQUESTKEY and ra.REQUEST_ACCESSKEY = raa.REQUEST_ACCESS_KEY and ar.requestkey=${ARSREQUEST.id} and raa.ATTRIBUTE_NAME="owner")

 

None of the above custom query is not assigning 1st level workflow to SIE_Sponsor Manager instead it is assigned to admin, anyone with/without admin role can approve request from Review Pending requests

document followed: https://docs.saviyntcloud.com/bundle/EIC-Admin-v24x/page/Content/Chapter12-Workflows/Workflow-Compon...

6 REPLIES 6

PremMahadikar
Valued Contributor
Valued Contributor

Hi @Venu_Kumar ,

The below is working for me: (quotes were missing)

Query: 

 

select userkey from users where username='${dynamicAttributes.SIESponsorManagerGID}'

 

PremMahadikar_0-1713018962823.png

And I have used the below query in the DA form:

 

select username as id from users where statuskey=1

 

PremMahadikar_1-1713019192297.png

 

If you find the above response useful, Kindly Mark it as Accept As Solution and hit Kudos

PremMahadikar
Valued Contributor
Valued Contributor

@Venu_Kumar , please ignore my above solution. It's for Access request approach.

For create/update user request, using dynamic attributes is of different approach.

Please find the below working solution which you can refer to achieve your use case:

PremMahadikar_0-1713086651554.png

Working customquery:

SELECT userkey FROM users WHERE username IN (SELECT DISTINCT raa.attribute_value AS userkey FROM request_access_attrs raa, ars_requests ar, request_access ra WHERE ar.requestkey = ra.requestkey AND ra.request_accesskey = raa.request_access_key AND ar.requestkey=${ARSREQUEST.id} and raa.ATTRIBUTE_NAME='customproperty6')

I have simple dynamic attribute(DA) configured: 

Attribute NameSIESponsorManagerGID
Attribute LabelSponsormanager
Attribute TypeSingle Select From SQL Query
Valuesselect username as ID from users
User Columncustomproperty6

Note: Based on DA user column, I have configured my custom query to return username in the subquery

If you find the above response useful, Kindly Mark it as Accept As Solution and hit Kudos

Venu_Kumar
New Contributor II
New Contributor II

Hi Prem,

Thanks for responding, its same with 6th Query that I used except the alias name.

Its still same with this query anyone with/without admin access are able to approve the request, we would need explicitly only Sponsor Manager/admin should be allowed to approve the request

@Venu_Kumar ,

The outcome of the query is assigned to Sponsormanager right? When I tested using above query, whoever I selected as sponsor manager, the approval is sent to that user. Till here am I with you? 

Or you are seeing 'admin' in the request history? 

 

Venu_Kumar
New Contributor II
New Contributor II

Hi @PremMahadikar 

Yes, using the Alias name in the query worked out, it is showing as assigned to Sponsor Manager, But anyone with/without admin role (excluding Read role) can approve request from Review Pending requests

@Venu_Kumar ,

Thats good that the request is assigned to Sponsor Manager.

About the second issue, this should be handled in SAV role permissions. 

Admin can approve the request because the role has full permissions. When you say 'anyone' other than admin, the user you have logged in as, check the SAV role permission for 'For Whom Can the Role User Approve the Request*'

PremMahadikar_0-1713193010584.png