Activiti error:using JavaScript in .bpmn20.xml
Activiti error:using JavaScript in .bpmn20.xml
我试过在Activiti进程中那样使用JS:
<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>
这个 xml 上传完美,但是当我尝试启动进程时,我有错误:
Reference Error:"console" is not defined at line 3
我也尝试在 js 中创建新表单:
var form = new FormData();
我又犯了同样的错误。
我做错了什么?这是什么错误?
感谢您的帮助
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.
默认 JavaScript 引擎是 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
函数
var my = "Bla bla bla";
print(my);
我试过在Activiti进程中那样使用JS:
<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>
这个 xml 上传完美,但是当我尝试启动进程时,我有错误:
Reference Error:"console" is not defined at line 3
我也尝试在 js 中创建新表单:
var form = new FormData();
我又犯了同样的错误。
我做错了什么?这是什么错误?
感谢您的帮助
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.
默认 JavaScript 引擎是 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
函数
var my = "Bla bla bla";
print(my);