Leveraging Intelligent Recommendations for Operational Transformation. AMS Partners click HERE | EMEA/APJ Partners click HERE |
10/06/2023
08:30 AM
- last edited on
10/09/2023
12:46 AM
by
Sunil
There is a requirement where i need to compare current date with a dynamic attribute from user form.
There is a user form having dynamic attribute named 'EndDate' and its value is stored in accounts customproperty55. I need to make a comparison between these 2 values in a workflow. I have tried with below queries but it is not working:
{((dynamicAttributes.get('customproperty55') < FORMAT(CURDATE(), 'MM-dd-yyyy'))}
Please help me on this on priority.
[Updated on 10/9/2023]
I am using below query in IF ELSE CONDITION block:
(STR_TO_DATE(dynamicAttributes.get('customproperty55'), '%b %d, %Y') < CURDATE())
but i am getting below error in logs:
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288376905Z stdout F 2023-10-09 07:05:41,287 [http-nio-8080-exec-9] ERROR services.WorkflowService - Exception in workflow service"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288394005Z stdout F org.jbpm.api.JbpmException: script evaluation error: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.STR_TO_DATE() is applicable for argument types: (null, java.lang.String) values: [null, %b %d, %Y]"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288403105Z stdout F at org.jbpm.pvm.internal.script.ScriptManager.evaluate(ScriptManager.java:127)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288408305Z stdout F at org.jbpm.pvm.internal.script.ScriptManager.evaluate(ScriptManager.java:115)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288421006Z stdout F at org.jbpm.pvm.internal.script.ScriptManager.evaluateExpression(ScriptManager.java:87)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288425506Z stdout F at org.jbpm.pvm.internal.el.ScriptExpression.evaluateInScope(ScriptExpression.java:48)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288428406Z stdout F at org.jbpm.pvm.internal.el.Expression.evaluate(Expression.java:108)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288432006Z stdout F at org.jbpm.pvm.internal.model.ExpressionCondition.evaluate(ExpressionCondition.java:41)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288436306Z stdout F at org.jbpm.jpdl.internal.activity.DecisionConditionActivity.findTransitionUsingConditions(DecisionConditionActivity.java:62)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288441106Z stdout F at org.jbpm.jpdl.internal.activity.DecisionConditionActivity.execute(DecisionConditionActivity.java:47)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288443906Z stdout F at org.jbpm.jpdl.internal.activity.DecisionConditionActivity.execute(DecisionConditionActivity.java:43)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288446806Z stdout F at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288449706Z stdout F at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:672)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288452906Z stdout F at org.jbpm.pvm.internal.model.ExecutionImpl.fire(ExecutionImpl.java:582)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288455906Z stdout F at org.jbpm.pvm.internal.model.ExecutionImpl.take(ExecutionImpl.java:487)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288459006Z stdout F at org.jbpm.jpdl.internal.activity.ForEachActivity.execute(ForEachActivity.java:123)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288461806Z stdout F at org.jbpm.jpdl.internal.activity.ForEachActivity.execute(ForEachActivity.java:53)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288465306Z stdout F at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288468206Z stdout F at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:672)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288471106Z stdout F at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:632)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288474006Z stdout F at org.jbpm.pvm.internal.model.ExecutionImpl.start(ExecutionImpl.java:217)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288477106Z stdout F at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:63)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288489406Z stdout F at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:36)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288492706Z stdout F at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288495706Z stdout F at org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288498906Z stdout F at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:49)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288501706Z stdout F at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288504507Z stdout F at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288507507Z stdout F at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288510507Z stdout F at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:71)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288513307Z stdout F at com.saviynt.ecm.services.WorkflowService.workflowaccessreqStart(WorkflowService.groovy:1059)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288516007Z stdout F at com.saviynt.ecm.services.WorkflowService$_createRequestFinalStep_closure289.doCall(WorkflowService.groovy:25060)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288518707Z stdout F at com.saviynt.ecm.services.WorkflowService.createRequestFinalStep(WorkflowService.groovy:21898)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288521907Z stdout F at com.saviynt.ecm.workflow.WorkflowmanagementController$_closure165.doCall(WorkflowmanagementController.groovy:10653)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288524707Z stdout F at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288530507Z stdout F at com.saviynt.webservice.SaviyntRestAuthenticationFilter.doFilter(SaviyntRestAuthenticationFilter.groovy:135)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288533607Z stdout F at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:62)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288536407Z stdout F at grails.plugin.springsecurity.web.SecurityRequestHolderFilter.doFilter(SecurityRequestHolderFilter.java:59)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288539207Z stdout F at com.mrhaki.grails.plugin.xframeoptions.web.XFrameOptionsFilter.doFilterInternal(XFrameOptionsFilter.java:69)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288542307Z stdout F at com.brandseye.cors.CorsFilter.doFilter(CorsFilter.java:82)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288560207Z stdout F at java.lang.Thread.run(Thread.java:750)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288564107Z stdout F Caused by: javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.STR_TO_DATE() is applicable for argument types: (null, java.lang.String) values: [null, %b %d, %Y]"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288569007Z stdout F at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:152)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288571907Z stdout F at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288574807Z stdout F at org.jbpm.pvm.internal.script.ScriptManager.evaluate(ScriptManager.java:123)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288577707Z stdout F ... 38 more"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288580707Z stdout F Caused by: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.STR_TO_DATE() is applicable for argument types: (null, java.lang.String) values: [null, %b %d, %Y]"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288583607Z stdout F at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:349)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288586807Z stdout F at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:146)"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288589607Z stdout F ... 40 more"
"ecm","2023-10-09T07:05:42.054+00:00","2023-10-09T07:05:41.288592408Z stdout F Caused by: groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.STR_TO_DATE() is applicable for argument types: (null, java.lang.String) values: [null, %b %d, %Y]"
[This message has been edited by moderator to merge reply comment]
10/11/2023 04:47 PM
Hi @manish97sh ,
Greetings.
Can you please try to use date() in both dynamic attribute as well as current date rather than using format(). From your explanation i presume you just want to find the difference between date but hh:mm:ss is not something you're looking for.
Thanks,
10/12/2023 02:41 AM
Hi @pruthvi_t ,
(STR_TO_DATE(dynamicAttributes.get('customproperty55'), '%b %d, %Y') < CURDATE())
In this query, CP55 is storing date as string so we need to change the format to make comparison. But it is giving error as .MissingMethodException so it seems STR_TO_DATE is not supported.
Please suggest on this.
Regards,
Manish