Load script from external resource error

Hello,

I am using http-connector to call an external REST API. I have written a javascript and kept it in my Apache server. I want to load that java script for payload. Please find the attached image below.
script

I am getting following error now.

{
“type”: “RestException”,
“message”: “Cannot instantiate process definition 9204f7ee-11fc-11e8-add7-9cad97d34f79: ENGINE-09024 Unable to find resource at path http://localhost:90/test-script.js
}

So is it possible to add javascript file from external location while using http-connector?

Easy to load your script from URL. Use the embedded script as JavaScript. And in the Js write load('http://www.....')

See nashorn extensions for the load() function.

Edit: you can also do load('classpath:myJsFile.js') which will load the js files sitting in your lib folder/classpath

1 Like

Thanks for the information.

Just want to know if we specify “Script Type” = “External Resource” then we can not specify any URL to load the resources… Please correct my understanding.

https://docs.camunda.org/manual/7.7/user-guide/process-engine/scripting/#script-source

Never seen it documented to be used as a http URL