- 28 Feb 2024
-
DarkLight
-
PDF
Decision Task Replaced in Gen 2 Workflows
- Updated on 28 Feb 2024
-
DarkLight
-
PDF
Deprecation Notice [2023.2.0]
The decision
task is deprecated and no longer supported in the GEN 2 workflow canvas for the 2023.2 IAP release. Since the decision
task acts as an evaluator, you will need to replace it with the Evaluation
task.
Task Name | Description | Deprecation Release | Scheduled Removal Release | Replacement |
---|---|---|---|---|
decision | Used to create branches within a workflow to validate if specified variables exist. | 2023.2 | 2024.1 | Evaluation |
What should I do?
Use the Evaluation
task instead. The Evaluation
task allows users to define a set of conditionals and execute a success/failure transition in the workflow. Before explaining how to use the Evaluation
task in GEN 2, let's lay some groundwork by discussing how the decision
task worked prior.
Figure 1 shows a decision
task that takes in a color (string) and matches it to either red, green, or blue to "decide" (evaluate) which stub
task to transition to in the workflow. In this scenario, the decision
task acts as a set of evaluations.
Figure 1: Decision Task GEN 2 Canvas (Deprecated)
With the decision
task, a set of conditional expressions also were defined for each subsequent task (Figure 2). Users could choose if “any” (at least one) or “all” of the conditions must pass in order to transition to that task. Conditionals are evaluated in order (serially), so that the first task with all conditions met is the task that is selected to run. If no conditions were met, then a “default” transition was used. In Figure 1, the “default” transition was drawn to the End
of the workflow.
Figure 2: Conditionals
How to Use the Evaluation Task (GEN 2)
To achieve the same branching effect, replace decision
with a set of Evaluation
tasks as shown in Figure 3. For each Evaluation
task, you can place the same condition that was used in the decision
task along with a success transition (green) to the stub
task. A failure transition (purple) is used to transition to the next Evaluation
task. A final failure transition from the last Evaluation
task is used to create a “default” transition to the End
of the workflow.
Figure 3: Evaluation Task GEN 2 Canvas (Replacement)
Figure 4 shows a snippet of input sources (operands) for the Evaluation
task. Notice how the evaluation criteria is the same as the “Red” evaluation (“Does the ‘color’ job variable equal the static value ‘red’”) from the decision
task in Figure 2.
Figure 4: Evaluation Task Operand Data
Data for conditional expressions can come from input job variables, previous task outputs, or static values. A conditional operator is selected along with the data to compare it against. Below is a list of conditional operators that are allowed when the Evaluation
task is used:
- “contains”
- “does not contain”
- “equals”
- “does not equal”
- “greater than”
- “greater than or equal”
- “less than”
- “less than or equal”