Lists

Collection functions

all(list)

returns false if any item is false, else true if empty or all items are true, else null

Parameters
Name Required Type Description

list

Yes

Collection of Boolean

Returns

Boolean

Examples
all( [2=2, 5<11] ) => true

all( [true, true, false, true] ) => false

any(list)

returns true if any item is true, else false if empty or all items are false, else null

Parameters
Name Required Type Description

list

Yes

Collection of Boolean

Returns

Boolean

Examples
any( [5>=11, 2=3, false] ) => false

any( [true, true, false, true] ) => true

append(list, item)

returns a new list with items appended

Parameters
Name Required Type Description

list

Yes

list

item

Yes

Any

Examples
append( [1], 2, 3) => [1, 2, 3]

append( ["Trisotech"], "DMN" ) => ["Trisotech", "DMN"]

concatenate(list)

returns a new list that is a concatenation of the arguments

Parameters
Name Required Type Description

list

Yes

list

Examples
concatenate( [1,2], [3] ) => [1, 2, 3]

concatenate( ["DMN"],["BPMN", "CMMN"] ) => ["DMN", "BPMN", "CMMN"]

concatenate( ["a"],["b"],["c"] ) => ["a", "b", "c"]

count(list)

returns size of list

Parameters
Name Required Type Description

list

Yes

list

Returns

Number

Examples
count( [1, 2, 3] ) => 3

count( ["Trisotech","DMN"]) => 2

distinct values(list)

duplicate removal

Parameters
Name Required Type Description

list

Yes

list

Examples
distinct values([1, 2, 3, 2, 1]) => [1, 2, 3]

distinct values( ["DMN", "BPMN", "dmn" ] => ["DMN", "BPMN", "dmn"]

flatten(list)

flatten nested lists

Parameters
Name Required Type Description

list

Yes

list

Examples
flatten( [ [1,2], 3, 4] ) => [1, 2, 3, 4]

flatten( [ ["Trisotech"],"DMN", ["BPMN", "CMMN" ] ]) => ["Trisotech", "DMN", "BPMN", "CMMN"]

index of(list, match)

returns ascending list of list positions containing match

Parameters
Name Required Type Description

list

Yes

list

match

Yes

Any

Returns

Collection of Number

Examples
index of( [1 ,2, 3, 2], 2 ) => [2, 4]

index of( ["DMN","BPMN","CMMN"], "DMN" ) => [1]

insert after(list, position, newItem)

returns new list with the newItem inserted after position. Note that this function is not yet a standardized FEEL function.

Parameters
Name Required Type Description

list

Yes

list

position

Yes

Number

newItem

Yes

Any

Examples
insert after([1,2] ,2 ,3) => [1, 2, 3]

insert after(["BPMN", "CMMN"], 2, "DMN") => ["BPMN", "DMN", "CMMN"]

insert before(list, position, newItem)

returns new list with the newItem inserted at position

Parameters
Name Required Type Description

list

Yes

list

position

Yes

Number

newItem

Yes

Any

Examples
insert before([1,3] ,2 ,2) => [1, 2, 3]

insert before(["BPMN", "CMMN"], 1, "DMN") => ["DMN", "BPMN", "CMMN"]

list contains(list, element)

does list contain the element?

Parameters
Name Required Type Description

list

Yes

list

element

Yes

Any

Returns

Boolean

Examples
list contains([1,2,3], 2) => true

list contains(["DMN","BPMN","CMMN"], "XML") => false

list replace(list, position, newItem)

list item at position is replaced by newItem. Note that this function is not yet a standardized FEEL function.

Parameters
Name Required Type Description

list

Yes

list

position

Yes

Number

newItem

Yes

Any

Examples
list replace( [2, 4, 7, 8], 3, 6) => [2, 4, 6, 8]

list replace( ["B", "P", "M", "N"], 1, "C" ) => ["C", "P", "M", "N" ]

list replace(list, match, newItem)

list item matching the match function are replaced by newItem. Note that this function is not yet a standardized FEEL function.

Parameters
Name Required Type Description

list

Yes

list

match

Yes

function

newItem

Yes

Any

Examples
list replace( [2, 4, 7, 8], function(item, newItem) item < newItem, 5) => [5, 5, 7, 8]

list replace( ["B", "P", "M", "N"], function(item, newItem) item = "B", "C" ) => ["C", "P", "M", "N" ]

max(list)

returns maximum item

Parameters
Name Required Type Description

list

Yes

Collection of comparable items

Examples
max( [1, 2, 3] ) => 3

max( ["a", "b", "c" ]) => "c"

mean(list)

returns arithmetic mean(average) of numbers

Parameters
Name Required Type Description

list

Yes

Collection of Number

Returns

Number

Examples
mean([1, 2, 3]) => 2

mean(["a", "b", "c" ]) => null

median(list)

Returns the median element of the list of numbers. I.e., after sorting the list, if the list has an odd number of elements, it returns the middle element. If the list has an even number of elements, returns the average of the two middle elements. If the list is empty, returns null.

Parameters
Name Required Type Description

list

Yes

list

Returns

Number

Examples
median( 8, 2, 5, 3, 4 ) => 4

median([6, 1, 2, 3]) => 2.5

median([]) => null

min(list)

returns minimum item

Parameters
Name Required Type Description

list

Yes

Collection of comparable items

Examples
min( [1, 2, 3] ) => 1

min( ["DMN", "BPMN", "CMMN"] ) => "BPMN"

mode(list)

Returns the mode of the list of numbers. If the result contains multiple elements, they are returned in ascending order. If the list is empty, an empty list is returned.

Parameters
Name Required Type Description

list

Yes

list

Returns

Number

Examples
mode( 6, 3, 9, 6, 6 ) => [6]

mode( [6, 1, 9, 6, 1] )  => [1, 6]

mode([]) => []

product(list)

Returns the product of the numbers from the list.

Parameters
Name Required Type Description

list

Yes

list

Returns

Number

Examples
product(2, 3, 4) => 24

product([2, 3, 4]) => 24

product([]) => null

remove(list, position)

list with item at position removed

Parameters
Name Required Type Description

list

Yes

list

position

Yes

Number

Examples
remove( [1, 2, 3], 2) => [1, 3]

remove( ["B", "P", "M", "N"], 4 ) => ["B", "P", "M" ]

remove( ["B", "P", "M", "N"], "N" ) => null

reverse(list)

reverses the list

Parameters
Name Required Type Description

list

Yes

list

Examples
reverse( [1, 2, 3]) => [3, 2, 1]

reverse( ["Trisotech", "DMN"] ) => ["DMN", "Trisotech"]

sort(list, precedes)

sorts list using precedes, which is an ordering function

Parameters
Name Required Type Description

list

Yes

list

precedes

Yes

function

Examples
sort([3 ,5, 1, 4, 3, 2], function(x,y) x > y) => [5, 4, 3, 3, 2, 1]

sort([3, 1, 4, 5, 2] => [1, 2, 3, 4, 5]

stddev(list)

Returns the standard deviation of the list of numbers. If the list is empty, returns null.

Parameters
Name Required Type Description

list

Yes

list

Returns

Number

Examples
stddev( 2, 4, 7, 5 ) => 2.0816659994661

stddev([]) => null

sublist(list, start position, [length])

returns list of length from list, starting with list[start position]. First position is 1, last position is -l

Parameters
Name Required Type Description

list

Yes

list

start position

Yes

Number

length

No

Number

Examples
sublist( [1, 2, 3], 1, 2) => [1, 2]

sublist( ["DMN","BPMN","CMMN"], 2, 1) => ["BPMN"]

sum(list)

returns sum of numbers from list

Parameters
Name Required Type Description

list

Yes

Collection of Number

Returns

Number

Examples
sum([1, 2, 3]) => 6

sum( ["a", "b", "c" ]) => null

union(list)

concatenates with duplicate removal

Parameters
Name Required Type Description

list

Yes

list

Examples
union( [1,2] , [2,3] ) => [1, 2, 3]

union( ["Trisotech", "DMN"], ["BPMN", "DMN"] ) => ["Trisotech", "DMN", "BPMN"]