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

How to fetch Account Type in workflow

Isha
New Contributor III
New Contributor III

Hi,

We need to use a check at workflow level for 'Account Type'. Is it possible to check accountype for an account at workflow level by using IF/ELSE block.

If yes, how is it possible?

 

19 REPLIES 19

dgandhi
All-Star
All-Star

Did you try accounts.accounttype?

 

dgandhi_0-1727726677415.png

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

 

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

Isha
New Contributor III
New Contributor III

yes, didn't work

I tried:

accounts.get(requestaccesskey).accounttype

NM
Honored Contributor III
Honored Contributor III

AccountsMap.get(requestaccesskey).accounttype.


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

Isha
New Contributor III
New Contributor III

Hi NM,

AccountsMap.get(requestaccesskey).accounttype did not work, it's not letting me submit request from ARS page itself.

Raghu
All-Star
All-Star

@Ishaabove suggestion if not work , save it data in dynamic attribute and get in workflow.

https://forums.saviynt.com/t5/identity-governance/workflow-variable-for-account-name/m-p/39732


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

prtkrh007
Saviynt Employee
Saviynt Employee

task.accountKey.accounttype

could you try this

or 
dynamicAttributes.get('ACCOUNTTYPE').equals('Shared Account')


Isha
New Contributor III
New Contributor III

Hi  prtkrh007,

task.accountKey.accounttype didn't work. Still not able to submit the request from ars page.

We are trying not to use the dynamic attribute as it will require to add dynamic attributes to all the endpoints.

rushikeshvartak
All-Star
All-Star
((dynamicAttributes.get('ACCOUNTTYPE') ne null)
and
(dynamicAttributes.get('ACCOUNTTYPE') eq 'Service'))

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

prtkrh007
Saviynt Employee
Saviynt Employee

(com.saviynt.ecm.identitywarehouse.domain.Accounts.executeQuery("select a.id from accounts a where a.accounttype='NAME').size() == 0)

Please try this

Isha
New Contributor III
New Contributor III

Hi prtkrh007,

After using the above custom query, I'm not able to save the workflow. Attaching an image with the exception I'm getting while trying to save the workflow.

Isha_0-1728292054499.png

 

Shar workflow wiring screenshot


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

For Account name use this
com.saviynt.ecm.workflow.Request_Access.get(new Long(requestaccesskey)).request_access_attrss.find {"ACCOUNTNAME".equalsIgnoreCase(it.attributeName) }?.attributeValue

Isha
New Contributor III
New Contributor III

Hi Prateek!

When I'm using this I'm not able to submit the request itself. It says 'The server encountered an error and cannot complete your request.'

Attaching the workflow screen shot and ARS page error screen shot.

select language as groovy


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

Isha
New Contributor III
New Contributor III

Sharing the error found in log:

"2024-10-17T08:16:30.477+00:00","ecm","","null-2bg5h","","de.odysseus.el.tree.TreeBuilderException: Error parsing '#{(com.saviynt.ecm.workflow.Request_Access.get(new Long(requestaccesskey)).request_access_attrss.find {"ACCOUNTNAME".equalsIgnoreCase(it.attributeName) }?.attributeValue=='Test_user_00354') eq true }': syntax error at position 51, encountered 'Long', expected ')' at de.odysseus.el.tree.impl.Builder.build(Builder.java:104) at de.odysseus.el.tree.TreeStore.get(TreeStore.java:61) at de.odysseus.el.TreeMethodExpression.<init>(TreeMethodExpression.java:76) at de.odysseus.el.ExpressionFactoryImpl.createMethodExpression(ExpressionFactoryImpl.java:440) at de.odysseus.el.ExpressionFactoryImpl.createMethodExpression(ExpressionFactoryImpl.java:78) at org.jbpm.pvm.internal.el.Expression.create(Expression.java:88) at org.jbpm.pvm.internal.model.ExpressionCondition.evaluate(ExpressionCondition.java:41) at org.jbpm.jpdl.internal.activity.DecisionConditionActivity.findTransitionUsingConditions(DecisionConditionActivity.java:62) at org.jbpm.jpdl.internal.activity.DecisionConditionActivity.execute(DecisionConditionActivity.java:47) at org.jbpm.jpdl.internal.activity.DecisionConditionActivity.execute(DecisionConditionActivity.java:43) at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60) at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:672) at org.jbpm.pvm.internal.model.ExecutionImpl.fire(ExecutionImpl.java:582) at org.jbpm.pvm.internal.model.ExecutionImpl.take(ExecutionImpl.java:487) at org.jbpm.jpdl.internal.activity.ForEachActivity.execute(ForEachActivity.java:123) at org.jbpm.jpdl.internal.activity.ForEachActivity.execute(ForEachActivity.java:53) at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60) at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:672) at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:632) at org.jbpm.pvm.internal.model.ExecutionImpl.start(ExecutionImpl.java:217) at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:63) at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:36) at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42) at

 

prtkrh007
Saviynt Employee
Saviynt Employee

Could you please change the expression language as groovy and try

Isha
New Contributor III
New Contributor III

Hi Prateek!

Thanks this worked!

Can you share final workflow screenshot for future reference 


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