Search code examples
activitibpmnbusiness-process-managementnashorn

Activiti JS how create FromData in .bpmn20.xml using Nashorn(JDK 8)


I tried to use js in .bpmn20.xml. Now I know, that using JDK 8, I am using Nashorn JavaScript engine. But how can I create new FormData in JS with Nashorn? I tried, like that:

var data = new org.activiti.engine.form.FormData();

but get error: Cannot create new object with constructor org.activiti.engine.form.FormData.

What is the right way to create FormData? And with Nashorn can I use normal JS code? How to load a package which need to JS? Before is was simply use Rhino in older JDK.

Actually in future I want to create XMLHttpRequest and send POST request to REST server.

Sorry for a lot of questions and thanks for understanding.


Solution

  • Is "org.activiti.engine.form.FormData" a java class? is that in a jar file? if so, you may want to put that in classpath for jjs tool [assuming you're using jjs tool to run the code] or app's classpath [assuming you use javax.script to evaluate scripts].