Skip to content

Commit d7220a2

Browse files
refactor: make for.do an array as well
Signed-off-by: Matthias Pichler <[email protected]>
1 parent e695c2f commit d7220a2

File tree

3 files changed

+25
-21
lines changed

3 files changed

+25
-21
lines changed

dsl-reference.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -560,13 +560,14 @@ do:
560560
at: index
561561
while: .vet != null
562562
do:
563-
listen:
564-
to:
565-
one:
566-
with:
567-
type: com.fake.petclinic.pets.checkup.completed.v2
568-
output:
569-
to: '.pets + [{ "id": $pet.id }]'
563+
- checkFleas:
564+
listen:
565+
to:
566+
one:
567+
with:
568+
type: com.fake.petclinic.pets.checkup.completed.v2
569+
output:
570+
to: '.pets + [{ "id": $pet.id }]'
570571
```
571572

572573
#### Listen

examples/accumulate-room-readings.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ do:
3030
each: reading
3131
in: .readings
3232
do:
33-
call: openapi
34-
with:
35-
document:
36-
uri: http://myorg.io/ordersservices.json
37-
operationId: logreading
33+
- callLogReading:
34+
call: openapi
35+
with:
36+
document:
37+
uri: http://myorg.io/ordersservices.json
38+
operationId: logreading
3839
- generateReport:
3940
call: openapi
4041
with:

schema/workflow.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,7 @@ properties:
7676
description: The workflow's secrets.
7777
description: Defines the workflow's reusable components.
7878
do:
79-
type: array
80-
minItems: 1
81-
items:
82-
type: object
83-
minProperties: 1
84-
maxProperties: 1
85-
additionalProperties:
86-
$ref: '#/$defs/task'
79+
$ref: '#/$defs/do'
8780
description: Defines the tasks the workflow must perform
8881
timeout:
8982
$ref: '#/$defs/timeout'
@@ -108,6 +101,15 @@ properties:
108101
description: Specifies the events that trigger the workflow execution.
109102
description: Schedules the workflow
110103
$defs:
104+
do:
105+
type: array
106+
minItems: 1
107+
items:
108+
type: object
109+
minProperties: 1
110+
maxProperties: 1
111+
additionalProperties:
112+
$ref: '#/$defs/task'
111113
task:
112114
type: object
113115
properties:
@@ -380,7 +382,7 @@ $defs:
380382
type: string
381383
description: A runtime expression that represents the condition, if any, that must be met for the iteration to continue.
382384
do:
383-
$ref: '#/$defs/task'
385+
$ref: '#/$defs/do'
384386
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.
385387
required: [ for, do ]
386388
listenTask:

0 commit comments

Comments
 (0)