Skip to content

Commit a19d3a0

Browse files
committed
[Fix #677] Removing useless kind
Signed-off-by: Francisco Javier Tirado Sarti <[email protected]>
1 parent a6d4fb8 commit a19d3a0

File tree

6 files changed

+19
-49
lines changed

6 files changed

+19
-49
lines changed

examples/README_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,6 @@ events:
10911091
- contextAttributeName: accountId
10921092
- name: ConfirmationCompletedEvent
10931093
type: payment.confirmation
1094-
kind: produced
10951094

10961095
```
10971096

examples/event-based-service-invocation.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
{
1010
"name": "make-vet-appointment",
1111
"source": "VetServiceSource",
12-
"type": "events.vet.appointments",
13-
"kind": "produced"
12+
"type": "events.vet.appointments"
1413
},
1514
{
1615
"name": "vet-appointment-info",
1716
"source": "VetServiceSource",
18-
"type": "events.vet.appointments",
19-
"kind": "consumed"
17+
"type": "events.vet.appointments"
2018
}
2119
],
2220
"states": [

examples/purchase-order-deadline.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,11 @@
137137
},
138138
{
139139
"name": "order-finished-event",
140-
"type": "my.company.orders",
141-
"kind": "produced"
140+
"type": "my.company.orders"
142141
},
143142
{
144143
"name": "order-cancelled-event",
145-
"type": "my.company.orders",
146-
"kind": "produced"
144+
"type": "my.company.orders"
147145
}
148146
],
149147
"functions": [

examples/send-cloudevent-on-workflow-completion.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"events": [
88
{
99
"name": "provisioning-complete-event",
10-
"type": "provisionCompleteType",
11-
"kind": "produced"
10+
"type": "provisionCompleteType"
1211
}
1312
],
1413
"functions": [

schema/events.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@
4343
"type": "string",
4444
"description": "CloudEvent type"
4545
},
46-
"kind": {
47-
"type": "string",
48-
"enum": [
49-
"consumed",
50-
"produced"
51-
],
52-
"description": "Defines the CloudEvent as either 'consumed' or 'produced' by the workflow. Default is 'consumed'",
53-
"default": "consumed"
54-
},
5546
"correlation": {
5647
"type": "array",
5748
"description": "CloudEvent correlation definitions",

specification.md

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ in detail in the [Continuing a new Execution](#Continuing-as-a-new-Execution) se
233233
The Serverless Workflow language is composed of:
234234

235235
* [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.
237237
* [Retry definitions](#Retry-Definition) - Reusable retry definitions. Can specify retry strategies for service invocations during workflow execution.
238238
* [Timeout definitions](#Workflow-Timeouts) - Reusable timeout definitions. Can specify default workflow execution timeout, as well as workflow state, action, and branch execution timeouts.
239239
* [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
35033503
| Parameter | Description | Type | Required |
35043504
| --- | --- | --- | --- |
35053505
| 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. |
35073507
| 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 |
35093508
| [correlation](#Correlation-Definition) | Define event correlation rules for this event. Only used for consumed events | array | no |
35103509
| 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 |
35113510
| [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
35263525
"name": "applicant-info",
35273526
"type": "org.application.info",
35283527
"source": "applicationssource",
3529-
"kind": "consumed",
35303528
"correlation": [
35313529
{
35323530
"contextAttributeName": "applicantId"
@@ -3542,7 +3540,6 @@ It's worth noting that if an [auth definition](#Auth-Definition) has been define
35423540
name: applicant-info
35433541
type: org.application.info
35443542
source: applicationssource
3545-
kind: consumed
35463543
correlation:
35473544
- contextAttributeName: applicantId
35483545
```
@@ -3567,14 +3564,6 @@ property of the CloudEvent required attributes.
35673564

35683565
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.
35693566

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-
35783567
Event correlation plays a big role in large event-driven applications. Correlating one or more events with a particular workflow instance
35793568
can be done by defining the event correlation rules within the `correlation` property.
35803569
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
36303619
"name": "heart-rate-reading-event",
36313620
"source": "hospitalMonitorSystem",
36323621
"type": "com.hospital.patient.heartRateMonitor",
3633-
"kind": "consumed",
36343622
"correlation": [
36353623
{
36363624
"contextAttributeName": "patientId"
@@ -3655,7 +3643,6 @@ and we want to make sure that both are correlated, as in the above example, with
36553643
"name": "heart-rate-reading-event",
36563644
"source": "hospitalMonitorSystem",
36573645
"type": "com.hospital.patient.heartRateMonitor",
3658-
"kind": "consumed",
36593646
"correlation": [
36603647
{
36613648
"contextAttributeName": "patientId"
@@ -3666,7 +3653,6 @@ and we want to make sure that both are correlated, as in the above example, with
36663653
"name": "blood-pressure-reading-event",
36673654
"source": "hospitalMonitorSystem",
36683655
"type": "com.hospital.patient.bloodPressureMonitor",
3669-
"kind": "consumed",
36703656
"correlation": [
36713657
{
36723658
"contextAttributeName": "patientId"
@@ -3687,7 +3673,6 @@ on comparing it to custom defined values (string, or expression). For example:
36873673
"name": "heart-rate-reading-event",
36883674
"source": "hospitalMonitorSystem",
36893675
"type": "com.hospital.patient.heartRateMonitor",
3690-
"kind": "consumed",
36913676
"correlation": [
36923677
{
36933678
"contextAttributeName": "patientId"
@@ -3821,7 +3806,7 @@ correlation:
38213806

38223807
</details>
38233808

3824-
Used to define event correlation rules. Only usable for `consumed` event definitions.
3809+
Used to define event correlation rules.
38253810

38263811
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).
38273812
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
39873972
Service invocation can be done in three different ways:
39883973

39893974
* 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.
39923977
* Reference a sub-workflow invocation via the `subFlowRef` property.
39933978

39943979
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.
39973982
The `name` property specifies the action name.
39983983

39993984
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.
40023987

40033988
The `sleep` property can be used to define time periods that workflow execution should sleep
40043989
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
41274112

41284113
##### ProduceEventRef Definition
41294114

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.
41314116

41324117
| Parameter | Description | Type | Required |
41334118
| --- | --- | --- | --- |
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 |
41354120
| 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 |
41364121
| contextAttributes | Add additional event extension context attributes to the trigger/produced event | object | no |
41374122

@@ -4170,7 +4155,7 @@ produceEventRef:
41704155

41714156
</details>
41724157

4173-
References a `produced` [event definitions](#Event-Definition) via the `name` property.
4158+
Publish an [event definition](#Event-Definition) referenced via the `name` property.
41744159

41754160
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
41764161
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.
41844169

41854170
| Parameter | Description | Type | Required |
41864171
| --- | --- | --- | --- |
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 |
41884173
| 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 |
41894174

41904175
<details><summary><strong>Click to view example definition</strong></summary>
@@ -4221,7 +4206,7 @@ eventRef:
42214206

42224207
</details>
42234208

4224-
References a `consumed` [event definitions](#Event-Definition) via the `name` property.
4209+
Consumes an [event definition](#Event-Definition) referenced via the `name` property.
42254210

42264211
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).
42274212
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:
51375122

51385123
Defines the event (CloudEvent format) to be produced when workflow execution completes or during a workflow [transitions](#Transitions).
51395124
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.
51415126

51425127
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
51435128
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.
51605145
Implementers **must** use the unique State `name` property for determining the transition.
51615146

51625147
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).
51645149
For each of the produced events you can select what parts of state data to be the event payload.
51655150

51665151
Transitions can trigger compensation via their `compensate` property. See the [Workflow Compensation](#Workflow-Compensation)

0 commit comments

Comments
 (0)