@@ -106,8 +106,8 @@ Data flow during workflow execution can be divided into:
106106### Workflow Data Expressions
107107
108108Workflow 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 .
111111
112112All expressions must follow the [ JsonPath] ( https://github.com/json-path/JsonPath ) format and can be evaluated with a JsonPath expression evaluator.
113113JsonPath expressions can select and extract the workflow JSON data.
@@ -118,7 +118,7 @@ All expressions are written inside double braces:
118118{{ expression }}
119119```
120120
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.
122122
123123To show some expression examples, let's say that we have the following JSON data:
124124
@@ -180,24 +180,22 @@ Would set the data output of the particular state to:
180180]
181181```
182182
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:
185187
186188``` json
187189{
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+ }
197195}
198196```
199197
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 .
201199
202200JsonPath also includes a limited set of built-in functions that can be used inside expressions. For example the expression
203201
@@ -209,11 +207,12 @@ JsonPath also includes a limited set of built-in functions that can be used insi
209207
210208would set the value of ` phoneNums ` to ` 2 ` .
211209
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
213211the ` parameters ` param of the [ functionRef definition] ( #FunctionRef-Definition ) can evaluate expressions
214212only against the data that is available to the [ action] ( #Action-Definition ) it belongs to.
215213One 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+
217216For example let's say that we have a workflow data input of:
218217
219218``` json
0 commit comments