Use an ESQL expression to specify the
loop condition for a While node or to specify the exit condition for
one of the output terminals of a Switch node.
Using an ESQL expression with
a While node
The ESQL expression of
a While node states the loop condition for the While loop to which
the While node belongs.
To work properly
a While node must contain an ESQL expression that resolves to a Boolean
true or false value. At runtime the While node evaluates the ESQL
expression and obtains a result. If the result is true then the While
node invokes its associated flow. Otherwise the While node terminates
(see Basic information about While nodes).
Using ESQL expressions with
a Switch node
A Switch node has multiple
output terminals (two or more) that are arranged vertically on the
right side of the Switch node, as in the figure below:
Each output terminal has associated with it an ESQL
expression that you must specify and that must
evaluate to a Boolean value, either true or false. The last (bottommost)
output terminal is the Default output terminal and is automatically
associated with an ESQL
expression that always
evaluates to true.
To process the Switch node
at runtime, the runtime code starts processing each output terminal
in serial order starting with the topmost terminal. To process an
output terminal, the runtime code evaluates the ESQL expression associated
with the output terminal. If the ESQL expression evaluates
to true, then the runtime code immediately stops processing output
terminals and follows the flow branch connected to the output terminal
whose ESQL expression evaluated to true.
If the runtime code reaches the Default output terminal
(because the ESQL expressions associated with
all the other output terminals returned false) then the runtime code
evaluates the ESQL expression associated with
the Default output terminal, finds that the result is true, and follows
the flow branch connected to the output terminal.