Skip to content

Commit 7559275

Browse files
committed
ForEach iteration param access
Replacing . by $. $ is the prefix used by jq for accessing variables. This prevents implementors to have to temporarily add iterationParam to the workflow model in order to evaluate the expression. Signed-off-by: Francisco Javier Tirado Sarti <[email protected]>
1 parent f542e91 commit 7559275

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

specification.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2884,7 +2884,7 @@ Note that `transition` and `end` properties are mutually exclusive, meaning that
28842884
"functionRef": {
28852885
"refName": "provisionOrderFunction",
28862886
"arguments": {
2887-
"order": "${ .singleorder }"
2887+
"order": "${ $singleorder }"
28882888
}
28892889
}
28902890
}
@@ -2905,7 +2905,7 @@ actions:
29052905
- functionRef:
29062906
refName: provisionOrderFunction
29072907
arguments:
2908-
order: "${ .singleorder }"
2908+
order: "${ $singleorder }"
29092909
```
29102910

29112911
</td>
@@ -2938,6 +2938,7 @@ of each iteration should be added to. If this array does not exist, it should be
29382938

29392939
The `iterationParam` property defines the name of the iteration parameter passed to each iteration of the ForEach state.
29402940
It should contain the unique element of the `inputCollection` array and made available to actions of the ForEach state.
2941+
`iterationParam` can be accessed as an expression variable. In JQ, expression variables are prefixed by $.
29412942
If `iterationParam` is not explicitly defined, runtimes should create one and populate it with the value of the unique
29422943
iteration parameter for each iteration of the ForEach state.
29432944

@@ -3004,8 +3005,8 @@ and our workflow is defined as:
30043005
"functionRef": {
30053006
"refName": "sendConfirmationFunction",
30063007
"arguments": {
3007-
"orderNumber": "${ .completedorder.orderNumber }",
3008-
"email": "${ .completedorder.email }"
3008+
"orderNumber": "${ $completedorder.orderNumber }",
3009+
"email": "${ $completedorder.email }"
30093010
}
30103011
}
30113012
}],
@@ -3036,8 +3037,8 @@ states:
30363037
- functionRef:
30373038
refName: sendConfirmationFunction
30383039
arguments:
3039-
orderNumber: "${ .completedorder.orderNumber }"
3040-
email: "${ .completedorder.email }"
3040+
orderNumber: "${ $completedorder.orderNumber }"
3041+
email: "${ $completedorder.email }"
30413042
end: true
30423043
```
30433044

0 commit comments

Comments
 (0)