Global Script for each process in workflow?

Hi,

Just wondering if its now possible to add a global script(js) only within the whole process? Then able to run functions from it, so we didn’t have to have multiple script file when required?

FYI: Im aware of global includes but the scripts gets included on all the process in the workflow config.

I tend to only now use external script than directly coding from script editor.

Thank you
Kind regards
E

Hello @edanting,

It is unfortunately not entirely clear to me what you would or would not like to achieve. For example, can you let us know why you would not like to include JavaScript files in Workflow?

There is a way to add an include file dynamically within any script with the userIncludes object:

userIncludes.add("C:\\myIncludes\\somefile.js")

The command loads the module in memory, just like all other includes, and it remains there until completion of that script, after which it is discarded. If you want to use the same module in several scripts within the same process, you will have to add the line above to every one of those scripts.

2 Likes

Hi Marten,

Take global includes [includes.json] , all the scripts gets loaded each time “Run Script” plugin is invoked. These script files are available to all processes in the a workflow config file.

What I want is same global include but specific to one process only. So other processes do not include this script where its not necessary.

Hope that make sense.

Oh wow, thats it! This will do. I would like it to be just include once per process but this is better than nothing.

I tried it and it worked!

Thanks Phil