cancel
Showing results for 
Search instead for 
Did you mean: 

Default scripts inside Workflow

blackout
Champ in-the-making
Champ in-the-making
Hi everyone,

I was wondering if is possible to call default scripts (like the ones in "Company Home > Data Dictionary > Scripts") into a process definition so that the same workflow, calling the same script, has different behaviours depending on what I locally wrote in the script (for example, I may want to create folders with slightly different names).

Thanks in advance.
1 REPLY 1

anweber
Champ in-the-making
Champ in-the-making
Hi,

   I think it's easy to do : In your workflow, we will have JavaScript code that will read the content of your script file and will eval it (JavaScript is an interpreted language that can evaluate a piece of code dynamically).

  Try something like this (not tested):

function evaluateScript(scriptPath){   var result;   var scriptContent = companyhome.childByNamePath(scriptPath).content;   try{      result = eval(scriptContent);   }   catch(exception){      result = "error";    }   return(result);}‍‍‍‍‍‍‍‍‍‍‍‍‍

    I hope it will help you.

    Regards,

              Andre