Load task script from external file

Hi,
On my .bpmn, I tried to execute a script task from external file. Whatever the path I set on “script ressource” I got the same error :

Uncaught Error: Cannot submit task form 16ae3254-28c6-11e7-8be2-f8bc126c9c70: ENGINE-09024 Unable to find resource at path test-ng/script/helloWorld.js

there is my Folder Structure :

  • tomcat
  • webapp
    • camunda
    • some others
    • test-ng
      • script
        • helloWorld.js
      • WEB-INF
        • classes
          • postOnNg.bpmn

I’ve tried different path like :

  • embedded:app:script/helloWorld.js
  • deployment://test-ng/script/helloWorld.js
  • deployment://script/helloWorld.js

Did I missed something?

If you have some question or want some file, please ask.

In the Eclipse plugin version (not Modeler), if I had my Groovy script in an external file under the groovy directory, the reference would be: groovy/mygroovyscript.groovy

This would be relative to same directory structure that was the “base” for the bpmn files. For example, in a typical Maven project bpmn files might be found under src -> main -> resources -> bpmn. Therefore, if your external scripts were under a JavaScript directory called “javascript”, they would sit under src -> main -> resources -> javascript.

I know this might not help as I am using WildFly and the deprecated (and still far superior) Eclipse plugin. I’m not sure I understand any of the choices you’re making above, but perhaps your deployment model is really different from mine.

Your script actually needs to be a server resource rather than a part of the webapp as it is executed on the server side.
Therefore, WEB-INF/classes will be considered your “root” directory.
Put the script under there and reference by path and you should be good to go.
Greg

Thanks for your answer,
I follow the folder structure of camunda-invoice who is on the tomcat server integrating camunda. I don’t find which tutorial I follow but nevermind. I will try to change the project structure.

thanks to you too,
I try this.

thanks a lot, it’s work fine.

last question, how to mark the topic as solved? :slight_smile:

Can you please provide script and location of your script here, i am facing same problem.