Skip to content

Simplify data filter property names #702

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 37 additions & 37 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Which is added to the states data and becomes the workflow data output.
"name": "${ .person.name }"
}
},
"actionDataFilter": {
"dataFilter": {
"results": "${ {greeting: .greeting} }"
}
}
Expand Down Expand Up @@ -206,7 +206,7 @@ states:
refName: greetingFunction
arguments:
name: "${ .person.name }"
actionDataFilter:
dataFilter:
results: "${ {greeting: .greeting} }"
end: true
```
Expand Down Expand Up @@ -252,7 +252,7 @@ Note that in the workflow definition you can see two filters defined. The event

```json
{
"eventDataFilter": {
"dataFilter": {
"data": "${ .data.greet } "
}
}
Expand All @@ -265,7 +265,7 @@ The second, a state data filter, which is defined on the event state itself:

```json
{
"stateDataFilter": {
"dataFilter": {
"output": "${ .payload.greeting }"
}
}
Expand Down Expand Up @@ -320,7 +320,7 @@ filters what is selected to be the state data output which then becomes the work
"type":"event",
"onEvents": [{
"eventRefs": ["GreetingEvent"],
"eventDataFilter": {
"dataFilter": {
"data": "${ .greet }",
"toStateData": "${ .greet }"
},
Expand All @@ -335,7 +335,7 @@ filters what is selected to be the state data output which then becomes the work
}
]
}],
"stateDataFilter": {
"dataFilter": {
"output": "${ .payload.greeting }"
},
"end": true
Expand Down Expand Up @@ -367,15 +367,15 @@ states:
onEvents:
- eventRefs:
- GreetingEvent
eventDataFilter:
dataFilter:
data: "${ .greet }"
toStateData: "${ .greet }"
actions:
- functionRef:
refName: greetingFunction
arguments:
name: "${ .greet.name }"
stateDataFilter:
dataFilter:
output: "${ .payload.greeting }"
end: true
```
Expand Down Expand Up @@ -452,7 +452,7 @@ result of the workflow execution.
}
}
],
"stateDataFilter": {
"dataFilter": {
"output": "${ .results }"
},
"end": true
Expand Down Expand Up @@ -485,7 +485,7 @@ states:
refName: solveMathExpressionFunction
arguments:
expression: "${ .singleexpression }"
stateDataFilter:
dataFilter:
output: "${ .results }"
end: true
```
Expand Down Expand Up @@ -1127,7 +1127,7 @@ The data output of the workflow contains the information of the exception caught
}
}
],
"stateDataFilter": {
"dataFilter": {
"output": "${ .exceptions }"
},
"transition": "ApplyOrder",
Expand Down Expand Up @@ -1216,7 +1216,7 @@ states:
refName: provisionOrderFunction
arguments:
order: "${ .order }"
stateDataFilter:
dataFilter:
output: "${ .exceptions }"
transition: ApplyOrder
onErrors:
Expand Down Expand Up @@ -1322,12 +1322,12 @@ In the case job submission raises a runtime error, we transition to an Operation
"name": "${ .job.name }"
}
},
"actionDataFilter": {
"dataFilter": {
"results": "${ .jobuid }"
}
}
],
"stateDataFilter": {
"dataFilter": {
"output": "${ .jobuid }"
},
"transition": "WaitForCompletion"
Expand All @@ -1350,12 +1350,12 @@ In the case job submission raises a runtime error, we transition to an Operation
"name": "${ .jobuid }"
}
},
"actionDataFilter": {
"dataFilter": {
"results": "${ .jobstatus }"
}
}
],
"stateDataFilter": {
"dataFilter": {
"output": "${ .jobstatus }"
},
"transition": "DetermineCompletion"
Expand Down Expand Up @@ -1441,9 +1441,9 @@ states:
refName: submitJob
arguments:
name: "${ .job.name }"
actionDataFilter:
dataFilter:
results: "${ .jobuid }"
stateDataFilter:
dataFilter:
output: "${ .jobuid }"
transition: WaitForCompletion
- name: WaitForCompletion
Expand All @@ -1458,9 +1458,9 @@ states:
refName: checkJobStatus
arguments:
name: "${ .jobuid }"
actionDataFilter:
dataFilter:
results: "${ .jobstatus }"
stateDataFilter:
dataFilter:
output: "${ .jobstatus }"
transition: DetermineCompletion
- name: DetermineCompletion
Expand Down Expand Up @@ -2625,7 +2625,7 @@ For this example we assume that the workflow instance is started given the follo
"data": "${ .patientInfo }",
"consumeEventRef": "VetAppointmentInfo"
},
"actionDataFilter": {
"dataFilter": {
"results": "${ .appointmentInfo }"
}
}
Expand Down Expand Up @@ -2667,7 +2667,7 @@ states:
produceEventRef: MakeVetAppointment
data: "${ .patientInfo }"
consumeEventRef: VetAppointmentInfo
actionDataFilter:
dataFilter:
results: "${ .appointmentInfo }"
timeouts:
actionExecTimeout: PT15M
Expand Down Expand Up @@ -3431,7 +3431,7 @@ the data for an hour, send report, and so on.
}
}
],
"eventDataFilter": {
"dataFilter": {
"toStateData": "${ .readings }"
}
}
Expand Down Expand Up @@ -3515,7 +3515,7 @@ states:
actions:
- functionRef:
refName: LogReading
eventDataFilter:
dataFilter:
toStateData: "${ .readings }"
end: true
- name: GenerateReport
Expand Down Expand Up @@ -4164,7 +4164,7 @@ Its results are then merged back into the state data according to the "toStateDa
"actions": [
{
"functionRef": "Increment Current Count Function",
"actionDataFilter": {
"dataFilter": {
"toStateData": ".counts.current"
}
}
Expand Down Expand Up @@ -4204,7 +4204,7 @@ states:
type: operation
actions:
- functionRef: Increment Current Count Function
actionDataFilter:
dataFilter:
toStateData: ".counts.current"
transition: Check if full
```
Expand Down Expand Up @@ -4344,7 +4344,7 @@ states:
onEvents:
- eventRefs:
- ETA Deadline Event
eventDataFilter:
dataFilter:
data: "${ .results.status }"
toStateData: "${ .status }"
transition: Deliver Order
Expand All @@ -4360,10 +4360,10 @@ states:
refName: Charge For Order Function
arguments:
order: "${ .order.id }"
actionDataFilter:
dataFilter:
results: "${ .outcome.status }"
toStateData: "${ .status }"
stateDataFilter:
dataFilter:
output: '${ . | {"orderid": .id, "orderstatus": .status} | .orderstatus += ["Order
Completed"] }'
end: true
Expand All @@ -4390,7 +4390,7 @@ states:
refName: Submit Order Function
arguments:
order: "${ .order }"
actionDataFilter:
dataFilter:
results: "${ .results.status }"
toStateData: "${ .status }"
- functionRef:
Expand All @@ -4399,7 +4399,7 @@ states:
customer: "${ .customerId }"
restaurantid: "${ .order.restaurantId }"
delivery: " ${ .delivery }"
actionDataFilter:
dataFilter:
results: "${ .results.status }"
toStateData: "${ .status }"
end: true
Expand All @@ -4424,7 +4424,7 @@ states:
onEvents:
- eventRefs:
- Order Picked Up Event
eventDataFilter:
dataFilter:
data: "${ .data.status }"
toStateData: "${ .status }"
actions:
Expand All @@ -4435,7 +4435,7 @@ states:
onEvents:
- eventRefs:
- Order Delievered Event
eventDataFilter:
dataFilter:
data: "${ .data.status }"
toStateData: "${ .status }"
end: true
Expand Down Expand Up @@ -4511,7 +4511,7 @@ We assume that our workflow input has the runtime-imposed quota:
"eventRefs":[
"CustomerEvent"
],
"eventDataFilter":{
"dataFilter":{
"data":"${ .customerId }",
"toStateData":"${ .eventCustomerId }"
},
Expand All @@ -4527,7 +4527,7 @@ We assume that our workflow input has the runtime-imposed quota:
]
}
],
"stateDataFilter":{
"dataFilter":{
"output":"${ .count = .count + 1 }"
},
"transition":"CheckEventQuota"
Expand Down Expand Up @@ -4583,15 +4583,15 @@ states:
onEvents:
- eventRefs:
- CustomerEvent
eventDataFilter:
dataFilter:
data: "${ .customerId }"
toStateData: "${ .eventCustomerId }"
actions:
- functionRef:
refName: NotifyCustomerFunction
arguments:
customerId: "${ .eventCustomerId }"
stateDataFilter:
dataFilter:
output: "${ .count = .count + 1 }"
transition: CheckEventQuota
- name: CheckEventQuota
Expand Down
1 change: 1 addition & 0 deletions roadmap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ _Status description:_
| ✔️| Update the `dataInputSchema` top-level property by supporting the assignment of a JSON schema object [workflow schema](https://github.com/serverlessworkflow/specification/tree/main/specification.md#workflow-definition-structure) |
| ✔️| Add the new `WORKFLOW` reserved keyword to workflow expressions |
| ✔️| Update `ForEach` state iteration parameter example. This parameter is an expression variable, not a JSON property |
| ✔️| Renamed data filter properties (`stateDataFilter`, `actionDataFilter`, ...) into `dataFilter` both to avoid redundancy and improve definition readability
| ✏️️| Add inline state defs in branches | |
| ✏️️| Update rest function definition | |
| ✏️️| Add "completedBy" functionality | |
Expand Down
Loading