The inputs of the tool are defined by the inputParameters parameter. Input values can be accessed in the script code through an object called "$i" in the global scope. For example, if there is an input parameter called "input", its value is stored in "$i.input".
- A table that defines input parameters. The first column contains the name of a parameter, the second one its type (optional/required/fixed) and the third one the data type of the parameter's value.
- A table that defines output parameters. The first column contains the name of the parameter, the second one is type (synchronous/asynchronous) and the third one the data type of the parameter's value.
- Whether the script code supports state variables or not. It may have a slight impact on performance, so if the script does not need state variables, it is advisable not to enable this parameter.
The outputs of the tool are defined by the outputParameters parameter. Output values can be accessed in the script code through an object called "$o" in the global scope. For example, if there is an output parameter called "output", it can be assigned a value by "$o.output = value".
If an output is synchronous, it must be assigned a value on each processing round. Leaving a synchronous output empty will cause a run-time error. On the other hand, asynchronous outputs do not need to be assigned values.
The script can also use special state variables that maintain their values between the script runs. They can be accessed in the script code through an object called "$s" in the global scope. For example, storing to the state variable "foo" can be done by "$s.foo = 'bar'". Next time the script is run, variable "$s.foo" will have 'bar'.