Skip to content

Commit 996941d

Browse files
author
Tihomir Surdilovic
authored
Updating data filters (#278)
* Updating data filters Signed-off-by: Tihomir Surdilovic <[email protected]> * fix sentence Signed-off-by: Tihomir Surdilovic <[email protected]> * fix sentence Signed-off-by: Tihomir Surdilovic <[email protected]> * fix sentence Signed-off-by: Tihomir Surdilovic <[email protected]> * fix sentence Signed-off-by: Tihomir Surdilovic <[email protected]> * fixes per Ricardos comments Signed-off-by: Tihomir Surdilovic <[email protected]> * fixes per Ricardos comments Signed-off-by: Tihomir Surdilovic <[email protected]> * Fixes per Jorgens comments Signed-off-by: Tihomir Surdilovic <[email protected]> * Fixes per Jorgens comments Signed-off-by: Tihomir Surdilovic <[email protected]> * Fixes per Jorgens comments Signed-off-by: Tihomir Surdilovic <[email protected]>
1 parent dfc7de7 commit 996941d

12 files changed

+2806
-2530
lines changed

comparisons/comparison-argo.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ states:
404404
actions:
405405
- functionRef: gen-random-int-bash
406406
actionDataFilter:
407-
dataResultsPath: "${ .results }"
407+
results: "${ .results }"
408408
transition: print-message
409409
- name: print-message
410410
type: operation
@@ -581,7 +581,7 @@ states:
581581
actions:
582582
- functionRef: flip-coin-function
583583
actionDataFilter:
584-
dataResultsPath: "${ .flip.result }"
584+
results: "${ .flip.result }"
585585
transition: show-flip-results
586586
- name: show-flip-results
587587
type: switch
@@ -595,14 +595,14 @@ states:
595595
actions:
596596
- functionRef: echo
597597
actionDataFilter:
598-
dataResultsPath: it was heads
598+
results: it was heads
599599
end: true
600600
- name: show-results-tails
601601
type: operation
602602
actions:
603603
- functionRef: echo
604604
actionDataFilter:
605-
dataResultsPath: it was tails
605+
results: it was tails
606606
end: true
607607
```
608608
@@ -761,7 +761,7 @@ states:
761761
actions:
762762
- functionRef: flip-coin-function
763763
actionDataFilter:
764-
dataResultsPath: "${ .steps.flip-coin.outputs.result }"
764+
results: "${ .steps.flip-coin.outputs.result }"
765765
transition: flip-coin-check
766766
- name: flip-coin-check
767767
type: switch

comparisons/comparison-brigade.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ states:
403403
- eventRefs:
404404
- execEvent
405405
eventDataFilter:
406-
dataOutputPath: "${ .event }"
406+
results: "${ .event }"
407407
actions:
408408
- name: eventInfoAction
409409
functionRef:
@@ -484,18 +484,18 @@ states:
484484
- eventRefs:
485485
- execEvent
486486
eventDataFilter:
487-
dataOutputPath: "${ .event }"
487+
data: "${ .event }"
488488
actions:
489489
- name: helloAction
490490
actionDataFilter:
491-
dataResultsPath: "${ .helloResult }"
491+
results: "${ .helloResult }"
492492
functionRef:
493493
refName: greetingFunction
494494
arguments:
495495
message: hello
496496
- name: worldAction
497497
actionDataFilter:
498-
dataResultsPath: "${ .worldResults }"
498+
results: "${ .worldResults }"
499499
functionRef:
500500
refName: greetingAction
501501
arguments:
@@ -572,7 +572,7 @@ states:
572572
- execEvent
573573
actions: []
574574
eventDataFilter:
575-
dataOutputPath: "${ .execEvent }"
575+
data: "${ .execEvent }"
576576
transition:
577577
nextState: NextEventState
578578
produceEvents:
@@ -590,7 +590,7 @@ states:
590590
- eventRefs:
591591
- nextEvent
592592
eventDataFilter:
593-
dataOutputPath: "${ .nextEvent }"
593+
data: "${ .nextEvent }"
594594
actions:
595595
- name: consoleLogAction
596596
functionRef:

comparisons/comparison-cadence.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ states:
201201
arguments:
202202
filename: "${ .file.name }"
203203
actionDataFilter:
204-
dataResultsPath: "${ .processed }"
204+
results: "${ .processed }"
205205
- functionRef:
206206
refName: uploadfunction
207207
arguments:

comparisons/comparison-google-cloud-workflows.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ languages.
9595
"outputVar": "Hello ${ .firstname + \" \" + .lastname }"
9696
},
9797
"stateDataFilter": {
98-
"dataOutputPath": "${ .outputVar }"
98+
"output": "${ .outputVar }"
9999
},
100100
"end": true
101101
}
@@ -206,7 +206,7 @@ instance is created. See the Serverless Workflow ["Workflow Data"](../specificat
206206
]
207207
},
208208
"stateDataFilter": {
209-
"dataOutputPath": "${ .array | join(\"\") }"
209+
"output": "${ .array | join(\"\") }"
210210
},
211211
"end": true
212212
}

examples/README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Which is added to the states data and becomes the workflow data output.
166166
}
167167
},
168168
"actionDataFilter": {
169-
"dataResultsPath": "${ .greeting }"
169+
"results": "${ .greeting }"
170170
}
171171
}
172172
],
@@ -197,7 +197,7 @@ states:
197197
arguments:
198198
name: "${ .person.name }"
199199
actionDataFilter:
200-
dataResultsPath: "${ .greeting }"
200+
results: "${ .greeting }"
201201
end: true
202202
```
203203
@@ -243,20 +243,20 @@ Note that in the workflow definition you can see two filters defined. The event
243243
```json
244244
{
245245
"eventDataFilter": {
246-
"dataOutputPath": "${ .data.greet } "
246+
"data": "${ .data.greet } "
247247
}
248248
}
249249
```
250250

251-
which is triggered when the greeting event is consumed. It extracts its "data.greet" of the event and
252-
merges it with the states data.
251+
which is triggered when the greeting event is consumed. It extracts its "data.greet" of the event data (payload) and
252+
merges it with the state data.
253253

254254
The second, a state data filter, which is defined on the event state itself:
255255

256256
```json
257257
{
258258
"stateDataFilter": {
259-
"dataOutputPath": "${ .payload.greeting }"
259+
"output": "${ .payload.greeting }"
260260
}
261261
}
262262
```
@@ -310,7 +310,7 @@ filters what is selected to be the state data output which then becomes the work
310310
"onEvents": [{
311311
"eventRefs": ["GreetingEvent"],
312312
"eventDataFilter": {
313-
"dataOutputPath": "${ .data.greet }"
313+
"data": "${ .data.greet }"
314314
},
315315
"actions":[
316316
{
@@ -324,7 +324,7 @@ filters what is selected to be the state data output which then becomes the work
324324
]
325325
}],
326326
"stateDataFilter": {
327-
"dataOutputPath": "${ .payload.greeting }"
327+
"output": "${ .payload.greeting }"
328328
},
329329
"end": true
330330
}
@@ -355,14 +355,14 @@ states:
355355
- eventRefs:
356356
- GreetingEvent
357357
eventDataFilter:
358-
dataOutputPath: "${ .data.greet }"
358+
data: "${ .data.greet }"
359359
actions:
360360
- functionRef:
361361
refName: greetingFunction
362362
arguments:
363363
name: "${ .greet.name }"
364364
stateDataFilter:
365-
dataOutputPath: "${ .payload.greeting }"
365+
output: "${ .payload.greeting }"
366366
end: true
367367
```
368368
@@ -438,7 +438,7 @@ result of the workflow execution.
438438
}
439439
],
440440
"stateDataFilter": {
441-
"dataOutputPath": "${ .results }"
441+
"output": "${ .results }"
442442
},
443443
"end": true
444444
}
@@ -470,7 +470,7 @@ states:
470470
arguments:
471471
expression: "${ .singleexpression }"
472472
stateDataFilter:
473-
dataOutputPath: "${ .results }"
473+
output: "${ .results }"
474474
end: true
475475
```
476476
@@ -892,7 +892,7 @@ The data output of the workflow contains the information of the exception caught
892892
}
893893
],
894894
"stateDataFilter": {
895-
"dataOutputPath": "${ .exceptions }"
895+
"output": "${ .exceptions }"
896896
},
897897
"transition": "ApplyOrder",
898898
"onErrors": [
@@ -960,7 +960,7 @@ states:
960960
arguments:
961961
order: "${ .order }"
962962
stateDataFilter:
963-
dataOutputPath: "${ .exceptions }"
963+
output: "${ .exceptions }"
964964
transition: ApplyOrder
965965
onErrors:
966966
- error: Missing order id
@@ -1060,7 +1060,7 @@ In the case job submission raises a runtime error, we transition to a SubFlow st
10601060
}
10611061
},
10621062
"actionDataFilter": {
1063-
"dataResultsPath": "${ .jobuid }"
1063+
"results": "${ .jobuid }"
10641064
}
10651065
}
10661066
],
@@ -1071,7 +1071,7 @@ In the case job submission raises a runtime error, we transition to a SubFlow st
10711071
}
10721072
],
10731073
"stateDataFilter": {
1074-
"dataOutputPath": "${ .jobuid }"
1074+
"output": "${ .jobuid }"
10751075
},
10761076
"transition": "WaitForCompletion'"
10771077
},
@@ -1100,12 +1100,12 @@ In the case job submission raises a runtime error, we transition to a SubFlow st
11001100
}
11011101
},
11021102
"actionDataFilter": {
1103-
"dataResultsPath": "${ .jobstatus }"
1103+
"results": "${ .jobstatus }"
11041104
}
11051105
}
11061106
],
11071107
"stateDataFilter": {
1108-
"dataOutputPath": "${ .jobstatus }"
1108+
"output": "${ .jobstatus }"
11091109
},
11101110
"transition": "DetermineCompletion"
11111111
},
@@ -1190,12 +1190,12 @@ states:
11901190
arguments:
11911191
name: "${ .job.name }"
11921192
actionDataFilter:
1193-
dataResultsPath: "${ .jobuid }"
1193+
results: "${ .jobuid }"
11941194
onErrors:
11951195
- error: "*"
11961196
transition: SubmitError
11971197
stateDataFilter:
1198-
dataOutputPath: "${ .jobuid }"
1198+
output: "${ .jobuid }"
11991199
transition: WaitForCompletion
12001200
- name: SubmitError
12011201
type: subflow
@@ -1214,9 +1214,9 @@ states:
12141214
arguments:
12151215
name: "${ .jobuid }"
12161216
actionDataFilter:
1217-
dataResultsPath: "${ .jobstatus }"
1217+
results: "${ .jobstatus }"
12181218
stateDataFilter:
1219-
dataOutputPath: "${ .jobstatus }"
1219+
output: "${ .jobstatus }"
12201220
transition: DetermineCompletion
12211221
- name: DetermineCompletion
12221222
type: switch
@@ -2358,7 +2358,7 @@ For this example we assume that the workflow instance is started given the follo
23582358
"resultEventRef": "VetAppointmentInfo"
23592359
},
23602360
"actionDataFilter": {
2361-
"dataResultsPath": "${ .appointmentInfo }"
2361+
"results": "${ .appointmentInfo }"
23622362
},
23632363
"timeout": "PT15M"
23642364
}
@@ -2395,7 +2395,7 @@ states:
23952395
data: "${ .patientInfo }"
23962396
resultEventRef: VetAppointmentInfo
23972397
actionDataFilter:
2398-
dataResultsPath: "${ .appointmentInfo }"
2398+
results: "${ .appointmentInfo }"
23992399
timeout: PT15M
24002400
end: true
24012401
```
@@ -3126,7 +3126,7 @@ the data for an hour, send report, and so on.
31263126
}
31273127
],
31283128
"eventDataFilter": {
3129-
"dataOutputPath": "${ .readings }"
3129+
"data": "${ .readings }"
31303130
}
31313131
}
31323132
],
@@ -3208,7 +3208,7 @@ states:
32083208
- functionRef:
32093209
refName: LogReading
32103210
eventDataFilter:
3211-
dataOutputPath: "${ .readings }"
3211+
data: "${ .readings }"
32123212
end: true
32133213
- name: GenerateReport
32143214
type: operation
-6.49 KB
Loading
-4.11 KB
Loading
-12.2 KB
Loading

media/spec/workflowdataflow.png

223 KB
Loading

roadmap/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ _Status description:_
3838
| ✔️| Replace JsonPath with jq | [spec doc](../specification.md) |
3939
| ✔️| Update start definition (move to top-level worklow param) | [spec doc](../specification.md) |
4040
| ✔️| Updated schedule definition | [spec doc](../specification.md) |
41+
| ✔️| Update data filters | [spec doc](../specification.md) |
4142
| 🚩 | Workflow invocation bindings | |
4243
| 🚩 | CE Subscriptions & Discovery | |
4344
| 🚩 | Error types | [issue](https://github.com/serverlessworkflow/specification/issues/200) |

0 commit comments

Comments
 (0)