Skip to content

Commit 60b92d1

Browse files
authored
Fix various issues in the specification and schema (#633)
Signed-off-by: Marián Macik <[email protected]>
1 parent e2fb1d7 commit 60b92d1

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

schema/workflow.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@
439439
"$ref": "#/definitions/functionref"
440440
},
441441
"eventRef": {
442-
"description": "References a 'trigger' and 'result' reusable event definitions",
442+
"description": "References a `produce` and `consume` reusable event definitions",
443443
"$ref": "#/definitions/eventref"
444444
},
445445
"subFlowRef": {

specification.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ a workflow with a single event state and show how data filters can be combined.
674674
}],
675675
"stateDataFilter": {
676676
"input": "${ .greetings } ",
677-
"output": "${ .finalCustomerGreeting }"
677+
"output": "${ { finalCustomerGreeting } }"
678678
},
679679
"end": true
680680
}
@@ -1785,7 +1785,7 @@ definition "id" must be a constant value.
17851785
| autoRetries | If set to true, [actions](#Action-Definition) should automatically be retried on unchecked errors. Default is false | boolean| no |
17861786
| [retries](#Retry-Definition) | Workflow retries definitions. Can be either inline retries definitions (if array) or URI pointing to a resource containing json/yaml retry definitions (if string) | array or string| no |
17871787
| [states](#Workflow-States) | Workflow states | array | yes |
1788-
| [extensions](#Workflow-Extensions) | Workflow extensions definitions | array or string | no |
1788+
| [extensions](#Extensions) | Workflow extensions definitions | array or string | no |
17891789
| [metadata](#Workflow-Metadata) | Metadata information | object | no |
17901790

17911791
<details><summary><strong>Click to view example definition</strong></summary>
@@ -3342,7 +3342,7 @@ that triggers workflow instance creation, or continuation of workflow instance e
33423342
that the workflow instance creates during its execution (produced).
33433343
The default value (if not specified) of the `kind` property is `consumed`.
33443344
Note that for `produced` event definitions, implementations must provide the value of the CloudEvent source attribute.
3345-
In this case (i.e., when the `kind` property is set to `produced`), the `source` property of the event definition is not required.
3345+
In this case (i.e., when the `kind` property is set to `produced`), the `source` property of the event is not required in the workflow definition.
33463346
Otherwise, (i.e., when the `kind` property is set to `consumed`), the `source` property must be defined in the event definition.
33473347

33483348
Event correlation plays a big role in large event-driven applications. Correlating one or more events with a particular workflow instance
@@ -3539,7 +3539,7 @@ See [here](https://oauth.net/2/) for more information about OAuth2 Authenticatio
35393539
| password | String or a workflow expression. Contains the user password. Used only if grantType is 'resourceOwner' | string | no |
35403540
| audiences | Array containing strings or workflow expressions. Contains the OAuth2 audiences | array | no |
35413541
| subjectToken | String or a workflow expression. Contains the subject token | string | no |
3542-
| requestedSubject | String or a workflow expression. Contains the client identifier | string | no |
3542+
| requestedSubject | String or a workflow expression. Contains the requested subject | string | no |
35433543
| requestedIssuer | String or a workflow expression. Contains the requested issuer | string | no |
35443544
| [metadata](#Workflow-Metadata) | Metadata information| object | no |
35453545

@@ -3594,7 +3594,7 @@ correlation:
35943594
Used to define event correlation rules. Only usable for `consumed` event definitions.
35953595

35963596
The `contextAttributeName` property defines the name of the CloudEvent [extension context attribute](https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#extension-context-attributes).
3597-
The `contextAttributeValue` property defines the value of the defined the CloudEvent [extension context attribute](https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#extension-context-attributes).
3597+
The `contextAttributeValue` property defines the value of the defined CloudEvent [extension context attribute](https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#extension-context-attributes).
35983598

35993599
##### OnEvents Definition
36003600

@@ -3704,7 +3704,7 @@ This is visualized in the diagram below:
37043704
| --- | --- | --- | --- |
37053705
| name | Unique Action name | string | no |
37063706
| [functionRef](#FunctionRef-Definition) | References a reusable function definition | object | yes if `eventRef` & `subFlowRef` are not defined |
3707-
| [eventRef](#EventRef-Definition) | References a `trigger` and `result` reusable event definitions | object | yes if `functionRef` & `subFlowRef` are not defined |
3707+
| [eventRef](#EventRef-Definition) | References a `produce` and `consume` reusable event definitions | object | yes if `functionRef` & `subFlowRef` are not defined |
37083708
| [subFlowRef](#SubFlowRef-Definition) | References a workflow to be invoked | object or string | yes if `eventRef` & `functionRef` are not defined |
37093709
| [retryRef](#retry-definition) | References a defined workflow retry definition. If not defined uses the default runtime retry definition | string | no |
37103710
| nonRetryableErrors | List of references to defined [workflow errors](#Defining Errors) for which the action should not be retried. Used only when `autoRetries` is set to `true` | array | no |
@@ -4111,7 +4111,7 @@ For more information, see the [Workflow Error Handling](#Workflow-Error-Handling
41114111
| --- | --- | --- | --- |
41124112
| name | Unique retry strategy name | string | yes |
41134113
| delay | Time delay between retry attempts (ISO 8601 duration format) | string | no |
4114-
| maxAttempts | Maximum number of retry attempts. Value of 0 means no retries are performed | string or number | no |
4114+
| maxAttempts | Maximum number of retry attempts. Value of 1 means no retries are performed | string or number | no |
41154115
| maxDelay | Maximum amount of delay between retry attempts (ISO 8601 duration format) | string | no |
41164116
| increment | Static duration which will be added to the delay between successive retries (ISO 8601 duration format) | string | no |
41174117
| multiplier | Float value by which the delay is multiplied before each attempt. For example: "1.2" meaning that each successive delay is 20% longer than the previous delay. For example, if delay is 'PT10S', then the delay between the first and second attempts will be 10 seconds, and the delay before the third attempt will be 12 seconds. | float or string | no |
@@ -4521,7 +4521,7 @@ If the start definition is of type `object`, it has the following structure:
45214521
| Parameter | Description | Type | Required |
45224522
| --- | --- | --- | --- |
45234523
| stateName | Name of the starting workflow state | object | no |
4524-
| [schedule](#Schedule-Definition) | Define the recurring time intervals or cron expressions at which workflow instances should be automatically started. | object | yes |
4524+
| [schedule](#Schedule-Definition) | Define the recurring time intervals or cron expressions at which workflow instances should be automatically started. | string or object | yes |
45254525

45264526
<details><summary><strong>Click to view example definition</strong></summary>
45274527
<p>
@@ -4537,7 +4537,7 @@ If the start definition is of type `object`, it has the following structure:
45374537
```json
45384538
{
45394539
"stateName": "MyStartingstate",
4540-
"schedule": "2020-03-20T09:00:00Z/2020-03-20T15:00:00Z"
4540+
"schedule": "2020-03-20T09:00:00Z/PT2H"
45414541
}
45424542
```
45434543

@@ -4546,7 +4546,7 @@ If the start definition is of type `object`, it has the following structure:
45464546

45474547
```yaml
45484548
stateName: MyStartingstate
4549-
schedule: 2020-03-20T09:00:00Z/2020-03-20T15:00:00Z
4549+
schedule: 2020-03-20T09:00:00Z/PT2H
45504550
```
45514551

45524552
</td>
@@ -4666,7 +4666,7 @@ For more information see the [cron definition](#Cron-Definition) section.
46664666

46674667
The `timezone` property is used to define a time zone name to evaluate the cron or interval expression against. If not specified, it should default
46684668
to UTC time zone. See [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for a list of timezone names. For ISO 8601 date time
4669-
values in `interval` or `cron.validUntil`, runtimes should treat `timezone` as the 'local time' (UTC if `interval` is not defined by the user).
4669+
values in `interval` or `cron.validUntil`, runtimes should treat `timezone` as the 'local time' (UTC if `timezone` is not defined by the user).
46704670

46714671
Note that when the workflow starting state is an [Event](#Event-State)
46724672
defining cron-based scheduled starts for the runtime implementations would mean that there needs to be an event service that issues
@@ -5208,7 +5208,7 @@ With this retries option, action executions should be retried automatically for
52085208
errors. This means that you do not have to define a retry strategy for actions for them to have retried, it's included by default.
52095209
Users can still define a custom retry strategy for each action via the `retryRef` property.
52105210

5211-
If a retry strategy is not defained, a default retry strategy should be used.
5211+
If a retry strategy is not defined, a default retry strategy should be used.
52125212
Runtime implementations can define their own default retry strategy. Serverless Workflow recommends the following settings:
52135213

52145214
* `maxAttempts` to be `unlimited`, meaning that the action should be retried indefinitely until successful.
@@ -5612,7 +5612,7 @@ States referenced by `compensatedBy` (as well as any other states that they tran
56125612
* They cannot define an [end definition](#End-definition). If they do, it should be ignored
56135613
* They must define the `usedForCompensation` property and set it to `true`
56145614
* They can transition only to states which also have their `usedForCompensation` property and set to `true`
5615-
* They cannot themselves set their `compensatedBy` property to true (compensation is not recursive)
5615+
* They cannot themselves set their `compensatedBy` property to any state (compensation is not recursive)
56165616

56175617
Runtime implementations should raise compile time / parsing exceptions if any of the rules mentioned above are
56185618
not obeyed in the workflow definition.
@@ -5839,7 +5839,7 @@ When workflow execution encounters our "End" state, compensation has to be perfo
58395839

58405840
1. State "E" is not compensated as it does not define a `compensatedBy` state
58415841
2. State "D" is compensated by executing compensation "D1"
5842-
3. State "B" is compensated by executing "B1" and then "B2"
5842+
3. State "B" is compensated by executing "B1" and then "B1-2"
58435843
4. State C is not compensated as it was never active during workflow execution
58445844
5. State A is not comped as it does not define a `compensatedBy` state
58455845

0 commit comments

Comments
 (0)