I'm playing with workflows and must say it is terrible experience
From UI all looks good then in logs I see errors about my model.
I've try to just run sample script delivered with AEM and it is not working
Unable to execute rule /libs/workflow/scripts/sample.ecma : Failure running script /libs/workflow/scripts/sample.ecma: ReferenceError: "workItem" is not defined. (NO_SCRIPT_NAME#2)
Now I limited my script just to log some random text
log.info("Workflow Bartek LOG test");
And now error is even more surprising
Caused by: org.apache.sling.api.scripting.ScriptEvaluationException: Failure running script /libs/workflow/scripts/my-test.ecma: ReferenceError: "check" is not defined. (NO_SCRIPT_NAME#2)
I don't have any "check" in my script and running it as single process. Any idea how to make it work? Should I even spend time on playing with ECMA scripts?