Skip to content

Commit 8508601

Browse files
manick02tsurdilo
andauthored
#462 Make IterationParam in foreach state optional (#477)
* #462 Make IterationParam in foreach state optional Signed-off-by: cb-manick <[email protected]> * updated text on spec doc and added to roadmap Signed-off-by: Tihomir Surdilovic <[email protected]> Co-authored-by: Tihomir Surdilovic <[email protected]>
1 parent e931520 commit 8508601

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

roadmap/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ _Status description:_
2323
| Status | Description | Comments |
2424
| --- | --- | --- |
2525
| ✔️| Support custom function `type` definition | [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md) |
26-
| ✔️| Workflow "name" no longer a required parameter | [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md) |
27-
| ✔️| Workflow "start" no longer a required parameter| [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md) |
26+
| ✔️| Workflow "name" no longer a required property | [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md) |
27+
| ✔️| Workflow "start" no longer a required property| [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md) |
28+
| ✔️| ForEach state "iterationParam" no longer a required property| [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md) |
2829
| ✏️️| Support for async action invocation | |
2930
| ✏️️| Start work on TCK | |
3031
| ✏️️| Add more samples | |

schema/workflow.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,6 @@
16081608
"name",
16091609
"type",
16101610
"inputCollection",
1611-
"iterationParam",
16121611
"actions"
16131612
]
16141613
},
@@ -1619,7 +1618,6 @@
16191618
"name",
16201619
"type",
16211620
"inputCollection",
1622-
"iterationParam",
16231621
"actions",
16241622
"end"
16251623
]
@@ -1629,7 +1627,6 @@
16291627
"name",
16301628
"type",
16311629
"inputCollection",
1632-
"iterationParam",
16331630
"actions",
16341631
"transition"
16351632
]

specification.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2854,7 +2854,7 @@ The `timeouts` property can be used to define state specific timeout settings. I
28542854
| type | State type | string | yes |
28552855
| inputCollection | Workflow expression selecting an array element of the states data | string | yes |
28562856
| outputCollection | Workflow expression specifying an array element of the states data to add the results of each iteration | string | no |
2857-
| iterationParam | Name of the iteration parameter that can be referenced in actions/workflow. For each parallel iteration, this param should contain an unique element of the inputCollection array | string | yes |
2857+
| iterationParam | Name of the iteration parameter that can be referenced in actions/workflow. For each parallel iteration, this param should contain an unique element of the inputCollection array | string | no |
28582858
| batchSize | Specifies how many iterations may run in parallel at the same time. Used if `mode` property is set to `parallel` (default). If not specified, its value should be the size of the `inputCollection` | string or number | no |
28592859
| mode | Specifies how iterations are to be performed (sequentially or in parallel). Default is `parallel` | string | no |
28602860
| [actions](#Action-Definition) | Actions to be executed for each of the elements of inputCollection | array | yes |
@@ -2926,8 +2926,8 @@ Each iteration of the ForEach state is by default executed in parallel by defaul
29262926
However, executing iterations sequentially is also possible by setting the value of the `mode` property to
29272927
`sequential`.
29282928

2929-
The `mode` property defines if iterations should be done sequentially or in parallel. By default
2930-
(if `mode` is not specified) iterations should be done in parallel.
2929+
The `mode` property defines if iterations should be done sequentially or in parallel. By default,
2930+
if `mode` is not specified, iterations should be done in parallel.
29312931

29322932
If the default `parallel` iteration mode is used, the `batchSize` property to the number of iterations (batch)
29332933
that can be executed at a time. To give an example, if the number of iterations is 55 and `batchSize`
@@ -2942,9 +2942,10 @@ an error. This error can be handled inside the states [`onErrors`](#Error-Defini
29422942
The `outputCollection` property is a workflow expression which selects an array in the state data where the results
29432943
of each iteration should be added to. If this array does not exist, it should be created.
29442944

2945-
The `iterationParam` property defines the name of the iteration parameter passed to each parallel execution of the ForEach state.
2946-
It should contain the unique element of the `inputCollection` array and passed as data input to the actions/workflow defined.
2947-
`iterationParam` should be created for each iteration, so it can be referenced/used in defined actions / workflow data input.
2945+
The `iterationParam` property defines the name of the iteration parameter passed to each iteration of the ForEach state.
2946+
It should contain the unique element of the `inputCollection` array and made available to actions of the ForEach state.
2947+
If `iterationParam` is not explicitly defined, runtimes should create one and populate it with the value of the unique
2948+
iteration parameter for each iteration of the ForEach state.
29482949

29492950
The `actions` property defines actions to be executed in each state iteration.
29502951

0 commit comments

Comments
 (0)