Skip to content

Commit

Permalink
Merge branch 'feat-lifecycle-cloud-events' of https://github.com/neur…
Browse files Browse the repository at this point in the history
…oglia-io/serverless-workflow-specification into feat-lifecycle-cloud-events
  • Loading branch information
cdavernas committed Jan 27, 2025
2 parents b4743af + b8ddf92 commit 9db180b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 60 deletions.

This file was deleted.

4 changes: 2 additions & 2 deletions dsl-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1996,9 +1996,9 @@ Represents the configuration of an event consumption strategy.
| Property | Type | Required | Description |
|----------|:----:|:--------:|-------------|
| all | [`eventFilter[]`](#event-filter) | `no` | Configures the workflow to wait for all defined events before resuming execution.<br>*Required if `any` and `one` have not been set.* |
| 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.*<br>*If empty, listens to all incoming events, and requires `until` to be set.* |
| 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.*<br>*If empty, listens to all incoming events* |
| 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.* |
| until | `string`<br>[`eventConsumptionStrategy`](#event-consumption-strategy) | `no` | Configures the [runtime expression](dsl.md#runtime-expressions) condition or the events that must be consumed to stop listening.<br>*Only applies if `any` has been set, otherwise ignored.* |
| until | `string`<br>[`eventConsumptionStrategy`](#event-consumption-strategy) | `no` | Configures the [runtime expression](dsl.md#runtime-expressions) condition or the events that must be consumed to stop listening.<br>*Only applies if `any` has been set, otherwise ignored.*<br>*If not present, once any event is received, it proceeds to the next task.* |

### Event Properties

Expand Down
16 changes: 16 additions & 0 deletions examples/listen-to-any-filter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
document:
dsl: '1.0.0-alpha5'
namespace: test
name: listen-to-any-filter
version: '0.1.0'
do:
- callDoctor:
listen:
to:
any:
- with:
type: com.fake-hospital.vitals.measurements.temperature
data: ${ .temperature > 38 }
- with:
type: com.fake-hospital.vitals.measurements.bpm
data: ${ .bpm < 60 or .bpm > 100 }
8 changes: 1 addition & 7 deletions examples/listen-to-any.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,4 @@ do:
- callDoctor:
listen:
to:
any:
- with:
type: com.fake-hospital.vitals.measurements.temperature
data: ${ .temperature > 38 }
- with:
type: com.fake-hospital.vitals.measurements.bpm
data: ${ .bpm < 60 or .bpm > 100 }
any: []
60 changes: 19 additions & 41 deletions schema/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1325,47 +1325,25 @@ $defs:
$ref: '#/$defs/eventFilter'
required: [ all ]
- title: AnyEventConsumptionStrategy
oneOf:
- properties:
any:
type: array
title: AnyEventConsumptionStrategyConfiguration
description: A list containing any of the events to consume.
items:
$ref: '#/$defs/eventFilter'
minItems: 1
until:
oneOf:
- type: string
title: AnyEventUntilCondition
description: A runtime expression condition evaluated after consuming an event and which determines whether or not to continue listening.
- allOf:
- $ref: '#/$defs/eventConsumptionStrategy'
title: AnyEventUntilConsumed
description: The strategy that defines the event(s) to consume to stop listening.
- properties:
until: false
required: [ any ]
- properties:
any:
type: array
title: AnyEventConsumptionStrategyConfiguration
description: A list containing any of the events to consume.
items:
$ref: '#/$defs/eventFilter'
maxItems: 0
until:
oneOf:
- type: string
title: AnyEventUntilCondition
description: A runtime expression condition evaluated after consuming an event and which determines whether or not to continue listening.
- allOf:
- $ref: '#/$defs/eventConsumptionStrategy'
title: AnyEventUntilConsumed
description: The strategy that defines the event(s) to consume to stop listening.
- properties:
until: false
required: [ any, until ]
properties:
any:
type: array
title: AnyEventConsumptionStrategyConfiguration
description: A list containing any of the events to consume.
items:
$ref: '#/$defs/eventFilter'
until:
oneOf:
- type: string
title: AnyEventUntilCondition
description: A runtime expression condition evaluated after consuming an event and which determines whether or not to continue listening.
- allOf:
- $ref: '#/$defs/eventConsumptionStrategy'
description: The strategy that defines the event(s) to consume to stop listening.
- properties:
until: false
title: AnyEventUntilConsumed
required: [ any ]
- title: OneEventConsumptionStrategy
properties:
one:
Expand Down

0 comments on commit 9db180b

Please sign in to comment.