Skip to content

Commit c2366b2

Browse files
committed
Added the top level evaluate property, used to configure both the runtime expression language and mode.
Partially addresses #848 Signed-off-by: Charles d'Avernas <charles.davernas@neuroglia.io>
1 parent 5a2acaf commit c2366b2

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

dsl-reference.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ A [workflow](#workflow) serves as a blueprint outlining the series of [tasks](#t
6868
| timeout | [`timeout`](#timeout) | `no` | The configuration, if any, of the workflow's timeout. |
6969
| output | [`output`](#output) | `no` | Configures the workflow's output. |
7070
| schedule | [`schedule`](#schedule) | `no` | Configures the workflow's schedule, if any. |
71+
| evaluate | [`evaluate`](#evaluate) | `no` | Configures runtime expression evaluation. |
7172

7273
#### Document
7374

@@ -98,7 +99,7 @@ Defines the workflow's reusable components.
9899

99100
#### Schedule
100101

101-
Configures a workflow's schedule.
102+
Configures the schedule of a workflow.
102103

103104
| Name | Type | Required | Description|
104105
|:--|:---:|:---:|:---|
@@ -107,6 +108,15 @@ Configures a workflow's schedule.
107108
| after | [`duration`](#duration) | `no` | Specifies a delay duration that the workflow must wait before starting again after it completes. In other words, when this workflow completes, it should run again after the specified amount of time.<br>*Required when no other property has been set.* |
108109
| on | [`eventConsumptionStrategy`](#event-consumption-strategy) | `no` | Specifies the events that trigger the workflow execution.<br>*Required when no other property has been set.* |
109110

111+
#### Evaluate
112+
113+
Configures a workflow's runtime expression evaluation.
114+
115+
| Name | Type | Required | Description|
116+
|:--|:---:|:---:|:---|
117+
| language | `string` | `yes` | The language used for writting runtime expressions.<br>*Defaults to `jq`.* |
118+
| mode | `string` | `yes` | The runtime expression evaluation mode.<br>*Supported values are:*<br>- `strict`: requires all expressions to be enclosed within `${ }` for proper identification and evaluation.<br>- `loose`: evaluates any value provided. If the evaluation fails, it results in a string with the expression as its content.<br>*Defaults to `strict`.*
119+
110120
#### Examples
111121

112122
```yaml

dsl.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,11 @@ Runtime expressions allow for the incorporation of variables, functions, and ope
181181

182182
One key aspect of runtime expressions is their ability to adapt to runtime data and context. This means that expressions can access and manipulate data generated during the execution of a workflow, enabling dynamic decision-making and behavior based on real-time information.
183183

184-
All runtimes **must** support the default runtime expression language, which is [`jq`]().
184+
Runtime expressions in Serverless Workflow can be evaluated using either the default `strict` mode or the `loose` mode. In `strict` mode, all expressions must be properly identified with `${}` syntax. Conversely, in `loose` mode, expressions are evaluated more liberally, allowing for a wider range of input formats. While `strict` mode ensures strict adherence to syntax rules, `loose` mode offers flexibility, allowing evaluation even if the syntax is not perfectly formed.
185185

186-
Runtimes **may** optionally support other runtime expression languages, which authors can specifically use by adequately configuring the workflow. See [`use.language`](dsl-reference.md#use) for more details.
186+
All runtimes **must** support the default runtime expression language, which is [`jq`](https://jqlang.github.io/jq/).
187+
188+
Runtimes **may** optionally support other runtime expression languages, which authors can specifically use by adequately configuring the workflow. See [`evaluate.language`](dsl-reference.md#evaluate) for more details.
187189

188190
CloudFlows defines [several arguments](#runtime-expression-arguments) that runtimes **must** provide during the evaluation of runtime expressions.
189191

0 commit comments

Comments
 (0)