User Guide : Designing and Executing Processes : Process Steps and Associated Components : Decision Step
Share this page             
Decision Step
The Decision step allows you to set up a conditional evaluation to make logical choices between possible process paths. Generally, this is done with a Boolean expression. For example, the following expression evaluates as true if the month is September and false for all other months:
Month(Date()) == 9
If the expression is true, then the true branch of the process is followed. If it is false, then the false branch is followed. It is possible to have multiple true branches or multiple false branches.
If you have a multi-threading engine, then the selected branches can be executed in parallel. If not, they are executed in random order. In either case, the process executes all paths that match the expression results before proceeding to the next step in the process.
Another option is to use an expression that evaluates to a number. If the number is zero, the process treats it as false. If it evaluates to any other number, it is treated as true.
If the expression returns a string, the step fails and the process is stopped. Additionally, the string returned by the expression is displayed as the step result (error message) and written to the log file.
Evaluating Decision Step Expressions
Decision step expressions evaluate as follows:
The Decision step expression must resolve to either true or false.
Expressions that do not resolve to true or false cause the process to stop.
Numeric values, positive and negative, evaluate to true.
Zero (0) evaluates to false.
Numeric values and true cause a Decision step to follow the true path.
Zero (0) and false cause a Decision step to follow the false path.
A string of characters must be enclosed in quotation marks (") to be evaluated as a string.
A string of characters that is not enclosed in quotation marks (") is evaluated as a variable name, function name, or keyword.
Non-numeric strings evaluate to false.
Undefined variables cause the expression to resolve to false.
True and False (case-insensitive) are keywords, so do not enclose them in quotation marks (").
Functions can be used if they return a boolean, numeric, or string value.
Functions that do not return a value generate a run-time error.
Decision step expressions compile at validation to determine if they are valid.
A valid expression that does not resolve to true or false, a select statement for example, generates a validation warning.
A Decision step must have at least one true and one false path to be valid and to prevent infinite looping. The only true path or only false path cannot be a path back to the Start step, otherwise the process is not valid and you may receive an error.
Decision Step Properties
After adding a /download/attachments/25952274/Decision_step.png?version=1&modificationDate=1491995340772&api=v2 Decision step from the Palette to the canvas, you can double-click the step on the canvas and specify the following step properties in the Properties tab displayed at the bottom.
Unique name for the step.
Description for the step
Type the expression to evaluate in the text box or click Open to open the EZscript Expressions window and specify the expression.
The examples below show how to define Decision steps based on properties returned by other steps:
Project("Initial_Test").Status == "Completed" And Project("Map_001").ReturnCode == 25009
'If Initial_Test succeeds and Map_001 fails with a return code of 25009, this script returns True.
Project("Import_Step").ErrorCount == 0
'If Import_Steps returns no errors, this script returns True.
To use Script Editor to build the Decision step expression, see Using Scripts in Processes.