Skip to content

Commit 3e7ba14

Browse files
fjtiradocdavernas
andauthored
[Fix #1071] Until option if any is empty (#1072)
* [Fix #1071] Until option if any is empty Fix #1071 Signed-off-by: Francisco Javier Tirado Sarti <ftirados@redhat.com> * [Fix_#1071] Incorporating comments Signed-off-by: Francisco Javier Tirado Sarti <ftirados@redhat.com> * Update dsl-reference.md Co-authored-by: Charles d'Avernas <charles.davernas@neuroglia.io> Signed-off-by: Francisco Javier Tirado Sarti <ftirados@redhat.com> --------- Signed-off-by: Francisco Javier Tirado Sarti <ftirados@redhat.com> Co-authored-by: Charles d'Avernas <charles.davernas@neuroglia.io>
1 parent be474b2 commit 3e7ba14

File tree

5 files changed

+38
-60
lines changed

5 files changed

+38
-60
lines changed

.ci/validation/test/fixtures/invalid/listen-any-empty-no-until.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

dsl-reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,9 +1591,9 @@ Represents the configuration of an event consumption strategy.
15911591
| Property | Type | Required | Description |
15921592
|----------|:----:|:--------:|-------------|
15931593
| 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.* |
1594-
| 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.* |
1594+
| 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* |
15951595
| 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.* |
1596-
| 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.* |
1596+
| 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.* |
15971597

15981598
### Event Properties
15991599

examples/listen-to-any-filter.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
document:
2+
dsl: '1.0.0-alpha5'
3+
namespace: test
4+
name: listen-to-any-filter
5+
version: '0.1.0'
6+
do:
7+
- callDoctor:
8+
listen:
9+
to:
10+
any:
11+
- with:
12+
type: com.fake-hospital.vitals.measurements.temperature
13+
data: ${ .temperature > 38 }
14+
- with:
15+
type: com.fake-hospital.vitals.measurements.bpm
16+
data: ${ .bpm < 60 or .bpm > 100 }

examples/listen-to-any.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,4 @@ do:
77
- callDoctor:
88
listen:
99
to:
10-
any:
11-
- with:
12-
type: com.fake-hospital.vitals.measurements.temperature
13-
data: ${ .temperature > 38 }
14-
- with:
15-
type: com.fake-hospital.vitals.measurements.bpm
16-
data: ${ .bpm < 60 or .bpm > 100 }
10+
any: []

schema/workflow.yaml

Lines changed: 19 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,47 +1325,25 @@ $defs:
13251325
$ref: '#/$defs/eventFilter'
13261326
required: [ all ]
13271327
- title: AnyEventConsumptionStrategy
1328-
oneOf:
1329-
- properties:
1330-
any:
1331-
type: array
1332-
title: AnyEventConsumptionStrategyConfiguration
1333-
description: A list containing any of the events to consume.
1334-
items:
1335-
$ref: '#/$defs/eventFilter'
1336-
minItems: 1
1337-
until:
1338-
oneOf:
1339-
- type: string
1340-
title: AnyEventUntilCondition
1341-
description: A runtime expression condition evaluated after consuming an event and which determines whether or not to continue listening.
1342-
- allOf:
1343-
- $ref: '#/$defs/eventConsumptionStrategy'
1344-
title: AnyEventUntilConsumed
1345-
description: The strategy that defines the event(s) to consume to stop listening.
1346-
- properties:
1347-
until: false
1348-
required: [ any ]
1349-
- properties:
1350-
any:
1351-
type: array
1352-
title: AnyEventConsumptionStrategyConfiguration
1353-
description: A list containing any of the events to consume.
1354-
items:
1355-
$ref: '#/$defs/eventFilter'
1356-
maxItems: 0
1357-
until:
1358-
oneOf:
1359-
- type: string
1360-
title: AnyEventUntilCondition
1361-
description: A runtime expression condition evaluated after consuming an event and which determines whether or not to continue listening.
1362-
- allOf:
1363-
- $ref: '#/$defs/eventConsumptionStrategy'
1364-
title: AnyEventUntilConsumed
1365-
description: The strategy that defines the event(s) to consume to stop listening.
1366-
- properties:
1367-
until: false
1368-
required: [ any, until ]
1328+
properties:
1329+
any:
1330+
type: array
1331+
title: AnyEventConsumptionStrategyConfiguration
1332+
description: A list containing any of the events to consume.
1333+
items:
1334+
$ref: '#/$defs/eventFilter'
1335+
until:
1336+
oneOf:
1337+
- type: string
1338+
title: AnyEventUntilCondition
1339+
description: A runtime expression condition evaluated after consuming an event and which determines whether or not to continue listening.
1340+
- allOf:
1341+
- $ref: '#/$defs/eventConsumptionStrategy'
1342+
description: The strategy that defines the event(s) to consume to stop listening.
1343+
- properties:
1344+
until: false
1345+
title: AnyEventUntilConsumed
1346+
required: [ any ]
13691347
- title: OneEventConsumptionStrategy
13701348
properties:
13711349
one:

0 commit comments

Comments
 (0)