FEEL Language Elements
The Camunda DMN engine supports FEEL for input entries. The FEEL term for
expression in input entires is simple unary tests. These simple unary tests
test an input value against an expression and return either true
if the test
is satisfied or false
otherwise. The expression can contain different
elements which are described in this sections.
Comparison
FEEL simple unary tests support the following comparison operators. Please
note that the equals operator is empty and not =
. Also it does not
exist an not equal operator like !=
. To express this negation has to be
used.
Name | Operator | Example | Description |
---|---|---|---|
Equal |
|
"Steak" |
Test that the input value is equal the given value. |
Less | < |
< 10 |
Test that the input value is less than the given value. |
Less or Equal | <= |
<= 10 |
Test that the input value is less or equal than the given value. |
Greater | > |
> 10 |
Test that the input value is greater than the given value. |
Greater or Equal | >= |
>= 10 |
Test that the input value is greater or equal than the given value. |
Range
Some FEEL data types like numeric types and date types can be tested against a range of values. These ranges consist of a start value and an end value. The range specifies if the start and end value is included in the range.
Start | End | Example | Description |
---|---|---|---|
include | include | [1..10] |
Test that the input value is greater then or equals the start value and less then or equals the end value. |
exclude | include | ]1..10] or (1..10] |
Test that the input value is greater then the start value and less then or equals the end value. |
include | exclude | [1..10[ or [1..10) |
Test that the input value is greater then or equal the start value and less then the end value. |
exclude | exclude | ]1..10[ or (1..10) |
Test that the input value is greater then the start value and less then the end value. |
Disjunction
A FEEL simple unary test can be specified as conjunction of expressions. These
expression have to either comparisons or ranges. The test is true
at least one of conjunct expressions is true
.
Examples:
3,5,7
: Test if the input is either 3, 5 or 7<2,>10
: Test if the input is either less then 2 or greater then 1010,[20..30]
: Test if the input is either 10 or between 20 and 30"Spareribs","Steak","Stew"
: Test if the input is either the String Spareribs, Steak or Stewdate and time("2015-11-30T12:00:00"),date and time("2015-12-01T12:00:00")]
: Test if the input is either the date November 30th, 2015 at 12:00:00 o’clock or December 1st, 2015 at 12:00:00 o’clock>customer.age,>21
: Test if the input is either greater than theage
property of the variablecustomer
or greater than 21
Negation
A FEEL simple unary tests can be negated with the not
function. This means if
the containing expression returns true
the test will return false
. Please
note that only one negation as first operator is allowed but it can contain
a disjunction.
Examples:
not("Steak")
: Test if the input is not the String Steaknot(>10)
: Test if the input is not greater than 10, which means it is less then or equals 10not(3,5,7)
: Test if the input is neither 3, 5 nor 7not([20..30])
: Test if the input is not between 20 and 30
Qualified Names
FEEL simple unary tests can access variables and object properties by qualified names.
Examples:
x
: Test if the input is equal the variablex
>= x
: Test if the input is greater then or equal the variablex
< customer.age
: Test if the input is less then theage
property of the variablecustomer
Date Functions
FEEL simple unary tests provide functions to create date types. The Camunda DMN engine supports the following date functions:
date and time("...")
: Creates a date and time value from a String with the formatyyyy-MM-dd'T'HH:mm:ss
Examples:
date and time("2015-11-30T12:00:00")
: Test if the input is the date November 30th, 2015 at 12:00:00 o’clock[date and time("2015-11-30T12:00:00")..date and time("2015-12-01T12:00:00")]
: Test if the input is between the date November 30th, 2015 at 12:00:00 o’clock and December 1st, 2015 at 12:00:00 o’clock