Categories
#FEEL

Friendly Enough Expression Language

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.

Functiondescriptionversionexample
number(string) -> floatA string representation of a floating-point number.
Must be a number written in the US format
3.10.0number("24") = 24
string(param) -> stringGives the string representation of the input. 3.10.0string(24) = "24"
string length(string)-> intGives the length of a string4.13.2string lenght("foobar") = 6
substring(string x, int y) -> stringReturns the substring of 'x' starting on character number 'y'3.10.0substring("foobar", 4) = "bar"
substring(string x, int y, int z)Returns the substring of 'x' starting on character number 'y' and of length 'z'3.10.0substring("foobar",4,2) ="ba"
date(int x, int y, int z) -> datetimeReturns a date where ‘x’ is the year, ‘y’ is the month and ‘z’ is the day.3.10.0date(2023,1,11) = 2022-01-11T00:00:00.0000000Z
datediff(datetime x, datetime y) -> durationReturn 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) -> durationReturns the total years and months between the two dates. 4.3.0
now() / today() -> datetimeReturns 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) -> workdaydurationReturns a workday-duration which ignore days set as not workdays when added to dates.  4.3.0
concatenate(lists) -> listConcatenate two or more lists together.4.8.0
append(list x, params) -> listAdd one or more values to the list ‘x’.4.8.0
list contains(list x, param y) ->boolChecks if the list ‘x’ contains the value ‘y’4.8.0
count(list x)-> intGives the size of the list ‘x’4.8.0
round(param x) -> int/durationTakes 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/durationRounds up to nearest integer, or duration4.10.0
floor(param x)-> int/durationrounds down to nearest integer or duration4.10.0
modulo(int x, int y)->intDoes 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 syntax4.13.2
duration(string x)Tries to convert the string 'x' to a duration value. Expects that the string is following ISO 8601 syntax4.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

Visit this example to see FEEL string functions.

Visit this example to see FEEL date functions.

FEEL attributes currently supported

Attributedescriptionversion
datetime.yearReturn the integer value of the year for the datetime3.10.0
datetime.monthReturn the integer value of the month for the datetime3.10.0
datetime.weekdayReturn the string description of the weekday that the datetime represent3.10.0
datetime.dayReturn the day of the date as an integer. 3.10.0
datetime.hourReturns the integer value of the hour that the datetime represent3.10.0
datetime.minuteReturns the integer value of the minute that the datetime represent3.10.0
duration.yearsReturns the integer representation of the years in the duration3.10.0
duration.monthsReturns the integer representation of the months in the duration3.10.0
duration.daysReturns the integer representation of the days in the duration3.10.0
duration.hoursReturns the integer representation of the hours in the duration3.10.0
duration.minutesReturns the integer representation of the minutes in the duration3.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.

Related Release notes

Release 6.8

  • Introducing DCR Rules Wizard
  • More DMN improvements
  • Subgraphs replacing multi-instance subprocesses

Related Videos

No related videos found.

Related Articles

No related articles found.
LinkedIn
Share