Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/16/2024 07:49 AM
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
05/16/2024 08:06 AM
05/16/2024 11:12 AM - edited 05/16/2024 11:13 AM
Hi @Saathvik , Workflow screenshot below(Created a test workflow approval might be different from what mentioned above)
Error in log
Please advice
05/16/2024 11:54 AM
@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
05/16/2024 11:34 AM
@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.
05/16/2024 11:58 AM
@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
05/16/2024 08:36 PM
Hi @Saathvik , Thanks for the response,
Tried got the same error in groovy language it automatically converts the sign to >
05/16/2024 08:43 PM
Export workflow change condition and reimport workflow
05/17/2024 08:19 AM
@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.
05/16/2024 08:48 PM
@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?
05/16/2024 08:49 PM