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

To direct workflow on the basis of entitlement date difference

NM
Honored Contributor II
Honored Contributor II

Hi Team,

we have a use case in which if difference between entitlement start date and enddate is greater than 3 months it should flow to xyz person for approval otherwise to Usergroup, please let me know how can i compare the dates and accomplish this.

Tried (Didn't work)

If else block, Language groovy selected

Statement - (com.saviynt.ecm.workflow.Request_Access.get(new Long(requestaccesskey)).enddate.format('MM').toInteger()-com.saviynt.ecm.workflow.Request_Access.get(new Long(requestaccesskey)).startdate.format('MM').toInteger())>2

Thanks

10 REPLIES 10

Saathvik
All-Star
All-Star

@NM : Where did you place this block in WF? Can you share the WF screenshot please? Also if there is any issue please share the respective logs


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

NM
Honored Contributor II
Honored Contributor II

Hi @Saathvik , Workflow screenshot below(Created a test workflow approval might be different from what mentioned above)

NM_0-1715883117884.png

Error in log

NM_1-1715883152112.png

Please advice

@NM :  Try below logic

((com.saviynt.ecm.workflow.Request_Access.get(new Long(requestaccesskey)).enddate.format('M').toInteger())-(com.saviynt.ecm.workflow.Request_Access.get(new Long(requestaccesskey)).startdate.format('M').toInteger()))>2

 


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

NM
Honored Contributor II
Honored Contributor II

@Saathvik , instead of just comparing months we have to compare dates too so if request is submitted on 25 May and end date is 30th July it should fall under greater than 2 months.

@NM : Then try below

(com.saviynt.ecm.workflow.Request_Access.get(new Long(requestaccesskey)).enddate - com.saviynt.ecm.workflow.Request_Access.get(new Long(requestaccesskey)).startdate)>60

Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

NM
Honored Contributor II
Honored Contributor II

Hi @Saathvik , Thanks for the response,

Tried got the same error in groovy language it automatically converts the sign to >

NM_0-1715916940957.png

Export workflow change condition and reimport workflow


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

@NM : It looks like a bug automatically converting into html code in UI itself after saving. I would suggest to report to Saviynt support to confirm the same. Meanwhile you can try workaround Rushi suggested to see if that works. 


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

NM
Honored Contributor II
Honored Contributor II

@rushikeshvartak If i convert the Workflow into XML in UI will that work?

if not what do you mean export change condition should i export the workflow before changing the condition and add the new condition in XML and reupload?

  • Transport - Export - Workflow 
  • Unzip file 
  • Change WF condition in .wf file
  • zip file
  • Transport Import 

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