-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a new until
property to any
event consumption strategies
#997
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
document: | ||
dsl: '1.0.0-alpha1' | ||
namespace: test | ||
name: listen-to-any | ||
version: '0.1.0' | ||
do: | ||
- callDoctor: | ||
listen: | ||
to: | ||
any: [] | ||
until: ( . | length ) > 3 #wait until 3 events have been consumed |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
document: | ||
dsl: '1.0.0-alpha1' | ||
namespace: test | ||
name: listen-to-any | ||
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 } | ||
until: | ||
one: | ||
with: | ||
type: com.fake-hospital.patient.checked-out |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1196,14 +1196,41 @@ $defs: | |
$ref: '#/$defs/eventFilter' | ||
required: [ all ] | ||
- title: AnyEventConsumptionStrategy | ||
properties: | ||
any: | ||
type: array | ||
title: AnyEventConsumptionStrategyConfiguration | ||
description: A list containing any of the events to consume. | ||
items: | ||
$ref: '#/$defs/eventFilter' | ||
required: [ any ] | ||
oneOf: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of a |
||
- 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. | ||
- $ref: '#/$defs/eventConsumptionStrategy' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I understood correctly, we would have to create a new There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Precisely!!! |
||
title: AnyEventUntilConsumed | ||
description: The strategy that defines the event(s) to consume to stop listening. | ||
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. | ||
- $ref: '#/$defs/eventConsumptionStrategy' | ||
title: AnyEventUntilConsumed | ||
description: The strategy that defines the event(s) to consume to stop listening. | ||
required: [ any, until ] | ||
- title: OneEventConsumptionStrategy | ||
properties: | ||
one: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we should test the schema by adding a failing example (under .ci/validation/test/fixtures/failing) where
any
is empty anduntil
missing