Skip to content

Commit

Permalink
refactor: make for.do an array as well
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
  • Loading branch information
matthias-pichler committed Jun 4, 2024
1 parent 3376925 commit 119b7b8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
15 changes: 8 additions & 7 deletions dsl-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -560,13 +560,14 @@ do:
at: index
while: .vet != null
do:
listen:
to:
one:
with:
type: com.fake.petclinic.pets.checkup.completed.v2
output:
to: '.pets + [{ "id": $pet.id }]'
- checkFleas:
listen:
to:
one:
with:
type: com.fake.petclinic.pets.checkup.completed.v2
output:
to: '.pets + [{ "id": $pet.id }]'
```

#### Listen
Expand Down
11 changes: 6 additions & 5 deletions examples/accumulate-room-readings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ do:
each: reading
in: .readings
do:
call: openapi
with:
document:
uri: http://myorg.io/ordersservices.json
operationId: logreading
- callLogReading:
call: openapi
with:
document:
uri: http://myorg.io/ordersservices.json
operationId: logreading
- generateReport:
call: openapi
with:
Expand Down
20 changes: 11 additions & 9 deletions schema/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,7 @@ properties:
description: The workflow's secrets.
description: Defines the workflow's reusable components.
do:
type: array
minItems: 1
items:
type: object
minProperties: 1
maxProperties: 1
additionalProperties:
$ref: '#/$defs/task'
$ref: '#/$defs/do'
description: Defines the tasks the workflow must perform
timeout:
$ref: '#/$defs/timeout'
Expand All @@ -108,6 +101,15 @@ properties:
description: Specifies the events that trigger the workflow execution.
description: Schedules the workflow
$defs:
do:
type: array
minItems: 1
items:
type: object
minProperties: 1
maxProperties: 1
additionalProperties:
$ref: '#/$defs/task'
task:
type: object
properties:
Expand Down Expand Up @@ -380,7 +382,7 @@ $defs:
type: string
description: A runtime expression that represents the condition, if any, that must be met for the iteration to continue.
do:
$ref: '#/$defs/task'
$ref: '#/$defs/do'
description: Allows workflows to iterate over a collection of items, executing a defined set of subtasks for each item in the collection. This task type is instrumental in handling scenarios such as batch processing, data transformation, and repetitive operations across datasets.
required: [ for, do ]
listenTask:
Expand Down

0 comments on commit 119b7b8

Please sign in to comment.