Foreach#
Perform an action that will determine the next step(s)
| Name | Description | Mandatory | Type | Possible Values | Default Value |
|---|---|---|---|---|---|
| items | List of items to iterate | N | Any[] | ||
| itemsKey | Key that points to the list of items to iterate | N | String | ||
| itemKeyName | Name of key to use to store the iterated value | Y | String | ||
| subSteps | Optional steps to be executed as children of this step | N | BusinessScenarioStep[] | [] |
Remarks#
- Either
itemsoritemsKeyis to be defined. When both are defined, onlyitemswill be used. - It is expected to have an array of items to iterate. Any other type will result in an error
- Each iteration will create a new execution using only the
subStepsdefined, starting with the very first one and moving according to the rules defined for the behavior of each step type - The iteration will have a clean list of answers, filling only the value being iterated using the
itemKeyNameas key in the answers - Currently, there is no access to the scope of the rest of the scenario
- As a way to override this limitation, the developer can fill an array with objects with the values that require to be used within the foreach loop and access them with the
itemKeyNameproperty of the answers.
- As a way to override this limitation, the developer can fill an array with objects with the values that require to be used within the foreach loop and access them with the
- All values of the array will be iterated
- Each iteration result will be reported in the
resultKeyentry of the scenario that contained the foreach step within an array