This node provides the possibility to append an arbitrary number of flow variables or modify existing variables using expressions. For each variable that shall be appended or modified a separate expression is defined. These expressions can be simply created using predefined functions similar to the Math Formula and String Manipulation Nodes). Nevertheless there is no restriction on the number of lines an expression has and the number of functions it uses. This allows users to create their own complex expressions.
Additionally, intermediate results of functions or calculations can be stored within an expression by assigning them to variables (using '='). This allows that these results can be reused in different parts of the expression after they have been assigned (see Examples). Note: the names of these variables must be different to all of the predefined function identifiers. Otherwise an error will occur.
To change an expression of an output variable it has to be selected in the list of expressions. By selecting an expression the Expression Editor shows up and the user can modify the expression in the provided text area.
Available flow variables can be accessed via the provided method variable("varName"). For each expression the last computed instruction will be returned.
The syntax and grammar of the expressions are based on the Javascript Languange .
Examples:
- 5*7+3
will append a variable with the value 38. - v = variable("knime.workspace")
substr(v, lastIndexOfChar(v,"/"), length(v))
will create a variable containing the folder name of the KNIME workspace folder. - "a1"
"a2"
will create a variable with the value "a2", whereas
a1 = "a1"
a2 = "a2"
a1
will create a variable with the value "a1".