The JavaScript Unit can be used to write and execute JavaScript. This Unit uses the onCore Code Editor which can be accessed via the Inspector. Declaring Input and Output PortsDeclare Input Ports with i_MyVar and Output Ports with o_MyVar. Input and Output Ports Data TypesThere are five types of Input/Output ports:
Examples:
|
Default Functions
By default there are three functions:
- Startup: is executed once when the JavaScript Unit is triggered after the Project is set into running state.
- Shutdown: is executed when Workflow stops executing (e.g. when the Project stops).
- Execute: is executed when the JavaScript Unit is triggered.
Using Project Variables
Project Variables can be used globally in certain Units (JavaScript, Shell Command). To use a Project Variable, enclose the Variable name in '$', for example "$myVariable$".