Writing a script expression

A script expression is written in JavaScript; other scripting languages are not supported.

The value of a script expression's property is set to the result of evaluating the main body of the script as an expression. The main body may invoke functions defined in the script expression itself or provided as part of the Switch scripting API. Also, the script expression can use the predefined variables "job" and "s" which represent the job and the flow element context at the moment of script evaluation (see predefined variables below).

You have two options for developing and testing a script expression:


SwitchScripter offers several advantages for working with complex script expressions. Most importantly, you can setup test fixtures to verify the script expression's results without having to activate a flow and process jobs, and you can save the script expression in a script package for future use (like when using a script expression) or for sharing it with other users.