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

Compare Start time in workflow if else condition

Abhay_Yadav
New Contributor II
New Contributor II

Hi Team,

We have a requirement to reject any FFID request that has a Start time after 6:00 PM.

We tried controlling this using workflow in "if else" condition but it is not working.

 We tried directly from Groovy :

com.saviynt.ecm.workflow.Request_Access.get(new Long(requestaccesskey)).startdate.format("HH:mm:ss") >'10:00:00'

For this i'm  getting below error :

2023-12-11T16:51:39+05:30-ecm----Caused by: javax.script.ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
 
2023-12-11T16:51:39+05:30-ecm----Script12.groovy: 1: Expression list of the form (a; b; c) is not supported in this context. at line: 1 column: 1. File: Script12.groovy @ line 1, column 1.
 
2023-12-11T16:51:39+05:30-ecm----(com.saviynt.ecm.workflow.Request_Access.get(new Long(requestaccesskey)).startdate.format("HH:mm:ss") >'10:00:00') == true
 
Can you please help in achieving this use case.
Only send those request for approval which are raised before 6:00 PM. We do not want to compare the date component only the time component.
 
Regards,
Abhay Yadav
4 REPLIES 4

DixshantValecha
Saviynt Employee
Saviynt Employee

Hi @Abhay_Yadav,

We are checking on your request and we will keep you posted.

DixshantValecha
Saviynt Employee
Saviynt Employee

Hi @Abhay_Yadav,

I have send you a message for some clarity,so kindly respond on the same. 

sk
All-Star
All-Star

@Abhay_Yadav : Did you select groovy as expression language in if-else block? If not please use groovy as expression language and try below logic

com.saviynt.ecm.workflow.Request_Access.get(new Long(requestaccesskey)).startdate.format("HH").toInteger()>17

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

rushikeshvartak
All-Star
All-Star

 

com.saviynt.ecm.workflow.Request_Access.get(new Long(requestaccesskey)).startdate.format("HH").toInteger()>17

rushikeshvartak_0-1703268301976.png

 


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