I tried to use JS like that in Activiti process:
<process id="test_model" isExecutable="true">
<startEvent id="414-013"></startEvent>
<scriptTask id="javascriptScript" name="jsTask" scriptFormat="JavaScript" activiti:autoStoreVariables="false">
<script><![CDATA[
var my = "Bla bla bla";
console.log(my);
]]></script>
</scriptTask>
<endEvent id="0DC2EF"></endEvent>
</process>
This xml uploaded perfect, but when I try Start Process, I have error:
Reference Error:"console" is not defined at line 3
Also I tried create new Form in js:
var form = new FormData();
And again I have the same error.
What I`m doing wrong? In what this error?
Thank you for help
http://www.activiti.org/userguide/index.html#bpmnScriptTask
By default JavaScript is included in every JDK and as such doesn’t need any additional jars.
Default JavaScript engine is Rhino (JDK6, JDK7) or Nashorn (JDK8+) depending on JDK version. These engines do not support browser APIs and therefore don't provide browser specific objects like console
. The main purposue of the bundled engines is scripting java, see Java Scripting Programmer's Guide
print
function
var my = "Bla bla bla";
print(my);