Table of Contents
Friendly Enough Expression Language, or FEEL, is a new standard promoted by the OMG (Object Management Group). The DCR Process Engine has implemented a subset of the FEEL langage as it's expression language. Please check the version of the engine using this example graph in order to check if the function needed is available in the DCR Process Engine within your IT system.
The FEEL function and attribute names cannot be used as activity ids so take care when creating activity ids. The full list of reserved words can be found here but it is currently not enforced by the portal.
FEEL functions currently supported
Where applicable click on the function to go to an example graph using the function.
FUNCTION | DESCRIPTION | VERSION | EXAMPLE |
---|---|---|---|
number(string) -> float | A string representation of a floating-point number. Must be a number written in the US format | 3.10.0 | number("24") = 24 |
string(param) -> string | Gives the string representation of the input. | 3.10.0 | string(24) = "24" |
string length(string)-> int | Gives the length of a string | 4.13.2 | string lenght("foobar") = 6 |
substring(string x, int y) -> string | Returns the substring of 'x' starting on character number 'y' | 3.10.0 | substring("foobar", 4) = "bar" |
substring(string x, int y, int z) -> string | Returns the substring of 'x' starting on character number 'y' and of length 'z' | 3.10.0 | substring("foobar",4,2) ="ba" |
contains(string x, string y) -> bool | Checks if the string ‘x’ contains the string ‘y’ | 4.16.0 | contains("foobar","oba") = true |
date(int x, int y, int z) -> datetime | Returns a date where ‘x’ is the year, ‘y’ is the month and ‘z’ is the day. | 3.10.0 | date(2023,1,11) = 2022-01-11T00:00:00.0000000Z |
datediff(datetime x, datetime y) -> duration | Return the duration between two datetimes. This function works just like ‘x – y’ where ‘x’ and ‘y’ are both datetimes. | 3.11.0 | |
years and months duration (datetime x, datetime y) -> duration | Returns the total years and months between the two dates. | 4.3.0 | |
now() / today() -> datetime | Returns the current timestamp of the graph. FEEL syntax for keyword “now” which should work in 3.0.0 and potentially earlier. | 4.3.0 | |
workday(int x) -> workdayduration | Returns a workday-duration which ignore days set as not workdays when added to dates. | 4.3.0 | |
concatenate(lists) -> list | Concatenate two or more lists together. | 4.8.0 | |
append(list x, params) -> list | Add one or more values to the list ‘x’. | 4.8.0 | |
list contains(list x, param y) -> bool | Checks if the list ‘x’ contains the value ‘y’ | 4.8.0 | |
count(list x)-> int | Gives the size of the list ‘x’ | 4.8.0 | |
remove(list x, int i) -> list | Removes the element on location ‘i’ from the list ‘x’ (remember that in FEEL the index starts at 1). | 4.15.0 | |
round(param x) -> int/duration | Takes an integer, float or duration. Rounding goes to nearest integer in case of floats. See rounding of durations over for how that is done. | 4.10.0 | |
ceiling(param x) -> int/duration | Rounds up to nearest integer, or duration | 4.10.0 | |
floor(param x)-> int/duration | rounds down to nearest integer or duration | 4.10.0 | |
modulo(int x, int y)->int | Does the modulo operator on ‘x’ with ‘y’. Can also write “x % y” for the same | 4.8.0 | |
date(string x) | Tries to convert the string 'x' to a datetime value. Expects that the string is following ISO 8601 syntax | 4.13.2 | |
duration(string x) | Tries to convert the string 'x' to a duration value. Expects that the string is following ISO 8601 syntax | 4.13.2 | |
sqrt(number x) | takes the square root of 'x' | 4.13.2 | |
log(number x) | gives the natural logarithm (base e) of the number 'x' | 4.13.2 | |
exp(number x) | raises e to the power of 'x' | 4.13.2 | |
instance of(expr, typ) -> bool | Checks if the expression ‘expr’ is of the type ‘typ’. The two types featured is ‘Number’ and ‘String’ | 4.16.2 | instance of (2+4, number) = true, instance of (2+4,String) = false, instance of (2+"4",String) = true |
Visit this example to see FEEL string functions.
Visit this example to see FEEL date functions.
FEEL attributes currently supported
Attribute | description | version |
datetime.year | Return the integer value of the year for the datetime | 3.10.0 |
datetime.month | Return the integer value of the month for the datetime | 3.10.0 |
datetime.weekday | Return the string description of the weekday that the datetime represent | 3.10.0 |
datetime.day | Return the day of the date as an integer. | 3.10.0 |
datetime.hour | Returns the integer value of the hour that the datetime represent | 3.10.0 |
datetime.minute | Returns the integer value of the minute that the datetime represent | 3.10.0 |
duration.years | Returns the integer representation of the years in the duration | 3.10.0 |
duration.months | Returns the integer representation of the months in the duration | 3.10.0 |
duration.days | Returns the integer representation of the days in the duration | 3.10.0 |
duration.hours | Returns the integer representation of the hours in the duration | 3.10.0 |
duration.minutes | Returns the integer representation of the minutes in the duration | 3.10.0 |
Visit this example to experiment with FEEL attributes.
FEEL lists
The DCR Process Engine 4.8.0 introduces support for FEEL lists.
An example FEEL list of the numbers 1, 2 and 3 is written in this way:
[1, 2, 3, 4]
In a similar manner a FEEL list of strings can be written as:
["Norway", "Sweden", "Denmark", "Finland"] or ["NO", "SE", "DK", "FI"]
list contains(<list>, <value>) --> true | false
count(<list>) --> integer value with the number of elements in the list
append(<list>,<element>) --> returns a new list where the element is appended to the list
concatenate(<list1>,<list2>) --> returns a new list where the two lists are concatenated.
Visit this example to see FEEL list functions.
Rounding up and down a duration
Please take a look of this example about how to use the FEEL functions ceiling and floor on durations. FEEL does not require ceiling and floor on duration, but only on integer and floating point values. We've often seen the need to round up a duration found during process mining, e.g. changing P7DT6H5M13S into P8D for a deadline to make the model more readable.