Camunda bpmn Groovy Script Exception for use() method

Hello,

Groovy script used in camunda bpmn fails but it works when tested with groovy console or IntelliJ

groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.use() is applicable for argument types: (java.lang.Class, Script18$_run_closure1) values: [class groovy.time.TimeCategory, Script18$_run_closure1@52bb3dcd]\nPossible solutions: use(java.lang.Class, groovy.lang.Closure), use([Ljava.lang.Object;), use(java.util.List, groovy.lang.Closure), dump(), grep(), any()"}

Is anyone able to fix these type of issues ?

Thanks

Would you please share more info.

  1. what version of Camunda are you using
  2. Did you add groovy depdency to the project.
  3. Share the groovy script if possible.