When executing the flowable example given in the doc chapter 14 :
Script groovy :
org.joda.time.Days days = org.joda.time.Days.dayBetween(startdate, enddate);
execution.setVariable(“timeDuration”, days.getDays());
… i get this java exception in the tomcat log :
org.flowable.engine.common.api.FlowableException: Unknown property used in expression: ${timeDuration}
at org.flowable.engine.impl.el.JuelExpression.getValue(JuelExpression.java:59)
The variable is declared into the form previously executed.
Are you sure there is no error in this script ?
Is there a way to get the value of the groovy variable into the tomcat logs ??
Answer : this error message was generated by the decision table because the groovy script was not executed.
The groovy script was not executed because when you click on the “script task” module (in the process designer) you have to fill in the property named “Script format” with the value “groovy”.
The doc 6.1.2, chapter 14.3 says “Script form” instead of “Script format” => please update the doc !
And it could be a good idea to give the groovy script in a text format instead of an image : it allows to copy-paste the code and avoid misanderstanding : at first, i read “org.ioda.time.Days” instead of “org.joda.time.Days” => please update the doc for the future users !