Skip to content

Commit f777c10

Browse files
authored
Update Parallel state completionType values/description (#351)
Signed-off-by: Jorgen Johnson <[email protected]>
1 parent b747a3c commit f777c10

File tree

5 files changed

+19
-20
lines changed

5 files changed

+19
-20
lines changed

comparisons/comparison-argo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ states:
172172
transition: parallelhello
173173
- name: parallelhello
174174
type: parallel
175-
completionType: and
175+
completionType: allOf
176176
branches:
177177
- name: hello2a-branch
178178
actions:
@@ -273,7 +273,7 @@ states:
273273
transition: parallelecho
274274
- name: parallelecho
275275
type: parallel
276-
completionType: and
276+
completionType: allOf
277277
branches:
278278
- name: B-branch
279279
actions:

examples/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ states:
485485
#### Description
486486
487487
This example uses a parallel state to execute two branches (simple wait states) at the same time.
488-
The completionType type is set to "and", which means the parallel state has to wait for both branches
488+
The completionType type is set to "allOf", which means the parallel state has to wait for both branches
489489
to finish execution before it can transition (end workflow execution in this case as it is an end state).
490490
491491
#### Workflow Diagram
@@ -515,7 +515,7 @@ to finish execution before it can transition (end workflow execution in this cas
515515
{
516516
"name": "ParallelExec",
517517
"type": "parallel",
518-
"completionType": "and",
518+
"completionType": "allOf",
519519
"branches": [
520520
{
521521
"name": "ShortDelayBranch",
@@ -544,7 +544,7 @@ start: ParallelExec
544544
states:
545545
- name: ParallelExec
546546
type: parallel
547-
completionType: and
547+
completionType: allOf
548548
branches:
549549
- name: ShortDelayBranch
550550
workflowId: shortdelayworkflowid

roadmap/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ _Status description:_
2626
| ✔️| Add workflow `dataInputSchema` property | [spec doc](../specification.md) |
2727
| ✔️| Rename switch state `default` to `defaultCondition` to avoid keyword conflicts for SDK's | [spec doc](../specification.md) |
2828
| ✔️| Add description of additional properties | [spec doc](../specification.md) |
29+
| ✔️| Rename Parallel `completionType` values | [spec doc](../specification.md) |
2930
| 🚩 | Workflow invocation bindings | |
3031
| 🚩 | CE Subscriptions & Discovery | |
3132
| 🚩 | Error types | [issue](https://github.com/serverlessworkflow/specification/issues/200) |

schema/workflow.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -840,21 +840,20 @@
840840
"completionType": {
841841
"type": "string",
842842
"enum": [
843-
"and",
844-
"xor",
845-
"n_of_m"
843+
"allOf",
844+
"atLeast"
846845
],
847846
"description": "Option types on how to complete branch execution.",
848-
"default": "and"
847+
"default": "allOf"
849848
},
850-
"n": {
849+
"numCompleted": {
851850
"type": [
852851
"number",
853852
"string"
854853
],
855854
"minimum": 0,
856855
"minLength": 0,
857-
"description": "Used when completionType is set to 'n_of_m' to specify the 'N' value"
856+
"description": "Used when completionType is set to 'atLeast' to specify the minimum number of branches that must complete before the state will transition."
858857
},
859858
"onErrors": {
860859
"type": "array",

specification.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3172,8 +3172,8 @@ Delay state waits for a certain amount of time before transitioning to a next st
31723172
| name | State name | string | yes |
31733173
| type | State type | string | yes |
31743174
| [branches](#parallel-state-branch) | List of branches for this parallel state| array | yes |
3175-
| completionType | Option types on how to complete branch execution. Default is "and" | enum | no |
3176-
| n | Used when branchCompletionType is set to `n_of_m` to specify the `n` value. | string or number | no |
3175+
| completionType | Option types on how to complete branch execution. Default is "allOf" | enum | no |
3176+
| numCompleted | Used when branchCompletionType is set to `atLeast` to specify the least number of branches that must complete in order for the state to transition/end. | string or number | no |
31773177
| [stateDataFilter](#State-data-filters) | State data filter | object | no |
31783178
| [onErrors](#Error-Definition) | States error handling and retries definitions | array | no |
31793179
| [transition](#Transitions) | Next transition of the workflow after all branches have completed execution | object | yes (if end is not defined) |
@@ -3197,7 +3197,7 @@ Delay state waits for a certain amount of time before transitioning to a next st
31973197
{
31983198
"name":"ParallelExec",
31993199
"type":"parallel",
3200-
"completionType": "and",
3200+
"completionType": "allOf",
32013201
"branches": [
32023202
{
32033203
"name": "Branch1",
@@ -3236,7 +3236,7 @@ Delay state waits for a certain amount of time before transitioning to a next st
32363236
```yaml
32373237
name: ParallelExec
32383238
type: parallel
3239-
completionType: and
3239+
completionType: allOf
32403240
branches:
32413241
- name: Branch1
32423242
actions:
@@ -3261,14 +3261,13 @@ end: true
32613261

32623262
Parallel state defines a collection of `branches` that are executed in parallel.
32633263
A parallel state can be seen a state which splits up the current workflow instance execution path
3264-
into multiple ones, one for each of each branch. These execution paths are performed in parallel
3264+
into multiple ones, one for each branch. These execution paths are performed in parallel
32653265
and are joined back into the current execution path depending on the defined `completionType` parameter value.
32663266

32673267
The "completionType" enum specifies the different ways of completing branch execution:
3268-
* and: All branches must complete execution before state can perform its transition. This is the default value in case this parameter is not defined in the parallel state definition.
3269-
* xor: State can transition when one of the branches completes execution
3270-
* n_of_m: State can transition once `n` number of branches have completed execution. In this case you should also
3271-
specify the `n` property to define this number.
3268+
* allOf: All branches must complete execution before the state can transition/end. This is the default value in case this parameter is not defined in the parallel state definition.
3269+
* atLeast: State can transition/end once at least the specified number of branches have completed execution. In this case you must also
3270+
specify the `numCompleted` property to define this number.
32723271

32733272
Exceptions may occur during execution of branches of the Parallel state, this is described in detail in [this section](#parallel-state-exceptions).
32743273

0 commit comments

Comments
 (0)