Functionality - Decisions
Summary
You can make decisions mid-task based on the values of static & dynamic variables.
The when keyword controls when a step or action is triggered.
Its value should be a Jinja2 or Python expression returning True or False.
Conditional Actions
Use when in one or more actions when making a decision inside a step.
This example asks the Task Operator to choose a number, & saves it as exit_code
.
The value of exit_code
is used to make decisions in the subsequent actions.
Conditional Actions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
Conditional Steps
Use when in a step to trigger all the contained actions from the same condition.
This example uses exit_code
to make the same decisions as conditional actions.
To avoid repeating the second condition, the actions are grouped into conditional steps.
Conditional Steps
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|