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

Error where using entitlement.i din groovy script

Antoine
Regular Contributor
Regular Contributor

Hello, 

I am trying to add a test for checking if an entitlement owner exists.

That is not the owner of the entitlement selected in the ARS but the owner of  a specific entitlement which is the combinaison of a site (dynamic attribute) and a profile

I add this test and it works fine 

(com.saviynt.ecm.identitywarehouse.domain.Entitlement_values.executeQuery("select  ev.customproperty1 as cp1 from  Entitlement_values ev  where  entitlement_value.id='xxx'")?.size() != 0) 

When I changed the hard value xxx in ${entitlement.id}

I am facing the issue 

by: javax.script.ScriptException: java.lang.NullPointerException: Cannot get property 'id' on null object at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:349) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:146) ... 40 moreCaused by: java.lang.NullPointerException: Cannot get property 'id' on null object at Script42.run(Script42.groovy:1) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:346)

 

(com.saviynt.ecm.identitywarehouse.domain.Entitlement_values.executeQuery("select ev.customproperty1 as cp1 from Entitlement_values ev where entitlement_value.id='${entitlement.id}'")?.size() != 0)

I tried also with the variable REQUESTACCESSOBJ

(com.saviynt.ecm.identitywarehouse.domain.Entitlement_values.executeQuery("select ev.customproperty1 as cp1 from Entitlement_values ev where entitlement_value.id='${REQUESTACCESSOBJ.id}'")?.size() != 0)

Same issue

What is wrong with my query ?

Thanks

 

 

5 REPLIES 5

rushikeshvartak
All-Star
All-Star

Use ARSREQUEST object 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Antoine
Regular Contributor
Regular Contributor

Thanks

I can use ARSREQUEST but I need the to get the entitlement id of the entitlement that has been selected in the Access request

My goal is to retreive an owner rank1 for a specific entitlement name

In the request access, the user select a site "S1" for example (site is dynamic attribut) and an entitlement "Operator"

I would like to select the owner rank for an specific entitlement for which the entitlement_value is th e concatenation of site and entitlement for example "S1_Operator" 

For that purpose, I have to write a groovy script because this entitlement is not included in the ARS

Which variable can be interpret in the script to get the entitlement id or value selected.

is there a simple way to do that ?

Thanks 

Antoine 

 

Antoine
Regular Contributor
Regular Contributor

Hello,

I found the solution

The error occured in  the workflow for the create account task . In that case , the variable ${entitlement} is null.

I added a test in the step just before ${entitlement} != null

It solved my issue

Thanks

Please share small snippets of wf


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

You can find in the attached file an extract of the WF