You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specification.md
+14-29Lines changed: 14 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -233,7 +233,7 @@ in detail in the [Continuing a new Execution](#Continuing-as-a-new-Execution) se
233
233
The Serverless Workflow language is composed of:
234
234
235
235
*[Function definitions](#Function-Definition) - Reusable functions that can declare services that need to be invoked, or expressions to be evaluated.
236
-
*[Event definitions](#Event-Definition) - Reusable declarations of events that need to be `consumed` to start or continue workflow instances, trigger function/service execution, or be `produced` during workflow execution.
236
+
*[Event definitions](#Event-Definition) - Reusable declarations of events that need to be consumed to start or continue workflow instances, trigger function/service execution, or be produced during workflow execution.
237
237
*[Retry definitions](#Retry-Definition) - Reusable retry definitions. Can specify retry strategies for service invocations during workflow execution.
238
238
*[Timeout definitions](#Workflow-Timeouts) - Reusable timeout definitions. Can specify default workflow execution timeout, as well as workflow state, action, and branch execution timeouts.
239
239
*[Errors definition](#Defining-Errors) - Reusable error definitions. Provide domain-specific error definitions which can be referenced in workflow states error handling.
@@ -3503,9 +3503,8 @@ It's worth noting that if an [auth definition](#Auth-Definition) has been define
3503
3503
| Parameter | Description | Type | Required |
3504
3504
| --- | --- | --- | --- |
3505
3505
| name | Unique event name. Must follow the [Serverless Workflow Naming Convention](#naming-convention) | string | yes |
3506
-
| source | CloudEvent source. If not set when `kind` is `produced`, runtimes are expected to use a default value, such as https://serverlessworkflow.io in order to comply with the [CloudEvent spec constraints](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1))| string | yes (if `type` is not defined. |
3506
+
| source | CloudEvent source. If not set when producing an event, runtimes are expected to use a default value, such as https://serverlessworkflow.io in order to comply with the [CloudEvent spec constraints](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1))| string | yes (if `type` is not defined. |
3507
3507
| type | CloudEvent type | string | yes (if `source` is not defined) |
3508
-
| kind | Defines the event is either `consumed` or `produced` by the workflow. Default is `consumed` | enum | no |
3509
3508
| [correlation](#Correlation-Definition) | Define event correlation rules for this event. Only used for consumed events | array | no |
3510
3509
| dataOnly | If `true` (default value), only the Event payload is accessible to consuming Workflow states. If `false`, both event payload and context attributes should be accessible | boolean | no |
3511
3510
| [metadata](#Workflow-Metadata) | Metadata information | object | no |
@@ -3526,7 +3525,6 @@ It's worth noting that if an [auth definition](#Auth-Definition) has been define
3526
3525
"name": "applicant-info",
3527
3526
"type": "org.application.info",
3528
3527
"source": "applicationssource",
3529
-
"kind": "consumed",
3530
3528
"correlation": [
3531
3529
{
3532
3530
"contextAttributeName": "applicantId"
@@ -3542,7 +3540,6 @@ It's worth noting that if an [auth definition](#Auth-Definition) has been define
3542
3540
name: applicant-info
3543
3541
type: org.application.info
3544
3542
source: applicationssource
3545
-
kind: consumed
3546
3543
correlation:
3547
3544
- contextAttributeName: applicantId
3548
3545
```
@@ -3567,14 +3564,6 @@ property of the CloudEvent required attributes.
3567
3564
3568
3565
The `type` property matches this event definition with the [type](https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#type) property of the CloudEvent required attributes.
3569
3566
3570
-
The `kind` property defines this event as either `consumed` or `produced`. In terms of the workflow, this means it is either an event
3571
-
that triggers workflow instance creation, or continuation of workflow instance execution (consumed), or an event
3572
-
that the workflow instance creates during its execution (produced).
3573
-
The default value (if not specified) of the `kind` property is `consumed`.
3574
-
Note that for `produced` event definitions, implementations must provide the value of the CloudEvent source attribute.
3575
-
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.
3576
-
Otherwise, (i.e., when the `kind` property is set to `consumed`), the `source` property must be defined in the event definition.
3577
-
3578
3567
Event correlation plays a big role in large event-driven applications. Correlating one or more events with a particular workflow instance
3579
3568
can be done by defining the event correlation rules within the `correlation` property.
3580
3569
This property is an array of [correlation](#Correlation-Definition) definitions.
@@ -3630,7 +3619,6 @@ type that have the **same** value of the `patientId` property to be correlated t
3630
3619
"name": "heart-rate-reading-event",
3631
3620
"source": "hospitalMonitorSystem",
3632
3621
"type": "com.hospital.patient.heartRateMonitor",
3633
-
"kind": "consumed",
3634
3622
"correlation": [
3635
3623
{
3636
3624
"contextAttributeName": "patientId"
@@ -3655,7 +3643,6 @@ and we want to make sure that both are correlated, as in the above example, with
3655
3643
"name": "heart-rate-reading-event",
3656
3644
"source": "hospitalMonitorSystem",
3657
3645
"type": "com.hospital.patient.heartRateMonitor",
3658
-
"kind": "consumed",
3659
3646
"correlation": [
3660
3647
{
3661
3648
"contextAttributeName": "patientId"
@@ -3666,7 +3653,6 @@ and we want to make sure that both are correlated, as in the above example, with
@@ -3687,7 +3673,6 @@ on comparing it to custom defined values (string, or expression). For example:
3687
3673
"name": "heart-rate-reading-event",
3688
3674
"source": "hospitalMonitorSystem",
3689
3675
"type": "com.hospital.patient.heartRateMonitor",
3690
-
"kind": "consumed",
3691
3676
"correlation": [
3692
3677
{
3693
3678
"contextAttributeName": "patientId"
@@ -3821,7 +3806,7 @@ correlation:
3821
3806
3822
3807
</details>
3823
3808
3824
-
Used to define event correlation rules. Only usable for `consumed` event definitions.
3809
+
Used to define event correlation rules.
3825
3810
3826
3811
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).
3827
3812
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).
@@ -3987,8 +3972,8 @@ Actions specify invocations of services or other workflows during workflow execu
3987
3972
Service invocation can be done in three different ways:
3988
3973
3989
3974
* Reference [functions definitions](#Function-Definition) by its unique name using the `functionRef` property.
3990
-
* Reference a `produced` [event definitions](#Event-Definition) via the `produceEventRef` property.
3991
-
* Reference a `consumed` [event definitions](#Event-Definition) via the `consumeEventRef` property.
3975
+
* Reference a [event definitions](#Event-Definition) via the `produceEventRef` property in order to publish that event.
3976
+
* Reference a [event definitions](#Event-Definition) via the `consumeEventRef` property in order to consume that event.
3992
3977
* Reference a sub-workflow invocation via the `subFlowRef` property.
3993
3978
3994
3979
Note that `functionRef`, `eventRef`, and `subFlowRef` are mutually exclusive, meaning that only one of them can be
@@ -3997,8 +3982,8 @@ specified in a single action definition.
3997
3982
The `name` property specifies the action name.
3998
3983
3999
3984
In the event-based scenario a service, or a set of services we want to invoke are not exposed via a specific resource URI for example, but can only be invoked via an event.
4000
-
In that case, a `produced` event might be referenced via its `produceEventRef` property.
4001
-
Also, if there is the need to consume an event within a set of actions (for example, wait for the result of a previous action invocation) a `consumed` event might be referenced via its `consumeEventRef` property.
3985
+
In that case, an event definition might be referenced via its `produceEventRef` property.
3986
+
Also, if there is the need to consume an event within a set of actions (for example, wait for the result of a previous action invocation) an event definition might be referenced via its `consumeEventRef` property.
4002
3987
4003
3988
The `sleep` property can be used to define time periods that workflow execution should sleep
4004
3989
before and/or after function execution. It can have two properties:
@@ -4127,11 +4112,11 @@ onErrors definition. Note that errors raised during functions that are invoked a
4127
4112
4128
4113
##### ProduceEventRef Definition
4129
4114
4130
-
Publish an event. It references the unique name of a `produced` event definition. Must follow the [Serverless Workflow Naming Convention](#naming-convention)
4115
+
Publish an event.
4131
4116
4132
4117
| Parameter | Description | Type | Required |
4133
4118
| --- | --- | --- | --- |
4134
-
| [name](#Event-Definition) | Reference to the unique name of a `produced` event definition. Must follow the [Serverless Workflow Naming Convention](#naming-convention) | string | yes |
4119
+
| [name](#Event-Definition) | Reference to the unique name of an event definition. Must follow the [Serverless Workflow Naming Convention](#naming-convention) | string | yes |
4135
4120
| data | If string type, an expression which selects parts of the states data output to become the data (payload) of the event referenced by `produceEventRef`. If object type, a custom object to become the data (payload) of the event referenced by `produceEventRef`. | string or object | yes |
4136
4121
| contextAttributes | Add additional event extension context attributes to the trigger/produced event | object | no |
4137
4122
@@ -4170,7 +4155,7 @@ produceEventRef:
4170
4155
4171
4156
</details>
4172
4157
4173
-
References a `produced` [event definitions](#Event-Definition) via the `name` property.
4158
+
Publish an [event definition](#Event-Definition) referenced via the `name` property.
4174
4159
4175
4160
The `data` property can have two types: string or object. If it is of string type, it is an expression that can select parts of state data
4176
4161
to be used as payload of the event referenced by `produceEventRef`. If it is of object type, you can define a custom object to be the event payload.
@@ -4184,7 +4169,7 @@ Wait for an event to arrive.
4184
4169
4185
4170
| Parameter | Description | Type | Required |
4186
4171
| --- | --- | --- | --- |
4187
-
| [name](#Event-Definition) | Reference to the unique name of a `consumed` event definition. Must follow the [Serverless Workflow Naming Convention](#naming-convention) | string | yes |
4172
+
| [name](#Event-Definition) | Reference to the unique name of an event definition. Must follow the [Serverless Workflow Naming Convention](#naming-convention) | string | yes |
4188
4173
| consumeEventTimeout | Maximum amount of time (ISO 8601 format literal or expression) to wait for the consume event. If not defined it be set to the [actionExecutionTimeout](#Workflow-Timeout-Definition) | string | no |
4189
4174
4190
4175
<details><summary><strong>Click to view example definition</strong></summary>
@@ -4221,7 +4206,7 @@ eventRef:
4221
4206
4222
4207
</details>
4223
4208
4224
-
References a `consumed` [event definitions](#Event-Definition) via the `name` property.
4209
+
Consumes an [event definition](#Event-Definition) referenced via the `name` property.
4225
4210
4226
4211
The `consumeEventTimeout` property defines the maximum amount of time (ISO 8601 format literal or expression) to wait for the result event. If not defined it should default to the [actionExecutionTimeout](#Workflow-Timeout-Definition).
4227
4212
If the event defined by the `name` property is not received in that set time, action invocation should raise an error that can be handled in the states `onErrors` definition.
@@ -5137,7 +5122,7 @@ contextAttributes:
5137
5122
5138
5123
Defines the event (CloudEvent format) to be produced when workflow execution completes or during a workflow [transitions](#Transitions).
5139
5124
The `eventRef` property must match the name of
5140
-
one of the defined `produced` events in the [events](#Event-Definition) definition.
5125
+
one of the defined events in the [events](#Event-Definition) definition.
5141
5126
5142
5127
The `data` property can have two types, object or string. If of string type, it is an expression that can select parts of state data
5143
5128
to be used as the event payload. If of object type, you can define a custom object to be the event payload.
@@ -5160,7 +5145,7 @@ state to transition to next.
5160
5145
Implementers **must** use the unique State `name` property for determining the transition.
5161
5146
5162
5147
Events can be produced during state transitions. The `produceEvents` property of the `transition` definitions allows you
5163
-
to reference one or more defined `produced` events in the workflow [events definitions](#Event-Definition).
5148
+
to reference one or more defined events in the workflow [events definitions](#Event-Definition).
5164
5149
For each of the produced events you can select what parts of state data to be the event payload.
5165
5150
5166
5151
Transitions can trigger compensation via their `compensate` property. See the [Workflow Compensation](#Workflow-Compensation)
0 commit comments