Skip to content

Commit

Permalink
[Fix serverlessworkflow#712] Ricardo's comment
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Javier Tirado Sarti <ftirados@redhat.com>
Signed-off-by: Charles d'Avernas <charles.davernas@neuroglia.io>
  • Loading branch information
fjtirado authored and cdavernas committed May 21, 2024
1 parent 53ef969 commit 7736833
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,27 @@ into. With this, after our action executes the state data would be:
}
```

To illustrate merge of not json both object, let`s assume that, in previous example, the action definition is at follows

```json
"actions":[
{
"name": "fetch_only_pasta",
"functionRef": "breadAndPastaTypesFunction",
"actionDataFilter": {
"results": "${ .pasta[1] ]",
}
}
]
}
```
Since there is not `toStateData` and the result is not a json object but an string, the state would be

```json
{
"response": "spaghetti"
}
```
In the case action results should not be added/merged to state data, we can set the `useResults` property to `false`.
In this case, the `results` and `toStateData` properties should be ignored, and nothing is added/merged to state data.
If `useResults` is not specified (or it's value set to `true`), action results, if available, should be added/merged to state data.
Expand Down

0 comments on commit 7736833

Please sign in to comment.