Evaluate an expression on some data and write the result to a data area or attribute.
By default, this only permits the data parameter. If you want to set other properties through parameters, you must explicitly permit them.
The script property identifies a JavaScript expression, e.g. "data.counter + 1". You can run complex expressions in a function, at its simplest something like
function(){return data.counter + 1;}()
You can set the script to a node in the properties using the "${script:binding}" syntax. Only the code of the script will be copied; bindings will not be available and any attempt to get them will result in null exceptions.
If you want to include a library scripts, you need to wrap the library scripts in a function, and put a comma between that and the evaluation. Global variables set by the library scripts will be visible to the evaluation script. Here is the example syntax:
"script": [
"function(){",
"${script:library1ScriptBinding}",
"${script:library2ScriptBinding}",
"}(),",
"${script:evaluationScriptBinding}"
]
Node options
Bindings
Name | Node |
---|---|
stepTypeEvaluate |