Skip to content

Commit

Permalink
feat(feel): Clarify unary-tests behavior
Browse files Browse the repository at this point in the history
Extend the description when a unary-tests expression is fulfilled. Make it explicit what an expression with the special variable `?` must evaluate to true.
  • Loading branch information
saig0 committed Aug 30, 2024
1 parent 68f42a7 commit 4be8b0f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 30 deletions.
13 changes: 7 additions & 6 deletions docs/components/modeler/feel/language-guide/feel-unary-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ entries of a decision table (i.e. the conditions of a rule).

A unary-tests expression returns `true` if one of the following conditions is fulfilled:

- The expression evaluates to `true` when the input value is applied to it.
- The expression evaluates to a list, and the input value is equal to at least one of the values in
that list.
- The expression evaluates to `true` when the input value is applied to the unary operators.
- The expression evaluates to `true` when the input value is assigned to the special variable `?`.
- The expression evaluates to a value, and the input value is equal to that value.
- The expression evaluates to a list, and the input value is equal to at least one of the values.
- The expression is equal to `-` (a dash).

### Comparison
Expand Down Expand Up @@ -129,13 +129,14 @@ not(2, 3)

### Expressions

Evaluates an expression that returns a boolean value. For example, [invoking a function](/components/modeler/feel/language-guide/feel-functions.md#invocation).
When a unary operator is not enough to express the condition, any expression can be used that returns a boolean value,
such as [invoking a function](/components/modeler/feel/language-guide/feel-functions.md#invocation).

The input value can be accessed in the expression by using the symbol `?` (a question mark).
In the expression, the input value can be accessed by the special variable `?`.

```feel
contains(?, "good")
// check if the input value (string) contains "good"
// checks if the input value (string) contains "good"
ends with(?, "@camunda.com")
// checks if the input value (string) ends with "@camunda.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ entries of a decision table (i.e. the conditions of a rule).

A unary-tests expression returns `true` if one of the following conditions is fulfilled:

- The expression evaluates to `true` when the input value is applied to it.
- The expression evaluates to a list, and the input value is equal to at least one of the values in
that list.
- The expression evaluates to `true` when the input value is applied to the unary operators.
- The expression evaluates to `true` when the input value is assigned to the special variable `?`.
- The expression evaluates to a value, and the input value is equal to that value.
- The expression evaluates to a list, and the input value is equal to at least one of the values.
- The expression is equal to `-` (a dash).

### Comparison
Expand Down Expand Up @@ -128,13 +128,14 @@ not(2, 3)

### Expressions

Evaluates an expression that returns a boolean value. For example, [invoking a function](/docs/components/modeler/feel/language-guide/feel-functions#invocation).
When a unary operator is not enough to express the condition, any expression can be used that returns a boolean value,
such as [invoking a function](/components/modeler/feel/language-guide/feel-functions.md#invocation).

The input value can be accessed in the expression by using the symbol `?` (a question mark).
In the expression, the input value can be accessed by the special variable `?`.

```feel
contains(?, "good")
// check if the input value (string) contains "good"
// checks if the input value (string) contains "good"
ends with(?, "@camunda.com")
// checks if the input value (string) ends with "@camunda.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ entries of a decision table (i.e. the conditions of a rule).

A unary-tests expression returns `true` if one of the following conditions is fulfilled:

- The expression evaluates to `true` when the input value is applied to it.
- The expression evaluates to a list, and the input value is equal to at least one of the values in
that list.
- The expression evaluates to `true` when the input value is applied to the unary operators.
- The expression evaluates to `true` when the input value is assigned to the special variable `?`.
- The expression evaluates to a value, and the input value is equal to that value.
- The expression evaluates to a list, and the input value is equal to at least one of the values.
- The expression is equal to `-` (a dash).

### Comparison
Expand Down Expand Up @@ -129,13 +129,14 @@ not(2, 3)

### Expressions

Evaluates an expression that returns a boolean value. For example, [invoking a function](/docs/components/modeler/feel/language-guide/feel-functions#invocation).
When a unary operator is not enough to express the condition, any expression can be used that returns a boolean value,
such as [invoking a function](/components/modeler/feel/language-guide/feel-functions.md#invocation).

The input value can be accessed in the expression by using the symbol `?` (a question mark).
In the expression, the input value can be accessed by the special variable `?`.

```feel
contains(?, "good")
// check if the input value (string) contains "good"
// checks if the input value (string) contains "good"
ends with(?, "@camunda.com")
// checks if the input value (string) ends with "@camunda.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ entries of a decision table (i.e. the conditions of a rule).

A unary-tests expression returns `true` if one of the following conditions is fulfilled:

- The expression evaluates to `true` when the input value is applied to it.
- The expression evaluates to a list, and the input value is equal to at least one of the values in
that list.
- The expression evaluates to `true` when the input value is applied to the unary operators.
- The expression evaluates to `true` when the input value is assigned to the special variable `?`.
- The expression evaluates to a value, and the input value is equal to that value.
- The expression evaluates to a list, and the input value is equal to at least one of the values.
- The expression is equal to `-` (a dash).

### Comparison
Expand Down Expand Up @@ -129,13 +129,14 @@ not(2, 3)

### Expressions

Evaluates an expression that returns a boolean value. For example, [invoking a function](/docs/components/modeler/feel/language-guide/feel-functions#invocation).
When a unary operator is not enough to express the condition, any expression can be used that returns a boolean value,
such as [invoking a function](/components/modeler/feel/language-guide/feel-functions.md#invocation).

The input value can be accessed in the expression by using the symbol `?` (a question mark).
In the expression, the input value can be accessed by the special variable `?`.

```feel
contains(?, "good")
// check if the input value (string) contains "good"
// checks if the input value (string) contains "good"
ends with(?, "@camunda.com")
// checks if the input value (string) ends with "@camunda.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ entries of a decision table (i.e. the conditions of a rule).

A unary-tests expression returns `true` if one of the following conditions is fulfilled:

- The expression evaluates to `true` when the input value is applied to it.
- The expression evaluates to a list, and the input value is equal to at least one of the values in
that list.
- The expression evaluates to `true` when the input value is applied to the unary operators.
- The expression evaluates to `true` when the input value is assigned to the special variable `?`.
- The expression evaluates to a value, and the input value is equal to that value.
- The expression evaluates to a list, and the input value is equal to at least one of the values.
- The expression is equal to `-` (a dash).

### Comparison
Expand Down Expand Up @@ -129,13 +129,14 @@ not(2, 3)

### Expressions

Evaluates an expression that returns a boolean value. For example, [invoking a function](/components/modeler/feel/language-guide/feel-functions.md#invocation).
When a unary operator is not enough to express the condition, any expression can be used that returns a boolean value,
such as [invoking a function](/components/modeler/feel/language-guide/feel-functions.md#invocation).

The input value can be accessed in the expression by using the symbol `?` (a question mark).
In the expression, the input value can be accessed by the special variable `?`.

```feel
contains(?, "good")
// check if the input value (string) contains "good"
// checks if the input value (string) contains "good"
ends with(?, "@camunda.com")
// checks if the input value (string) ends with "@camunda.com"
Expand Down

0 comments on commit 4be8b0f

Please sign in to comment.