Include the variable evaluator to run jobs based on decision branches

About this task

The variable evaluator (VE) is a work item in the flow editor that allows jobs to depend on the evaluation of variable expressions instead of the traditional job exit status, time events, and file events. This work item contains no actual jobs to run, and therefore you cannot kill, suspend, or resume it. In addition, since the work item does not perform any actual work, you cannot use the variable evaluator as a triggering event, a proxy event to start the next work item, or as a flow completion criterion.

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.

Display or hide variable evaluator expressions by selecting View > Show Dependency Conditions. You can also access the menu from the pop-up menu by right-clicking in the flow canvas.

Procedure

  1. Click the Variable Evaluator button to put the Flow Editor in variable evaluator placement mode.
  2. Left-click in the workspace in the location where you want to insert the variable evaluator.

    The variable evaluator icon is added to the flow diagram.

  3. If you want to include a name or description of the variable evaluator, double-click the variable evaluator icon that you added and specify these fields.
  4. Draw the lines linking any predecessors (dependencies) the variable evaluator has on other work items in the flow definition.

    The predecessors will likely have variable definitions on which the variable evaluator will make decisions.

    If you do not define any dependencies for the variable evaluator, the variable evaluator will be triggered immediately when the flow runs.

  5. Draw the lines linking the variable evaluator to the decision branching jobs that depend on the variable evaluator.

    In the flow editor, the decision branching can be drawn as a link object from the variable evaluator to any successive jobs. The link dependencies definition has the following options:

    • Specify a variable expression

      The variable evaluator branches to this job if the variable expression that you specify is TRUE. Specify a variable expression or a combination of variable expressions.

      If you specify multiple branches that evaluate to TRUE in a workflow, they will all run their next jobs.

      Note:

      If, at runtime, a variable is undefined and thus cannot be resolved to a value, the variable evaluator evaluates the corresponding sub-expression to FALSE; however, the whole expression might not be evaluated to FALSE.

    • else

      The variable evaluator branches to this job if all the other variable expressions are FALSE.

      If you specified multiple else statements in a workflow, they will all run their next jobs if the all of the other (non-else) variable expressions are FALSE.

  6. Click OK.