Creating complex branches using the variable evaluator
In some complex cases, just using exit codes for flow branching decisions might not be enough. You can also use the variable evaluator to do the branching decision.
About this task
Platform Process Manager supports complex user variable expressions in the variable evaluator. In the following example, if J1 sets var2’s value to 1, it will trigger J7.
The variable evaluator serves as an intermediate step between jobs and the validation of variable decision branches. Typically, the predecessors of a variable evaluator assign values to various user variables. When all the variables are set, the variable evaluator will evaluate all of its variable expression branches and determine which successors to start executing. If there is no predecessor to the variable evaluator, the variable evaluator will start and run to completion immediately.
When you specify the variable expressions for each branch, you can use a combination of variables, operators, and constants. The variable evaluator supports the following operators: <, >, =, >=, <=, !=
The basic variable expression consists of one variable, one operator, and one constant: variable operator constant. For example, #{A} > 1.
You can also create larger and more complect expressions by joining smaller expressions using the following boolean operators:
&& (AND), || (OR), ! (NOT), () (parentheses). However, you can only apply ! (NOT) to variable expressions and not to literals. That is, !({#A} > {#B}) is valid while !({#A}) >{#B} is not.
For example, the following at all valid combinations of variable expressions:
- #{A} < 4 && #{B} > 3
- !(#{A} < 4 || #{B} > 4)
- !(#{A} > 2 && #{B} > 3) || #{C} > 5
You can also specify an else branch decision. The variable evaluator only evaluates else branches to TRUE if all other non-else branches evaluate to FALSE.