Lists
Collection functions
all(list)
returns false if any item is false, else true if empty or all items are true, else null
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
Collection of Boolean |
Boolean |
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
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
Collection of Boolean |
Boolean |
any( [5>=11, 2=3, false] ) => false
any( [true, true, false, true] ) => true
append(list, item)
returns a new list with items appended
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
|
item |
Yes |
Any |
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
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
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
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
Number |
count( [1, 2, 3] ) => 3
count( ["Trisotech","DMN"]) => 2
distinct values(list)
duplicate removal
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
distinct values([1, 2, 3, 2, 1]) => [1, 2, 3]
distinct values( ["DMN", "BPMN", "dmn" ] => ["DMN", "BPMN", "dmn"]
flatten(list)
flatten nested lists
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
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
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
|
match |
Yes |
Any |
Collection of Number |
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.
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
|
position |
Yes |
Number |
|
newItem |
Yes |
Any |
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
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
|
position |
Yes |
Number |
|
newItem |
Yes |
Any |
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?
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
|
element |
Yes |
Any |
Boolean |
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.
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
|
position |
Yes |
Number |
|
newItem |
Yes |
Any |
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.
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
|
match |
Yes |
function |
|
newItem |
Yes |
Any |
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
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
Collection of comparable items |
max( [1, 2, 3] ) => 3
max( ["a", "b", "c" ]) => "c"
mean(list)
returns arithmetic mean(average) of numbers
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
Collection of Number |
Number |
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.
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
Number |
median( 8, 2, 5, 3, 4 ) => 4
median([6, 1, 2, 3]) => 2.5
median([]) => null
min(list)
returns minimum item
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
Collection of comparable items |
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.
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
Number |
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.
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
Number |
product(2, 3, 4) => 24
product([2, 3, 4]) => 24
product([]) => null
remove(list, position)
list with item at position removed
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
|
position |
Yes |
Number |
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
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
reverse( [1, 2, 3]) => [3, 2, 1]
reverse( ["Trisotech", "DMN"] ) => ["DMN", "Trisotech"]
sort(list, precedes)
sorts list using precedes, which is an ordering function
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
|
precedes |
Yes |
function |
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.
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
Number |
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
| Name | Required | Type | Description |
|---|---|---|---|
list |
Yes |
list |
|
start position |
Yes |
Number |
|
length |
No |
Number |
sublist( [1, 2, 3], 1, 2) => [1, 2]
sublist( ["DMN","BPMN","CMMN"], 2, 1) => ["BPMN"]