println(“test JS script”);
I have deployed a BPMN process as well with a script task.
Is it possible to call the testJS function from the BPMN script task?
If yes pls help how can I do it?
Thanks and regards: Gábor
Have a look at the documentation on script sources. You can reference a script contained in a deployment by using the
camunda:resource attribute, e.g.
Thank you the info. The linked page was known for me that was the reason
why I would like to reuse an existing script but I don’t know how…
So I have created a JS script such as:
I have deployed with the built-in Camunda rest API. The name is js.
I have created a new bpmn process and in a script task I would like to run
my script. Set a workflow variable for example.
The JS deployment is success but I don’t know how can I set the variable. I
have no information about the deployment://path because it was deployed
into the database directly.
I have checked on Cockpit and the js was deployed.
I have tried to use as external script but I don’t know how can I assign
the deployed js and the BPMN file. If I would like to use an internal
script I have no idea how can I use in
the execution.setVariable(“wf_var”,???) statement.
Do you have any example how does it work? The external JS can be a DTI
example what is very difficult and I would like to develop only once but
use more times in more BPMNs.
Thanks in advance.
When you reference a script via
deployment://path, the process engine resolves it from the deployment that contains the process. That means, you must deploy the script along with the process.
Now if you want to reuse one script across many processes and process applications, I suggest the following:
- Build a Java library that contains the scripts on the classpath
- Add that library as a dependency to your process applications and include it in their deployments
- Reference the script via
Does that work for you?
Here we have the same problem.
It is absolutely despicable idea to create a chain of JAR to be referenced in a master process.
We 'd like to know if you found a workaround to this problem.
@thorben is possible that the resriction about SHARED JS is because the cache of the BPMN executor over the js engine?
Do you have plan to improve this?