@@ -106,8 +106,8 @@ Data flow during workflow execution can be divided into:
106
106
### Workflow Data Expressions
107
107
108
108
Workflow model parameters may use expressions to access the JSON data.
109
- Note that different data filters play a big role as to which parts of the state data is queried against . Reference the
110
- [ State Data Filtering] ( #State-Data-Filtering ) section for more information.
109
+ Note that different data filters play a big role as to which parts of the states data are selected . Reference the
110
+ [ State Data Filtering] ( #State-Data-Filtering ) section for more information about data state data filters .
111
111
112
112
All expressions must follow the [ JsonPath] ( https://github.com/json-path/JsonPath ) format and can be evaluated with a JsonPath expression evaluator.
113
113
JsonPath expressions can select and extract the workflow JSON data.
@@ -118,7 +118,7 @@ All expressions are written inside double braces:
118
118
{{ expression }}
119
119
```
120
120
121
- Expressions should be resolved and the result returned exactly where the expression is written.
121
+ Expressions should be resolved and the results returned exactly where the expression is written.
122
122
123
123
To show some expression examples, let's say that we have the following JSON data:
124
124
@@ -180,24 +180,22 @@ Would set the data output of the particular state to:
180
180
]
181
181
```
182
182
183
- Some parameters require an expression to resolve to a boolean (true / false). In this case JsonPath expressions can also be used.
184
- The expression should evaluate to true, if the result contains a subset of the JSON data, and false if it is empty. For example:
183
+ [ Switch state] ( #Switch-State ) [ conditions] ( #switch-state-dataconditions ) require for expressions to be resolved to a boolean value (true / false).
184
+ In this case JsonPath expressions can also be used.
185
+ The expression should evaluate to true, if the result contains a subset of the JSON data, and false if it is empty.
186
+ For example:
185
187
186
188
``` json
187
189
{
188
- "isAdult" : " {{ $.[?(@.age > 18)] }}"
189
- }
190
- ```
191
-
192
- would set the value if ` isAdult ` to true, as the expression returns a non-empty subset of the JSON data. Similarly
193
-
194
- ``` json
195
- {
196
- "isChild" : " {{ $.[?(@.age < 18)] }}"
190
+ "name" : " Eighteen or older" ,
191
+ "condition" : " {{ $.applicants[?(@.age >= 18)] }}" ,
192
+ "transition" : {
193
+ "nextState" : " StartApplication"
194
+ }
197
195
}
198
196
```
199
197
200
- would return false as the result of the JsonPath expression is empty.
198
+ In this case the condition would be evaluated to true if it returns a non- empty subset of the queried data .
201
199
202
200
JsonPath also includes a limited set of built-in functions that can be used inside expressions. For example the expression
203
201
@@ -209,11 +207,12 @@ JsonPath also includes a limited set of built-in functions that can be used insi
209
207
210
208
would set the value of ` phoneNums ` to ` 2 ` .
211
209
212
- As previously mentioned, expressions are evaluated against the subset of data that can see . For example
210
+ As previously mentioned, expressions are evaluated against certain subsets of data. For example
213
211
the ` parameters ` param of the [ functionRef definition] ( #FunctionRef-Definition ) can evaluate expressions
214
212
only against the data that is available to the [ action] ( #Action-Definition ) it belongs to.
215
213
One thing to note here are the top-level [ workflow definition] ( #Workflow-Definition ) parameters. Expressions defined
216
- in them can only be evaluated against the initial [ workflow data input] ( #Workflow-Data-Input ) JSON.
214
+ in them can only be evaluated against the initial [ workflow data input] ( #Workflow-Data-Input ) .
215
+
217
216
For example let's say that we have a workflow data input of:
218
217
219
218
``` json
0 commit comments