Skip to content

Commit 596d992

Browse files
committed
fix cdavernas comments serverlessworkflow#926 (review)
Signed-off-by: Jean-Baptiste Bianchi <[email protected]>
1 parent b5c54f0 commit 596d992

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

dsl-reference.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
+ [Extension](#extension)
4141
+ [Error](#error)
4242
- [Standard Error Types](#standard-error-types)
43-
+ [Event](#event)
4443
+ [Event Consumption Strategy](#event-consumption-strategy)
4544
+ [Event Filter](#event-filter)
45+
+ [Event Properties](#event-properties)
4646
+ [Retry](#retry)
4747
+ [Input](#input)
4848
+ [Output](#output)
@@ -230,9 +230,9 @@ The Serverless Workflow DSL defines a list of [tasks](#task) that **must be** su
230230
- [Call](#call), used to call services and/or functions.
231231
- [Do](#do), used to define one or more subtasks to perform in sequence.
232232
- [Fork](#fork), used to define one or more subtasks to perform concurrently.
233-
- [Emit](#emit), used to emit [events](#event).
233+
- [Emit](#emit), used to emit [events](#event-properties).
234234
- [For](#for), used to iterate over a collection of items, and conditionally perform a task for each of them.
235-
- [Listen](#listen), used to listen for an [event](#event) or more.
235+
- [Listen](#listen), used to listen for an [event](#event-properties) or more.
236236
- [Raise](#raise), used to raise an [error](#error) and potentially fault the [workflow](#workflow).
237237
- [Run](#run), used to run a [container](#container), a [script](#script) or event a [shell](#shell) command.
238238
- [Switch](#switch), used to dynamically select and execute one of multiple alternative paths based on specified conditions
@@ -495,7 +495,7 @@ Allows workflows to publish events to event brokers or messaging systems, facili
495495

496496
| Name | Type | Required | Description |
497497
|:--|:---:|:---:|:---|
498-
| emit.event | [`event`](#event) | `yes` | Defines the event to emit. |
498+
| emit.event | [`eventProperties`](#event-properties) | `yes` | Defines the event to emit. |
499499

500500
##### Examples
501501

@@ -1391,7 +1391,7 @@ Represents the configuration of an event consumption strategy.
13911391
| any | [`eventFilter[]`](#event-filter) | `no` | Configures the workflow to wait for any of the defined events before resuming execution.<br>*Required if `all` and `one` have not been set.* |
13921392
| one | [`eventFilter`](#event-filter) | `no` | Configures the workflow to wait for the defined event before resuming execution.<br>*Required if `all` and `any` have not been set.* |
13931393

1394-
### Event
1394+
### Event Properties
13951395

13961396
An event object typically includes details such as the event type, source, timestamp, and unique identifier, along with any relevant data payload. The [Cloud Events specification](https://cloudevents.io/), favored by Serveless Workflow, standardizes this structure to ensure interoperability across different systems and services.
13971397

@@ -1404,11 +1404,14 @@ An event object typically includes details such as the event type, source, times
14041404
| type | `string` | `no` | Describes the type of event related to the originating occurrence. `source` + `id` is unique for each distinct event.<br>*Required when emitting an event using `emit.event.with`.* |
14051405
| time | `string` | `no` | The timestamp of when the occurrence happened. |
14061406
| subject | `string` | `no` | Describes the subject of the event in the context of the event producer. |
1407-
| datacontenttype | `string` | `no` | Content type of `data` value. If omitted, it implies the `data` is a JSON value confiorming to the "application/json" media type. |
1407+
| datacontenttype | `string` | `no` | Content type of `data` value. If omitted, it implies the `data` is a JSON value conforming to the "application/json" media type. |
14081408
| dataschema | `string` | `no` | An URI that identifies the schema that `data` adheres to. |
14091409
| data | `object` | `no` | The event payload. |
14101410

1411-
Additional properties can be supplied.
1411+
*Additional properties can be supplied.*
1412+
1413+
*When used in an [`eventFilter`](#event-filter), at least one property must be supplied.*
1414+
14121415

14131416
### Event Filter
14141417

@@ -1418,7 +1421,7 @@ An event filter is a mechanism used to selectively process or handle events base
14181421

14191422
| Property | Type | Required | Description |
14201423
|----------|:----:|:--------:|-------------|
1421-
| with | [`event`](#event) | `yes` | A name/value mapping of the attributes filtered events must define. Supports both regular expressions and runtime expressions. |
1424+
| with | [`eventProperties`](#event-properties) | `yes` | A name/value mapping of the attributes filtered events must define. Supports both regular expressions and runtime expressions. |
14221425
| correlate | [`map[string, correlation]`](#correlation) | `no` | A name/definition mapping of the correlations to attempt when filtering events. |
14231426

14241427
### Correlation

schema/workflow.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ $defs:
357357
type: object
358358
properties:
359359
with:
360-
$ref: '#/$defs/event'
360+
$ref: '#/$defs/eventProperties'
361361
required: [ source, type ]
362362
additionalProperties: true
363363
required: [ event ]
@@ -781,7 +781,7 @@ $defs:
781781
$ref: '#/$defs/referenceableAuthenticationPolicy'
782782
description: The authentication policy to use.
783783
required: [ uri ]
784-
event:
784+
eventProperties:
785785
type: object
786786
properties:
787787
id:
@@ -837,7 +837,7 @@ $defs:
837837
properties:
838838
with:
839839
title: WithEvent
840-
$ref: '#/$defs/event'
840+
$ref: '#/$defs/eventProperties'
841841
minProperties: 1
842842
description: An event filter is a mechanism used to selectively process or handle events based on predefined criteria, such as event type, source, or specific attributes.
843843
correlate:

0 commit comments

Comments
 (0)