Logic Op - Branch
Overview
The Branch operation is used to perform a change of control with the operation sequence.
By default, operations are executed in sequential order starting from operation index 0
.
The branch
operation allows looping and branching within the operations
sequence.
- Direction: INTERNAL
- From: N/A
- To: N/A
Attributes
The operation attributes are as follows.
Attribute | Type | Description |
---|---|---|
type
|
String |
eval
|
expression
|
String |
[Required] The expression to evaluate, typically referencing $v , $i or $g .
*This attribute is always evaluated as an expression.*
|
on_true
|
String |
Optional label of operation to jump to if the expression evaluates as true .
|
on_false
|
String |
Optional label of operation to jump to if the expression evaluates as false .
|
Note: If the relevant ontrue
or onfalse
attribute is not configured, control will flow to the
following operation.
Note: The ontrue
or onfalse
label names are static. They are never evaluated as expressions.
Note: The ontrue
and onfalse
attributes (if configured) must refer to a matching label on
one of the operations. This check is performed at the start of the test run. The test run will
not commence if the labels cannot be resolved.
Example
This is an example entry within the operations
array:
{
"type": "branch",
"expression": "$v->{threshold} > 10",
"on_true": "increment3"
}