You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specification.md
+21-1Lines changed: 21 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -438,7 +438,7 @@ The second way would be to directly filter only the "veggie like" vegetables wit
438
438
| fromStateData | Workflow expression that filters state data that can be used by the action | string | no |
439
439
| useResults | If set to `false`, action data results are not added/merged to state data. In this case 'results' and 'toStateData' should be ignored. Default is `true`. | boolean | no |
440
440
| results | Workflow expression that filters the actions data results | string | no |
441
-
| toStateData | Workflow expression that selects a state data element to which the action results should be added/merged into. If not specified denotes the top-level state data element | string | no |
441
+
| toStateData | Workflow expression that selects a state data element to which the action results should be added/merged. If not specified denotes the top-level state data element. In case it is not specified and the result of the action is not an object, that result should be merged as the value of an automatically generated key. That key name will be the result of concatenating the action name with `-output` suffix. | string | no |
442
442
443
443
<details><summary><strong>Click to view example definition</strong></summary>
444
444
<p>
@@ -564,6 +564,26 @@ into. With this, after our action executes the state data would be:
564
564
}
565
565
```
566
566
567
+
To illustrate the merge of non-JSON for both objects, let's assume that, in the previous example, the action definition is the follows
568
+
569
+
```json
570
+
"actions":[
571
+
{
572
+
"name": "fetch-only-pasta",
573
+
"functionRef": "breadAndPastaTypesFunction",
574
+
"actionDataFilter": {
575
+
"results": "${ .pasta[1] ]",
576
+
}
577
+
}
578
+
]
579
+
```
580
+
Since there is no `toStateData` attribute and the result is not a JSON object but a string, the model would be:
581
+
582
+
```json
583
+
{
584
+
"fetch-only-pasta-output": "spaghetti"
585
+
}
586
+
```
567
587
In the case action results should not be added/merged to state data, we can set the `useResults` property to `false`.
568
588
In this case, the `results` and `toStateData` properties should be ignored, and nothing is added/merged to state data.
569
589
If `useResults` is not specified (or it's value set to `true`), action results, if available, should be added/merged to state data.
0 commit comments