LSPS documentation logo
LSPS Documentation
Functions

Collection

add(list* : List<E>, elements : E...) : List<E>

Returns a list created by adding the specified elements at the end of the list.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

add(set* : Set<E>, elements : E...) : Set<E>

Returns a set created by adding the specified elements to the set.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

add(collection* : Collection<E>, elements : E...) : Collection<E>

Returns a collection created by adding the specified elements at the end of the input collection. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

add(map* : Map<K, V>, key : K, value : V) : Map<K, V>

Returns a map created by adding the specified key-value pair to the map. If the key already exists in the map, the specified value overwrites the original one.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

addAll(list* : List<E>, index* : Integer, elements* : Collection<E>...) : List<E>

Returns a list created by adding the specified elements (given as collections) to the list, starting from the position specified by the index. Shifts the element currently at that position (if there is any) and any subsequent elements to the right and increments the indices of the shifted elements with the number of the elements added to the specified list. The original order of the added elements is preserved also in the returned list.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified index is out of range (index < 0 or index > size(list)).

addAll(set* : Set<E>, index* : Integer, elements* : Collection<E>...) : Set<E>

Returns a set created by adding the specified elements to the set parameter, starting from the position specified by the index. Shifts the element currently at that position (if there is any) and any subsequent elements to the right and increments the indices of the shifted elements with the number of the different elements added to the specified set. The original order of the added elements is preserved also in the returned set.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified index is out of range (index < 0 or index > size(set)).

addAll(collection* : Collection<E>, index* : Integer, elements* : Collection<E>...) : Collection<E>

Returns a collection created by adding the specified elements to the collection parameter, starting from the position specified by the index. Shifts the element currently at that position (if there is any) and any subsequent elements to the right and increments the indices of the shifted elements with the number of the elements added to the specified collection. The original order of the added elements is preserved also in the returned collection. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified index is out of range (index < 0 or index > size(collection)).

addAll(list* : List<E>, collections* : Collection<E>...) : List<E>

Returns a list created as concatenation of the list and collections.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

addAll(set* : Set<E>, collections* : Collection<E>...) : Set<E>

Returns a set created by concatenation of the set and collections.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

addAll(collections* : Collection<E>...) : Collection<E>

Returns a list created as concatenation of the specified lists. If the first input collection is a set, the returned type is Set. If the first input collection is a list, the returned type is List.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

addAll(maps* : Map<K, V>...) : Map<K, V>

Returns a map created as union of keys and their respective values from all specified maps. If more than one map contains the same key, its value is set to the value of the key specified by the most recent map containing that key.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

addAt(list* : List<E>, index* : Integer, elements : E...) : List<E>

Returns a list created by adding the specified elements to the list, starting from the position specified by the index. Shifts the element currently at that position (if there is any) and its subsequent elements (if any) to the right and increments the indices of the shifted elements with the number of the elements added to the list.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the index is out of range (index < 0 or index > size(list)).

addAt(set* : Set<E>, index* : Integer, elements : E...) : Set<E>

Returns a set created by adding the specified elements to the set parameter, starting from the position specified by the index. Shifts the element currently at that position (if there is any) and its subsequent elements (if any) to the right and increments the indices of the shifted elements with the number of the different elements added to the set.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the index is out of range (index < 0 or index > size(set)).

addAt(collection* : Collection<E>, index* : Integer, elements : E...) : Collection<E>

Returns a collection created by adding the specified elements to the collection, starting from the position specified by the index. Shifts the element currently at that position (if there is any) and its subsequent elements (if any) to the right and increments the indices of the shifted elements with the number of the elements added to the list. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the index is out of range (index < 0 or index > size(collection)).

collect(list* : List<E>, function* : {E : T}) : List<T>

Returns a list of values obtained by applying the function to each item of the list.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

collect(set* : Set<E>, function* : {E : T}) : Set<T>

Returns a set of values obtained by applying the function to each item of the set.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

collect(collection* : Collection<E>, function* : {E : T}) : Collection<T>

Returns a collection of values obtained by applying the function to each item of the input collection. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

collectWithIndex(list* : List<E>, function* : {Integer, E : T}) : List<T>

Returns a list of values obtained by applying the function to each item of the list.

The function parameter takes 2 values: index of the item and the item itself.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

collectWithIndex(set* : Set<E>, function* : {Integer, E : T}) : Set<T>

Returns a set of values obtained by applying the function to each item of the set. The function parameter takes 2 values: index of the item and the item itself.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

collectWithIndex(collection* : Collection<E>, function* : {Integer, E : T}) : Collection<T>

Returns a collection of values obtained by applying the function to each item of the collection. The function parameter takes 2 values: index of the item and the item itself.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

compact(list* : List<E>) : List<E>

Returns a list containing only non-null elements from a given list.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

compact(set* : Set<E>) : Set<E>

Returns a set containing only non-null elements from a given set.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

compact(collection* : Collection<E>) : Collection<E>

Returns a collection containing only non-null elements from a given collection.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

contains(collection* : Collection<Object>, elements : Object...) : Boolean

Returns true, if the collection contains all specified elements.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

containsAll(collection* : Collection<Object>, elements* : Collection<Object>) : Boolean

Returns true, if the collection contains all specified elements.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

containsKeys(map* : Map<Object, Object>, keys : Object...) : Boolean

Returns true, if the map contains all specified keys.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

containsValues(map* : Map<Object, Object>, values : Object...) : Boolean

Returns true, if the map contains all specified values.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

count(collection* : Collection<E>, condition* : {E : Boolean}) : Integer

Returns the number of elements in the given collection which satisfy the given condition.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

exists(collection* : Collection<E>, condition* : {E : Boolean}) : Boolean

Returns true, if the condition is true for at least one element in the collection.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

findIndex(collection* : Collection<E>, condition* : {E : Boolean}) : Integer

Returns the index of the first occurrence of the collection element which satisfies the specified condition; returns -1 if the condition is false for all elements of the collection.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

findIndex(collection* : Collection<E>, fromIndex : Integer, condition* : {E : Boolean}) : Integer

Returns the index of the first occurrence of the collection element, starting at fromIndex (inclusive), which satisfies the specified condition; returns -1 if the condition is false for all elements of the collection starting at fromIndex. If the fromIndex parameter is null or is less than 0, the finding starts from the beginning of the collection (index 0).

Throws:

  • "NullParameterError" - Mandatory parameter is null.

findIndex(collection* : Collection<E>, fromIndex : Integer, toIndex : Integer, condition* : {E : Boolean}) : Integer

Returns the index of the first occurrence of the collection element, starting at the fromIndex (inclusive) and ending at the toIndex (exclusive), which satisfies the specified condition; returns -1 if the condition is false for all elements in the specified range. If the fromIndex parameter is null or is less than 0, the finding starts from the beginning of the collection (index 0). If the toIndex parameter is null or greater or equal to the size of the collection, the finding ends at the end of the collection.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

findLastIndex(collection* : Collection<E>, condition* : {E : Boolean}) : Integer

Returns the index of the last occurrence of the collection element which satisfies the specified condition; returns -1 if the condition is false for all elements of the collection.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

findLastIndex(collection* : Collection<E>, toIndex : Integer, condition* : {E : Boolean}) : Integer

Returns the index of the last occurrence of the collection element which satisfies the specified condition, searching backwards starting at index toIndex - 1; returns -1 if no such element is found. If the toIndex parameter is null or greater or equal to the size of the collection, the finding starts at the end of the collection.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

findLastIndex(collection* : Collection<E>, fromIndex : Integer, toIndex : Integer, condition* : {E : Boolean}) : Integer

Returns the index of the last occurrence of the collection element, searching backwards in the range starting at fromIndex (inclusive) and ending at toIndex (exclusive), which satisfies the specified condition; returns -1 if the condition is false for all elements in the specified range. If the fromIndex parameter is null or is less than 0, the search ends at the beginning of the collection (index 0). If the toIndex parameter is null or greater or equal to the size of the collection, the finding starts at the end of the collection.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

fold(collection* : Collection<E>, initialValue : T, function* : {T, E : T}) : T

Combines the elements of the collection together using the binary function, from left to right, and starting with the initialValue. The function is applied iteratively on the previously computed interim value and a next element of the collection. In each iteration the function computes the subsequent interim value. The last computed value represents the result of the fold function.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

foldWithIndex(collection* : Collection<E>, initialValue : T, function* : {Integer, T, E : T}) : T

Combines the elements of the collection together using the binary function, from left to right, and starting with the initialValue. The function is applied iteratively on the previously computed interim value and a next element of the collection. In each iteration the function computes the subsequent interim value. The last computed value represents the result of the fold function. 0-based index of element is passed to function as the first argument.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

forAll(collection* : Collection<E>, condition* : {E : Boolean}) : Boolean

Returns true, if the condition is true for all elements in the collection.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

getFirst(collection* : Collection<E>) : E

Returns the first item of the collection, or null if the collection is empty.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

getItemType(collectionType* : Type<Collection<Object>>) : Type<Object>

Returns the inner Type of the collection.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

getLast(collection* : Collection<E>) : E

Returns the last item of the collection, or null if the collection is empty.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

hasDuplicates(collection* : Collection<Object>) : Boolean

Returns true if the collection contains duplicate elements, false otherwise.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

indexOf(collection* : Collection<Object>, element : Object) : Integer

Returns the index of the first occurrence of the specified element in the collection; returns -1 if the collection does not contain the specified element.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

isEmpty(collection* : Collection<Object>) : Boolean

Returns true, if the specified collection contains no elements.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

isEmpty(map* : Map<Object, Object>) : Boolean

Returns true, if the specified map contains no elements.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

isSubset(set1* : Set<Object>, set2* : Set<Object>) : Boolean

Returns true, if the set1 is a subset of the set2.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

join(collection* : Collection<Object>) : String

Concatenates all non-empty string representations of the objects within collection, separating them by comma and space (", ").

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

join(collection* : Collection<Object>, joinString : String) : String

Concatenates all non-empty string representations of the objects within collection, separating them by joinString.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

join(collection* : Collection<Object>, joinString : String, includeEmpty : Boolean) : String

Concatenates all string representations of the objects within collection, separating them by joinString. If includeEmpty is true, also null and empty strings are included in the result string.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

keys(map* : Map<K, V>) : Set<K>

Returns a set of keys contained in the specified map.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

keysOf(map* : Map<K, V>, element : V) : Set<K>

Returns the keys for all occurrences of the specified value included in the map.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

lastIndexOf(collection* : Collection<Object>, element : Object) : Integer

Returns the index of the last occurrence of the specified element in the collection; returns -1 if the collection does not contain the specified element.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

listUnion(collections : Collection<Collection<E>>...) : List<E>

Returns a list containing all elements from all given collections. Null values of collection are treated as empty collections.

map(keys* : Collection<K>, values* : Collection<V>) : Map<K, V>

Returns a map by combining collections of keys and values. The number of keys must be equal to the number of values. At least one key and one value must be specified in order to determine the type of the created map. If the keys parameter contains the same key several times, the most recently used key-value pair is included in the resulting map.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "WrongSizeError" if either the number of keys is not equal to the number of values, or one of the input collection is empty.

map(keys* : Collection<K>, valueFunction* : {K : V}) : Map<K, V>

Returns a map by combining given keys and computed values. For each key in the given collection of keys, the given closure is executed to obtain a map value.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

map(collection* : Collection<E>, keyFunction* : {E : K}, valueFunction* : {E : V}) : Map<K, V>

Returns a map by combining computed keys and computed values. For each element in the given collection, the keyFunction is executed to obtain a map key and valueFunction is executed to obtain a map value.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

max(collection* : Collection<Date>) : Date

Returns maximal value from collection; or null, if the collection is empty.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

max(collection* : Collection<Decimal>) : Decimal

Returns maximal value from collection; or null, if the collection is empty.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

max(collection* : Collection<Integer>) : Integer

Returns maximal value from collection; or null, if the collection is empty.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

max(collection* : Collection<String>) : String

Returns maximal value from collection; or null, if the collection is empty.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

min(collection* : Collection<Date>) : Date

Returns minimal value from collection; or null, if the collection is empty.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

min(collection* : Collection<Decimal>) : Decimal

Returns minimal value from collection; or null, if the collection is empty.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

min(collection* : Collection<Integer>) : Integer

Returns minimal value from collection; or null, if the collection is empty.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

min(collection* : Collection<String>) : String

Returns minimal value from collection; or null, if the collection is empty.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

notEmpty(collection* : Collection<Object>) : Boolean

Returns true, if the specified collection contains some elements.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

notEmpty(map* : Map<Object, Object>) : Boolean

Returns true, if the specified map contains some elements.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

remove(list* : List<E>, elements : Object...) : List<E>

Returns a list created by removing the first occurrences of the specified elements from the list.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

remove(set* : Set<E>, elements : Object...) : Set<E>

Returns a set created by removing the specified elements from the set.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

remove(collection* : Collection<E>, elements : Object...) : Collection<E>

Returns a collection created by removing the first occurrences of the specified elements from the collection. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

removeAll(list* : List<E>, elements* : Collection<Object>) : List<E>

Returns a list created by removing all occurrences of the elements from the list.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

removeAll(set* : Set<E>, elements* : Collection<Object>) : Set<E>

Returns a set created by removing all elements from the set.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

removeAll(collection* : Collection<E>, elements* : Collection<Object>) : Collection<E>

Returns a collection created by removing all occurrences of the elements from the collection. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

removeAt(list* : List<E>, index* : Integer) : List<E>

Returns a list created by removing that element of the list, which is at the position specified by the index.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified index is out of range (index < 0 or index >= size(list)).

removeAt(set* : Set<E>, index* : Integer) : Set<E>

Returns a set created by removing that element of the set, which is at the position specified by the index.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified index is out of range (index < 0 or index >= size(set)).

removeAt(collection* : Collection<E>, index* : Integer) : Collection<E>

Returns a collection created by removing that element of the collection, which is at the position specified by the index. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified index is out of range (index < 0 or index >= size(collection)).

removeKey(map* : Map<K, V>, keys : Object...) : Map<K, V>

Returns a map created by removing the specified keys (and their corresponding values) from the map.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

removeKeys(map* : Map<K, V>, keys* : Collection<Object>) : Map<K, V>

Returns a map created by removing the specified keys (and their corresponding values) from the map.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

removeRange(set* : Set<E>, fromIndex : Integer, toIndex : Integer) : Set<E>

Returns a portion of the set representing removing elements from the specified fromIndex (inclusive) to the toIndex (exclusive). If the fromIndex parameter is null or is less than 0, the range starts from the beginning of the collection (index 0). If the toIndex parameter is null or greater or equal to the size of the collection, the range ends at the end of the collection.

Throws:

  • "NullParameterError" - Mandatory parameter is null.
  • "OutOfBoundsError" - fromIndex > toIndex.

removeRange(list* : List<E>, fromIndex : Integer, toIndex : Integer) : List<E>

Returns a portion of the list representing removing elements from the specified fromIndex (inclusive) to the toIndex (exclusive). If the fromIndex parameter is null or is less than 0, the range starts from the beginning of the collection (index 0). If the toIndex parameter is null or greater or equal to the size of the collection, the range ends at the end of the collection.

Throws:

  • "NullParameterError" - Mandatory parameter is null.
  • "OutOfBoundsError" - fromIndex > toIndex.

removeRange(collection* : Collection<E>, fromIndex : Integer, toIndex : Integer) : Collection<E>

Returns a portion of the collection representing removing elements from the specified fromIndex (inclusive) to the toIndex (exclusive). If the fromIndex parameter is null or is less than 0, the range starts from the beginning of the collection (index 0). If the toIndex parameter is null or greater or equal to the size of the collection, the range ends at the end of the collection.

Throws:

  • "NullParameterError" - Mandatory parameter is null.
  • "OutOfBoundsError" - fromIndex > toIndex.

removeValue(map* : Map<K, V>, values : Object...) : Map<K, V>

Returns a map created by removing all occurrences of the specified values (and their corresponding keys) from the map.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

replace(list* : List<E>, element1 : Object, element2 : E) : List<E>

Returns a list created by replacing all occurrences of the element1 with the element2 in the specified list.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

replace(set* : Set<E>, element1 : Object, element2 : E) : Set<E>

Returns a set created by replacing the element1 with the element2 in the specified set.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

replace(collection* : Collection<E>, element1 : Object, element2 : E) : Collection<E>

Returns a collection created by replacing all occurrences of the element1 with the element2 in the specified collection. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

replaceValue(map* : Map<K, V>, value1 : Object, value2 : V) : Map<K, V>

Returns a map created by replacing all occurrences of the values corresponding to the value1 with the value2 in the specified map.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

retainAll(list* : List<E>, collections* : Collection<E>...) : List<E>

Returns a list of those elements of the list that are contained in the specified collections. The relative order of the retained elements remains unchanged.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

retainAll(set* : Set<E>, collections* : Collection<E>...) : Set<E>

Returns a set created by intersection of the specified sets.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

retainAll(collection* : Collection<E>, collections* : Collection<E>...) : Collection<E>

Returns a list of those elements of the collection that are contained in the specified collections. The relative order of the retained elements remains unchanged. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

reverse(list* : List<E>) : List<E>

Returns a list created by reversing the order of the elements in the specified list.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

reverse(set* : Set<E>) : Set<E>

Returns a set created by reversing the order of the elements in the specified set.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

reverse(collection* : Collection<E>) : Collection<E>

Returns a collection created by reversing the order of the elements in the specified collection.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

select(list* : List<E>, condition* : {E : Boolean}) : List<E>

Returns a list containing those elements from the list for which the condition is true.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

select(set* : Set<E>, condition* : {E : Boolean}) : Set<E>

Returns a set containing those elements from the set for which the condition is true.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

select(collection* : Collection<E>, condition* : {E : Boolean}) : Collection<E>

Returns a colection containing those elements from the input collection for which the condition is true. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

select(map* : Map<K, V>, condition* : {K, V : Boolean}) : Map<K, V>

Returns a map containing those elements from the map for which the condition is true.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

setAt(list* : List<E>, index* : Integer, element : E) : List<E>

Returns a list created by replacing that element of the list, which is at the position given by the index, with the specified element.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified index is out of range (index < 0 or index >= size(list)).

setAt(set* : Set<E>, index* : Integer, element : E) : Set<E>

Returns a set created by replacing that element of the set, which is at the position given by the index, with the specified element.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified index is out of range (index < 0 or index >= size(set)).

setAt(collection* : Collection<E>, index* : Integer, element : E) : Collection<E>

Returns a list created by replacing that element of the list, which is at the position given by the index, with the specified element. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified index is out of range (index < 0 or index >= size(collection)).

size(collection* : Collection<Object>) : Integer

Returns the number of elements in the specified collection.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

size(map* : Map<Object, Object>) : Integer

Returns the number of elements in the specified map.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

sort(list* : List<E>, comparator* : {E, E : Integer}) : List<E>

Returns items of the specified list ordered according to the given comparator. The comparator defines a total ordering function returning a negative integer, zero, or a positive integer if the first parameter is less than, equal to, or greater than the second, respectively.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

sort(set* : Set<E>, comparator* : {E, E : Integer}) : Set<E>

Returns items of the specified set ordered according to the given comparator. The comparator defines a total ordering function returning a negative integer, zero, or a positive integer if the first parameter is less than, equal to, or greater than the second, respectively.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

sort(collection* : Collection<E>, comparator* : {E, E : Integer}) : Collection<E>

Returns items of the specified collection ordered according to the given comparator. The comparator defines a total ordering function returning a negative integer, zero, or a positive integer if the first parameter is less than, equal to, or greater than the second, respectively. If the input collection is a set, the returned

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

sort(set* : Set<Date>, ascending* : Boolean) : Set<Date>

Returns a set with items sorted in ascending or descending order.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

sort(set* : Set<Decimal>, ascending* : Boolean) : Set<Decimal>

Returns a set with items sorted in ascending or descending order.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

sort(set* : Set<Integer>, ascending* : Boolean) : Set<Integer>

Returns a set with items sorted in ascending or descending order.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

sort(set* : Set<String>, ascending* : Boolean) : Set<String>

Returns a set with items sorted in ascending or descending order.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

sort(list* : List<Date>, ascending* : Boolean) : List<Date>

Returns a list with items sorted in ascending or descending order.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

sort(list* : List<Decimal>, ascending* : Boolean) : List<Decimal>

Returns a list with items sorted in ascending or descending order.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

sort(list* : List<Integer>, ascending* : Boolean) : List<Integer>

Returns a list with items sorted in ascending or descending order.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

sort(list* : List<String>, ascending* : Boolean) : List<String>

Returns a list with items sorted in ascending or descending order.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

sort(collection* : Collection<Date>, ascending* : Boolean) : Collection<Date>

Returns a collection with items sorted in ascending or descending order.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

sort(collection* : Collection<Decimal>, ascending* : Boolean) : Collection<Decimal>

Returns a collection with items sorted in ascending or descending order.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

sort(collection* : Collection<Integer>, ascending* : Boolean) : Collection<Integer>

Returns a collection with items sorted in ascending or descending order.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

sort(collection* : Collection<String>, ascending* : Boolean) : Collection<String>

Returns a collection with items sorted in ascending or descending order.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

subList(list* : List<E>, fromIndex : Integer, toIndex : Integer) : List<E>

Returns a list representing such a portion of the list, which starts from the specified fromIndex (inclusive) to the toIndex (exclusive). If the fromIndex parameter is null or is less than 0, the sub-list starts from the beginning of the list (index 0). If the toIndex parameter is null or equal/greater than the size of the list, the sub-list ends at the end of the list (index given by size(list)-1).

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if fromIndex > toIndex.

subCollection(collection* : Collection<E>, fromIndex : Integer, toIndex : Integer) : Collection<E>

Returns a collection representing such a portion of the collection, which starts from the specified fromIndex (inclusive) to the toIndex (exclusive). If the fromIndex parameter is null or is less than 0, the sub-list starts from the beginning of the list (index 0). If the toIndex parameter is null or equal/greater than the size of the collection, the sub-collection ends at the end of the collection (index given by size(collection)-1).

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if fromIndex > toIndex.

subset(set* : Set<E>, fromIndex : Integer, toIndex : Integer) : Set<E>

Returns a set representing such a portion of the collection, which starts from the specified fromIndex (inclusive) to the toIndex (exclusive). If the fromIndex parameter is null or is less than 0, the sub-list starts from the beginning of the list (index 0). If the toIndex parameter is null or equal/greater than the size of the collection, the sub-collection ends at the end of the collection (index given by size(set)-1).

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if fromIndex > toIndex.

sum(collection* : Collection<E>) : E

Returns a sum of decimal or integer numbers in the given collection.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

toList(collection* : Collection<E>) : List<E>

Returns a list of values, in an arbitrary order, contained in the specified collection.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

toSet(collection* : Collection<E>) : Set<E>

Returns a set of values contained in the specified list.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

values(map* : Map<K, V>) : List<V>

Returns a list of values contained in the specified map.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

Binary Data

createBinaryHandle(fileName* : String, description : String, content* : String, mime : String, charset : String) : BinaryHandleSIDE EFFECTDEPRECATED

Creates a binary handle representing a newly created file with the specified fileName, content, description, mime type and charset encoding. If the mime parameter is not specified, the MIME type is determined from the file extension automatically. If the charset is not specified, "UTF-8" is used by default.

Throws:

  • "NullParameterError" if mandatory parameter is null.
  • "UnsupportedEncodingError" - The specified charset is not supported.

getBinaryHandle(id* : Integer) : BinaryHandleDEPRECATED

Returns a binary handle of the specified identifier.

Throws:

  • "NullParameterError" if mandatory parameter is null.
  • "BinaryHandleNotFoundError" if there is no such a binary handle.

getBinaryHandleMetadata(binaryData* : core::BinaryHandle) : Map<String, String>

Returns a binary handle metadata

Throws:

  • "NullParameterError" if mandatory parameter is null.

resource(module* : String, path* : String) : BinaryHandleSIDE EFFECTDEPRECATED

Creates a binary handle from a module's resource located at the specified path.

Throws:

  • "NullParameterError" if mandatory parameter is null.
  • "ResourceNotFoundError" if the specified module is not available or the resource is not found at the given path.

getResource(module* : String, path* : String) : File

Creates a file from a module's resource located at the specified path.

Throws:

  • "NullParameterError" if mandatory parameter is null.
  • "ResourceNotFoundError" if the specified module is not available or the resource is not found at the given path.

size(binary : Binary) : Integer

Returns the size of the binary data in bytes.

toBinary(string : String) : Binary

Converts the specified string to binary.

toString(binary* : Binary, charset : String) : String

Converts binary data to a string encoded by given charset. Standard charset strings are defined in java.nio.charset.StandardCharsets.

Possible values: US-ASCII, ISO-8859-1, UTF-8, UTF-16BE, UTF-16LE, UTF-16, etc.

Throws:

  • "NullParameterError" if mandatory parameter is null.
  • "UnsupportedEncodingError" if encoding is unsupported.

Enumeration

literals(enumeration* : Type<E>) : List<E>

Returns a list of literals from the specified enumeration.

Throws:

  • “NullParameterError” if mandatory parameter is null.

literalToName(literal* : Enumeration) : String

Transforms the specified enumeration literal to its name represented as string.

Throws:

  • “NullParameterError” if mandatory parameter is null.

nameToLiteral(enumeration* : Type<E>, name* : String) : E

Transforms the specified enumeration’s literal name to the corresponding literal value.

Throws:

  • “NullParameterError” if mandatory parameter is null.
  • “DoesNotExistError” if the specified name does not corespond to any literal.

Validation

validate(record : Record, property : Property, tags : Collection<Tag>, context : Map<String, Object>) : List<ConstraintViolation>

Performs a validation of the given record.

If the record is null, an empty list is returned. If the given property parameter is null, all properties of the record are validated.

Throws:

  • “IncompatibleTypeError” - if the given property is not a property of the given record

validate(record : Collection<Record>, property : Property, tags : Collection<Tag>, context : Map<String, Object>) : List<ConstraintViolation>

Performs a validation of the given collection of records.

If the collection is null, an empty list is returned. Null elements in the collection are ignored. If the given property parameter is null, all properties of the records are validated.

Throws:

  • “IncompatibleTypeError” - if the given property is not a property of any given record in the collection

findTag(name* : String) : Tag

Finds a tag by a given name which can be a simple name or full name. Returns <code>null</code> if the tag is not found. If the simple name is given and it is ambiguous (meaning there are more validation tags with the same name located in different imported modules), an error is thrown.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "AmbiguousNameError" if the given name is ambiguous

String

length(string* : String) : Integer

Returns the length of the specified string.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

toInteger(string* : String) : Integer

If possible, converts the specified string to an integer. If not possible, the function throws a runtime exception.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "FormatError" if the string does not represents an integer value.

toDecimal(string* : String) : Decimal

If possible, converts the specified string to a decimal. If not possible, the function throws a runtime exception.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "FormatError" if the string does not represent a decimal value.

toString(object : Object) : String

Converts the specified object to a string.

toLowerCase(string* : String) : String

Converts all characters of the specified string to lower case.

Throws:

  • "NullParameterError" if mandatory parameter is null.

toUpperCase(string* : String) : String

Converts all characters of the specified string to upper case.

Throws:

  • "NullParameterError" if mandatory parameter is null.

indexOf(string* : String, substring* : String) : Integer

Returns the index of the first occurrence of the specified substring within the string.

Throws:

  • "NullParameterError" if mandatory parameter is null.

indexOf(string* : String, substring* : String, fromIndex* : Integer) : Integer

Returns the index of the first occurrence of the specified substring within the string, starting at the specified index.

Throws:

  • "NullParameterError" if mandatory parameter is null.
  • "OutOfBoundsError" if the index is out of range (index < 0 or index >= length(string)).

lastIndexOf(string* : String, substring* : String) : Integer

Returns the index of the rightmost occurrence of the specified substring within the string.

Throws:

  • "NullParameterError" if mandatory parameter is null.

lastIndexOf(string* : String, substring* : String, fromIndex* : Integer) : Integer

Returns the index of the last occurrence of the specified substring within the string, searching backward starting at the specified index.

Throws:

  • "NullParameterError" if mandatory parameter is null.
  • "OutOfBoundsError" if the index is out of range (index < 0 or index >= length(string)).

matches(string* : String, regexp* : String) : Boolean

Returns true, if the specified string matches the regular expression given by the regexp parameter, otherwise returns false. The Java regular expression syntax (as defined in the java.util.regex.Pattern class) is used.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

substring(string* : String, fromIndex : Integer, toIndex : Integer) : String

Returns a substring of the specified string starting at the position (inclusive) given by the fromIndex parameter and ending at the position (exclusive) given by the toIndex parameter. If the specified fromIndex is null or is less than 0, the substring starts from beginning of the string (index 0). If the specified toIndex is null or equal/higher than the length of the string, the substring ends at the end of the string (index given by length(string)-1). Throws a runtime exception if fromIndex > toIndex.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if fromIndex > toIndex.

replaceFirst(string* : String, regexp* : String, replacement* : String) : String

Replaces the first substring of the specified string that matches the regular expression given by the regexp parameter with the string specified by the replacement parameter. The Java regular expression syntax (as defined in the java.util.regex.Pattern class) is used.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

replaceAll(string* : String, regexp* : String, replacement* : String) : String

Replaces each substring of the specified string that matches the regular expression given by the regexp parameter with the string specified by the replacement parameter. The Java regular expression syntax (as defined in the java.util.regex.Pattern class) is used.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

split(string* : String, regexp* : String) : List<String>

Splits the specified string around matches of the regular expression given by the regexp parameter. The Java regular expression syntax (as defined in the java.util.regex.Pattern class) is used.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

find(string* : String, regexp* : String) : List<String>

Finds all occurrences of the regexp in the specified string. All the matched strings are returned as a list of strings. The function returns an empty list if there is no match. The Java regular expression syntax (as defined in the java.util.regex.Pattern class) is used.

Throws:

  • "NullParameterError" - if mandatory parameter is null.

format(pattern* : String, arguments : Object...) : String

Returns a string created by formatting the objects given by the arguments parameter with the format specified by the pattern parameter. The pattern parameter uses the syntax defined in the java.util.Formatter Java class restricted to formatting commands applied only for Java data types used to internally represent GO-BPMN expression language data types. The data types are transformed according to the following table:

Boolean -> java.lang.Boolean

String -> java.lang.String

Date -> java.util.Date

Integer -> java.math.BigDecimal

Decimal -> java.math.BigDecimal

all other data types -> java.lang.String using the function core::toString

The format() function uses a server locale for formatting numbers and dates.

Note: The format() function returns incorrect value of time zone offset from GMT for Daylight Saving Time (“$tz” or “$Tz” conversions) on Java 6. It is recommended to use formatDate() function for formatting dates. Java 7 returns correct values of time zone offset.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "FormatError" if the specified format is incorrect.

formatWithLocale(pattern* : String, locale : String, arguments : Object...) : String

Returns a string created by formatting the objects given by the arguments parameter with the format specified by the pattern parameter. The pattern parameter uses the syntax defined in the java.util.Formatter Java class restricted to formatting commands applied only for Java data types used to internally represent GO-BPMN expression language data types. The data types are transformed according to the following table:

Boolean -> java.lang.Boolean

String -> java.lang.String

Date -> java.Functions.Date

Integer -> java.math.BigDecimal

Decimal -> java.math.BigDecimal

all other data types -> java.lang.String using the function core::toString

The locale parameter determines a locale used for formatting numbers and dates. If it is null, the server locale is used.

Note: The formatWithLocale() function returns incorrect value of time zone offset from GMT for Daylight Saving Time (“$tz” or “$Tz” conversions) on Java 6. It is recommended to use formatDate() function for formatting dates. Java 7 returns correct values of time zone offset.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "FormatError" if the specified format is incorrect.

trim(string* : String) : String

Returns a copy of the specified string, while omitting the leading and trailing whitespaces.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

localize(string* : String, language* : String) : String

Replaces all localizable substrings in the string parameter by the corresponding localized strings from the specified language.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

XML

parseXml(xml* : String, resultType* : Type<E>) : ESIDE EFFECT

Parses XML document to internal data structures. The xml parameter represents the XML document to parse and the resultType parameter determines the type of the returned data. The referred type must be record type, otherwise an exception is thrown.

Throws:

  • “NullParameterError” - Mandatory parameter is null.
  • “IncompatibleTypeError” - The resultType parameter is not record.
  • “UnableToParseXmlError” - The specified xml cannot be parsed.

convertToXml(object* : Object) : String

Converts internal data structures passed to the object parameter to XML document. The object parameter must be an instance of a record type, otherwise an exception is thrown. The function returns a string which represents the output XML document.

Throws:

  • “NullParameterError” - Mandatory parameter is null.
  • “IncompatibleTypeError” - The type of the object is not record.
  • “UnableToConvertToXmlError” - An error occurred during conversion.

Goal Reflection

activate(goals : Collection<Goal>) : Null

(Re)activates inactive or finished goals. If a goal from the collection is active, the goal status remains unchanged.

Throws:

  • "NullParameterError" if mandatory parameter is not specified.
  • "FinishedProcessInstanceError" if the process instance of any activated goal is finished.

deactivate(goals : Collection<Goal>) : Null

Deactivates not finished goals. If a goal from the collection is finished or the goal’s process is finished, the goal status remains unchanged.

Throws:

  • "NullParameterError" if mandatory parameter is not specified.

isInState(goalPlan* : GoalPlan, state : String) : Boolean

Returns true, if the goal or the plan referenced by the goalPlan parameter is in the specified state or any of its sub-states. If the goal or plan parameter is specified correctly, but the state parameter contains an incorrect string representation of a state or is null, the function returns false.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

alive() : StringDEPRECATED

Returns a string representing "Alive" state.

Deprecated. Replaced by constant ALIVE.

notFinished() : StringDEPRECATED

Returns a string representing "Not finished" state.

Deprecated. Replaced by constant NOT_FINISHED.

inactive() : StringDEPRECATED

Returns a string representing "Inactive" state.

Deprecated. Replaced by constant INACTIVE.

active() : StringDEPRECATED

Returns a string representing "Active" state.

Deprecated. Replaced by constant ACTIVE.

ready() : StringDEPRECATED

Returns a string representing "Ready" state.

Deprecated. Replaced by constant READY.

running() : StringDEPRECATED

Returns a string representing "Running" state.

Deprecated. Replaced by constant RUNNING.

finished() : StringDEPRECATED

Returns a string representing "Finished" state.

Deprecated. Replaced by constant FINISHED.

achieved() : StringDEPRECATED

Returns a string representing "Achieved" state.

Deprecated. Replaced by constant ACHIEVED.

failed() : StringDEPRECATED

Returns a string representing "Failed" state.

Deprecated. Replaced by constant FAILED.

deactivated() : StringDEPRECATED

Returns a string representing "Deactivated" state.

Deprecated. Replaced by constant DEACTIVATED.

Number

abs(number* : Decimal) : Decimal

Returns an absolute value of the number.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

abs(number* : Integer) : Integer

Returns an absolute value of the number.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

min(numbers* : Decimal...) : Decimal

Returns the minimal number from a list of decimals.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

min(numbers* : Integer...) : Integer

Returns the minimal number from a list of integers.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

max(numbers* : Decimal...) : Decimal

Returns the maximal number from a list of decimals.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

max(numbers* : Integer...) : Integer

Returns the maximal number from a list of integers.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

roundCeiling(number* : Decimal) : Integer

Returns rounding of the specified number towards positive infinity.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

roundDown(number* : Decimal) : Integer

Returns rounding of the specified number towards zero.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

roundFloor(number* : Decimal) : Integer

Returns rounding of the specified number towards negative infinity.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

roundHalfDown(number* : Decimal) : Integer

Returns rounding of the specified number towards the "nearest neighbor"; if both neighbors are equidistant, rounds down.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

roundHalfEven(number* : Decimal) : Integer

Returns rounding of the specified number towards the "nearest neighbor"; if both neighbors are equidistant, rounds towards the even neighbor.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

roundHalfUp(number* : Decimal) : Integer

Returns rounding of the specified number towards the "nearest neighbor"; if both neighbors are equidistant, rounds up.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

roundUp(number* : Decimal) : Integer

Returns rounding of the specified number away from zero.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

scale(number* : Decimal) : Integer

Returns the scale of the specified number.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

setScale(number* : Decimal, scale : Integer, roundingMode : {Decimal : Integer}) : Decimal

Returns a decimal with the specified scale, and the unscaled value of which is determined by multiplying or dividing the unscaled value of the number by the appropriate power of ten to maintain its overall value. If the scale is reduced by the operation, the unscaled value must be divided and the specified roundingMode is applied to the division. Formally, it can be expressed as roundingMode(number * (10 ** scale)) / (10** scale).

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

random() : Decimal

Returns a pseudorandom, uniformly distributed decimal value between 0.0 (inclusive) and 1.0 (exclusive).

random(upperBound* : Integer) : Integer

Returns a pseudorandom, uniformly distributed integer between 0 (inclusive) and the specified upperBound (exclusive).

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

Model Reflection and Execution

createModelInstance(synchronous* : Boolean, model* : Model, properties : Map<String, String>) : ModelInstanceSIDE EFFECT

Returns a new instance of the model having the specified initialization properties. If the properties is null, an empty map is created in the instantiated model. If the synchronous parameter is set to true, the model interpretation phase is performed synchronously and execution of the containing expression waits until its finish. If the synchronous parameter is set to false, the model interpretation phase is performed asynchronously and execution of the containing expression does not wait until its finish. For usage this function in actions of documents, it is recommended to set the synchronous parameter to true, and for usage in processes it is recommended to set the parameter value to false.

Throws:

  • “NullParameterError” - Mandatory parameter is null.
  • “ModelInstantiationError” - The model instance did not start due to an internal initiation error.
  • “ModelInterpretationError” - The model instance did not start due to an internal model interpretation (startup) error.

findModelInstances(model : String, version : String, isRunning : Boolean, properties : Map<String, String>) : Set<ModelInstance>

Returns a set of model instances satisfying the specified filtering criteria. If the corresponding fields of a model instance match the patterns specified as function parameters, the model instance is included in the resulting set. All strings in parameters, including the properties parameter, are specified as wildcard strings patterns. A wildcard string can contain the following wildcards: "*" matching none or several arbitrary characters, and "?" matching exactly one arbitrary character. Any other character in patterns matches itself. Value of the isRunning parameter must match exactly. null specified as the pattern value matches any value of the model instance field (which is equivalent to the "*" pattern). All the specified properties must occur also in the selected model instances.

findModels(name : String, version : String, latestOnly : Boolean) : Set<Model>

Returns a set of all uploaded models satisfying the specified filtering criteria. If the corresponding fields of a model match the patterns specified as function parameters, the model is included in the resulting set. All strings in parameters are specified as wildcard strings patterns. A wildcard string can contain the following wildcards: "*" matching none or several arbitrary characters, and "?" matching exactly one arbitrary character. Any other character in patterns matches itself. ‘null’ specified as the pattern value matches any value of the model field (which is equivalent to the "*" pattern). Setting the latestOnly parameter to true causes including only the most recently uploaded models with given name and version, if there are several models with the same name and version on the server. If the latestOnly parameter is set to false, all models satisfying the filtering criteria are returned; the returned set can contain several models of the same name and version.

findProcessInstances(filter : {ProcessInstance : Boolean}) : Set<ProcessInstance>

Returns a set of process instances generated by this model instance up to this point and satisfying the specified filtering criteria. The criteria specified by the filter parameter are given as a Boolean closure with one formal parameter of the type ProcessInstance. If the Boolean expression returns true for a process instance, the process instance is included in the resulting set. If filter is null, all process instances are returned.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

findProcessInstances(modelInstance : ModelInstance, filter : {ProcessInstance : Boolean}) : Set<ProcessInstance>

Returns a set of process instances generated by the specified model instance up to this point and satisfying the specified filtering criteria. The criteria specified by the filter parameter are given as a Boolean closure with one formal parameter of the type ProcessInstance. If the Boolean expression returns true for a process instance, the process instance is included in the resulting set. If filter is null, all process instances are returned.

WARNING: Execution of this function can be relatively slow if accessing a model instance which is not currently loaded in memory.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

getModel(name* : String) : Model

Returns a model with the specified name. If there are several models with the same name (and any version), the most recently uploaded model is returned. Unloaded models are ignored.

Mandatory parameters:

-name

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "ModelNotFoundError" if there is no such a model.

getModel(name* : String, version* : String) : Model

Returns a model with the specified name and version. If there are several models with the same name and version on the server, the most recently uploaded model is returned.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "ModelNotFoundError" if there is no such a model.

getModelInstance(id* : Decimal) : ModelInstance

Returns a model instance with the specified id.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "ModelInstanceNotFoundError" if there is no such a model instance.

getModelInstanceProperties(modelInstance* : ModelInstance) : Map<String, String>

Returns a map of initialization properties of the specified model instance.

Throws:

  • "NullParameterError" if mandatory parameter is null.

thisModel() : Model

Returns the model from which context the function was executed.

thisModelInstance() : ModelInstance

Returns the model instance that executed the function. Returns null if executed from document.

thisProcessInstance() : ProcessInstance

Returns the process instance that executed the function; or null, if the function is executed in the global context of a module.

sendSignal(synchronous* : Boolean, recipients* : Set<ModelInstance>, signal* : Object) : NullSIDE EFFECT

Sends a signal object to the specified recipients. If the synchronous parameter is set to true, the signal is sent synchronously and execution of the containing expression waits until the signal is received by recipients. If the synchronous parameter is set to false, the signal is sent asynchronously and execution of the containing expression does not wait until the signal is received by recipients. The function returns always null.

Throws:

  • “NullParameterError” - Mandatory parameter is null.
  • “SendSignalError” - Sending or receiving of the signal was not successful.

throwEscalation(code* : String, payload : Object) : NullSIDE EFFECT

Throws an escalation with the specified code and payload. This function should be called only from an expression enclosed in a process that can handle the escalation. Otherwise, calling of this function has no effect. The function returns always null.

Throws:

  • "NullParameterError" - Mandatory parameter is null.

Date

+(date : Date, duration : Duration) : Date

Binary operator which returns a date obtained by adding the duration to the date.

+(duration : Duration) : Duration

Unary operator which returns the specified duration.

+(duration1 : Duration, duration2 : Duration) : Duration

Binary operator which returns a duration obtained by adding the values of the corresponding fields of duration1 and duration2.

-(date : Date, duration : Duration) : Date

Binary operator which returns a date obtained by subtracting the duration from the date.

-(date1 : Date, date2 : Date) : Duration

Binary operator which returns a duration obtained by subtracting date2 from date1. The resulting duration is in the "normal form"; i.e., it has the highest possible values (taken in absolute values) in highly ranked fields. If date2 > date1, the resulting duration is negative, i.e., all its fields are negative.

-(duration : Duration) : Duration

Unary operator which returns a duration obtained by negating of each field of the specified duration.

-(duration1 : Duration, duration2 : Duration) : Duration

Binary operator which returns a duration obtained by subtracting each field of duration2 from the corresponding field of duration1.

*(duration : Duration, number : Decimal) : Duration

Binary operator which returns a duration obtained by multiplying each field of the duration by the specified number and rounding the value down.

*(number : Decimal, duration : Duration) : Duration

Binary operator which returns a duration obtained by multiplying each field of the duration by the specified number and rounding the value down.

date(year* : Integer, month* : Integer, dayOfMonth* : Integer) : Date

Creates a date from the values given by the following parameters: year, month (month of year), and dayOfMonth. The created date is given as a sum of all parameter values; i.e., the number of years is added up with the number of months, and then with the number of days of a month. There are no limitations on parameter values.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

date(year* : Integer, month* : Integer, dayOfMonth* : Integer, hour* : Integer, minute* : Integer, second* : Integer, millis* : Integer) : Date

Creates a date from the values given by the following parameters: year, month (month of year), dayOfMonth, hour (hour of day), minute (minute of hour), second (second of minute), and millis (millisecond of second). The created date is given as a sum of all parameter values; i.e., the number of years is added up with the number of months, then with the number of days of a month, then with the number of hours, etc. There are no limitations on parameter values.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

date(string* : String) : Date

Creates a date from the specified string. The format of the input string is a subset of formats given by ISO 86011. It is possible to specify date with the format <date>, or time with the format ‘T’<time>, or to combine dates with times with the format <date>’T’<time>.

The following formats of dates are allowed: yyyy, yyyy-MM, yyyy-MM-dd, yyyy-DDD, yyyy-Www, and yyyy-Www-e; where yyyy stands for year (0000-9999), MM stands for month in year (01-12), dd stands for day in month (01-31), DDD stands for day in year (001-365), Www stands for week number prefixed by the letter ‘W’ (W01-W53), and e stands for day in week (1-7).

The following formats of times are allowed: HH, HH:mm, and HH:mm:ss; where HH stands for hour in day (00-23), mm stands for minute in hour (00-59), and ss stands for second in minute (00-59). The following formats of time zones are allowed: <time>’Z’, <time>±HH, <time>±HH:mm, and <time>±HH:mm:ss; where ‘Z’ is used for UTC. Decimal fractions, separated either by comma or by dot, may also be added to hours, minutes or seconds.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "FormatError" if the string parameter does not conform to the specified format.
  • "OutOfBoundsError" if the string parameter does not represent a correct date.

date(string* : String, pattern* : String) : Date

Creates a date from the specified string, which adheres to the format given by the pattern parameter. The pattern string uses the format defined in the java.text.SimpleDateFormat Java class.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "FormatError" if the pattern parameter does not conform to the specified format, or the string parameter does not conform to the pattern.
  • "OutOfBoundsError" if the string parameter does not represent a correct date.

formatDate(date* : Date, pattern* : String, timeZone : String) : String

Returns a string created by formatting the date to the specified pattern. The formatted date can also be transformed to a time zone given by the timeZone parameter. The pattern and timeZone parameters use the syntax defined in the Joda class org.joda.time.format.DateTimeFormat. The syntax is described in the date(string, pattern) function in more details.

Throws:

  • “NullParameterError” if mandatory parameter are not specified.
  • “FormatError” if specified format or timeZone is incorrect.

getDayOfMonth(date* : Date) : Integer

Returns the day of the month of the specified date.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

getDayOfWeek(date* : Date) : Integer

Returns the day of the week of the specified date.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

getDayOfYear(date* : Date) : Integer

Returns the day of the year of the specified date.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

getHour(date* : Date) : Integer

Returns the hour of the day of the specified date.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

getMillis(date* : Date) : Integer

Returns the millisecond of the second of the specified date.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

getMinute(date* : Date) : Integer

Returns the minute of the hour of the specified date.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

getMonth(date* : Date) : Integer

Returns the month of the year of the specified date.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

getSecond(date* : Date) : Integer

Returns the second of a minute of the specified date.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

getWeek(date* : Date) : Integer

Returns the week of the year of the specified date.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

getYear(date* : Date) : Integer

Returns the year of the specified date.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

intervalInDays(date1* : Date, date2* : Date) : Integer

Returns the number of days between two dates, date2 - date1. If date1 > date2, the resulting number is negative.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

intervalInHours(date1* : Date, date2* : Date) : Integer

Returns the number of hours between two dates, date2 - date1. If date1 > date2, the resulting number is negative.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

intervalInMillis(date1* : Date, date2* : Date) : Integer

Returns the number of milliseconds between two dates, date2 - date1. If date1 > date2, the resulting number is negative.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

intervalInMinutes(date1* : Date, date2* : Date) : Integer

Returns the number of minutes between two dates, date2 - date1. If date1 > date2, the resulting number is negative.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

intervalInMonths(date1* : Date, date2* : Date) : Integer

Returns the number of months between two dates, date2 - date1. If date1 > date2, the resulting number is negative.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

intervalInSeconds(date1* : Date, date2* : Date) : Integer

Returns the number of seconds between two dates, date2 - date1. If date1 > date2, the resulting number is negative.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

intervalInWeeks(date1* : Date, date2* : Date) : Integer

Returns the number of weeks between two dates, date2 - date1. If date1 > date2, the resulting number is negative.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

intervalInYears(date1* : Date, date2* : Date) : Integer

Returns a number of years between two dates, date2 - date1. If date1 > date2, the resulting number is negative.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

setDate(date* : Date, year* : Integer, month* : Integer, dayOfMonth* : Integer) : Date

Returns a copy of the specified date with the fields given by year, month, and dayOfMonth parameters updated.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if any of the parameters is out of range (month < 1 or month > 12 or dayOfMonth < 1 or dayOfMonth > number of days in the month and year).

setDayOfMonth(date* : Date, dayOfMonth* : Integer) : Date

Returns a copy of the specified date with the dayOfMonth field updated.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified dayOfMonth is out of range (dayOfMonth < 1 or dayOfMonth > number of days in the date's month and year).

setDayOfWeek(date* : Date, dayOfWeek* : Integer) : Date

Returns a copy of the specified date with the dayOfWeek field updated.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified dayOfWeek is out of range (dayOfWeek < 1 or dayOfWeek > 7).

setDayOfYear(date* : Date, dayOfYear* : Integer) : Date

Returns a copy of the specified date with the dayOfYear field updated.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified dayOfYear is out of range (dayOfYear < 1 or dayOfYear > 365 or 366, depending on the year).

setHour(date* : Date, hour* : Integer) : Date

Returns a copy of the specified date with the hour (meaning an hour of a day) field updated.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified hour is out of range (hour < 0 or hour > 23).

setMillis(date* : Date, millis* : Integer) : Date

Returns a copy of the date with the specified millis (meaning a millisecond of a second) field updated.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified smillis is out of range (millis < 0 or millis > 999).

setMinute(date* : Date, minute* : Integer) : Date

Returns a copy of the date with the specified minute (meaning a minute of an hour) field updated.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified minute is out of range (minute < 0 or minute > 59).

setMonth(date* : Date, month* : Integer) : Date

Returns a copy of the specified date with the month field updated.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified month is out of range (month < 1 or month > 12).

setSecond(date* : Date, second* : Integer) : Date

Returns a copy of the date with the specified second (meaning a second of a minute) field updated.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified second is out of range (second < 0 or second > 59).

setTime(date* : Date, hour* : Integer, minute* : Integer, second* : Integer, millis* : Integer) : Date

Returns a copy of the specified date with the fields given by the hour (meaning an hour of a day), minute (meaning a minute of an hour), second (meaning a second of a minute), and millis (meaning a millisecond of a second) parameters updated.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if any of the parameters is out of range (hour < 0 or hour > 23 or minute < 0 or minute > 59 or second < 0 or second > 59 or millis < 0 or millis > 999).

setWeek(date* : Date, week* : Integer) : Date

Returns a copy of the specified date with the week (meaning a week of a year) field updated.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "OutOfBoundsError" if the specified week is out of range (week < 1 or week > 52).

setYear(date* : Date, year* : Integer) : Date

Returns a copy of the specified date with the year field updated.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

now() : Date

Returns the current date and time.

today() : Date

Returns the current date in the time zone of the LSPS Server, without specifying the time.

millis(number* : Integer) : Duration

Returns a duration with the specified number of milliseconds.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

seconds(number* : Integer) : Duration

Returns a duration with the specified number of seconds.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

minutes(number* : Integer) : Duration

Returns a duration with the specified number of minutes.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

hours(number* : Integer) : Duration

Returns a duration with the specified number of hours.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

days(number* : Integer) : Duration

Returns a duration with the specified number of days.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

weeks(number* : Integer) : Duration

Returns a duration with the specified number of weeks.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

months(number* : Integer) : Duration

Returns a duration with the specified number of months.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

years(number* : Integer) : Duration

Returns a duration with the specified number of years.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

max(dates* : Date...) : Date

Returns the maximal date from a list of dates.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

min(dates* : Date...) : Date

Returns the minimal date from a list of dates.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

Record

deleteRecords(records* : Record...) : NullSIDE EFFECT

Deletes the specified records and all related data links navigable from the deleted records. Works for shared and for non-shared records. Values of deleted records become null in all slots (variables, function or task call parameters, etc.) referring to those records.

Throws:

  • "NullParameterError" if mandatory parameter is null.
  • "RecordNotFoundError" if the records parameter contains a shared record with incorrect reference to a database record.

deleteRecords(records* : Collection<Record>) : NullSIDE EFFECT

Deletes the specified records and all related data links navigable from the deleted records. Works for shared and for non-shared records. Values of deleted records become null in all slots (variables, function or task call parameters, etc.) referring to those records. If the record is referred to from a collection or a key in a map, it is removed.

Throws:

  • "NullParameterError" if mandatory parameter is null.
  • "RecordNotFoundError" if the records parameter contains a shared record with incorrect reference to a database record.

createInstance(recordType : Type<Record>, properties : Map<String, Object>) : T

Creates and returns new instance of record type T. If the properties are specified, the instance is initialized with the specified values of properties.

Throws:

  • "NullParameterError" if mandatory parameter is not specified.
  • "IncompatibleTypeError" if the specified properties do not belong to the specified record type.

Property

getPropertyName(property* : Property) : String

Returns the property name.

Throws:

  • "NullParameterError" if mandatory parameter is null.

getPropertyType(property* : Property) : Type<Object>

Returns the property type.

Throws:

  • "NullParameterError" if mandatory parameter is null.

getPropertyRecordType(property* : Property) : Type<Record>

Returns the property record type. It is the record type where the given property is declared.

Throws:

  • "NullParameterError" if mandatory parameter is null.

getPropertyMetadata(property* : Property) : Map<String, String>

Returns the property metadata.

Throws:

  • "NullParameterError" if mandatory parameter is null.

getPropertyValue(record* : Record, property* : Property) : Object

Returns the value of the given property of the given record object.

Throws:

  • "NullParameterError" if mandatory parameter is null.
  • "IncompatibleTypeError" if the record the the given property are not compatible

setPropertyValue(record* : Record, property* : Property, value : Object) : Object

Sets the value of the given property of the given record object.

Returns null.

Throws:

  • "NullParameterError" if mandatory parameter is null.
  • "IncompatibleTypeError" if the record and the given property are not compatible

getProperties(type* : Type<Record>) : List<Property>

Returns all properties of the given record type.

Throws:

  • "NullParameterError" if mandatory parameter is null.

getPropertyReference(reference* : Reference<Object>, properties* : Property...) : Reference<Object>

Returns the reference to the object defined by the last property parameter. The path to the object is resolved as a chain of associations starting in the reference parameter through the property parameters in specified order.

Throws:

  • "NullParameterError" if mandatory parameter is null.
  • "IncompatibleTypeError" if the given record and property are not compatible.

Generic

cast(object : Object, objectType* : Type<E>) : E

If the type of the given object is compatible with the specified objectType, the function returns the object casted to the objectType. If not possible, the function throws a runtime exception.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.
  • "IncompatibleTypeError" if the type of the object is not compatible with the specified objectType.

isInstance(object : Object, objectType* : Type<Object>) : Boolean

Returns true, if the given object is assignment-compatible with (is kind of) the specified objectType.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

isSubtype(subtype* : Type<Object>, supertype* : Type<Object>) : Boolean

Returns true, if the type specified by the sub-type parameter is a subtype of the type specified by the supertype parameter.

Throws:

  • "NullParameterError" if mandatory parameters are not specified.

typeOf(object : E) : Type<E>

Returns the type of specified object.

clone(object : T) : TSIDE EFFECT

Creates and returns a shallow copy of a collection or of a user-defined record, or returns the object itself if it is of another type.

error(code* : String) : Null

Throws an error with the specified code.

Throws:

  • "NullParameterError" if mandatory parameter is not specified.

Auditing

getRevisions(record* : Record, from : Date, to : Date) : List<Integer>

Returns a list of revision identifiers in which the shared record was modified during the period defined by the from and to parameters. If the from or to parameter is null, the period is unbounded from bottom or top respectively.

Throws:

  • "NullParameterError" if mandatory parameter is null.
  • "IncompatibleTypeError" if the record is not a shared record.

findByRevision(record* : Record, revision* : Integer) : E

Returns the audited record in the given revision.

Throws:

  • "NullParameterError" if a mandatory parameter is null.
  • "IncompatibleTypeError" if the record is not a shared record.

getCurrentRevision(revisionEntityType* : Type<T>, persist* : Boolean) : T

Returns the current custom revision entity. If the persist parameter is set to true, the revision entity is created even if no audited record was changed in the current transaction.

Throws:

  • "NullParameterError" if a mandatory parameter is null.
  • "IncompatibleTypeError" if the revisionEntitytype is not a custom revision entity record type.

Query

findAll(type* : Type<E>) : List<E>

Returns all shared records of the given type.

Throws:

  • “NullParameterError” - if mandatory parameter is null
  • “IncompatibleTypeError” - if the type parameter is not a shared record type

findById(id* : Object, type* : Type<E>) : E

Returns a shared record of the specified type and identified by the given primary key id. Composed primary key id is represented as a map of type Map<String, Object> or of type Map<Property, Object>. The keys of the map identify the properties of the primary key id and values represent the value of the properties. If the key is of type string then it contains the simple property name. If there is no record with the given id, the function returns null.

Throws:

  • "NullParameterError" - Mandatory parameter is null.
  • "IncompatibleTypeError" - The type parameter is not a shared record type.

Utilities

debugLog(message* : { : String}) : String

Logs a message to the console at the debug logging level. If logging is not enabled for the debug level, the message closure is not even evaluated. The function returns a string that was logged, or null if the message was not logged.

Throws:

  • "NullParameterError" if mandatory parameter is null.

debugLog(message* : { : String}, level* : Integer) : String

Logs a message to the console at the specified logging level. If logging is not enabled at the specified level, the message closure is not even evaluated. The function returns a string that was logged, or null if the message was not logged.

Throws:

  • "NullParameterError" if mandatory parameter is null.

log(message* : String, level : Integer) : Null

Logs a specified message to the application log at the specified log level. Unspecified level value logs at the "Info" level (value 200). The function returns always null.

Throws:

  • "NullParameterError" if mandatory parameter is null.

infoLevel() : IntegerDEPRECATED

Returns an integer (200) representing the "Info" log level.

Deprecated. Replaced by constant INFO_LEVEL.

debugLevel() : IntegerDEPRECATED

Returns an integer (100) representing the "Debug" log level.

Deprecated. Replaced by constant DEBUG_LEVEL.

warningLevel() : IntegerDEPRECATED

Returns an integer (300) representing the "Warning" log level.

Deprecated. Replaced by constant WARNING_LEVEL.

errorLevel() : IntegerDEPRECATED

Returns an integer (400) representing the "Error" log level.

Deprecated. Replaced by constant ERROR_LEVEL.

getApplicationData(key* : String) : Object

Returns an application data object with the specified key. At the moment, the "locale" string and the "user" Person are supported by the LSPS Process Application.

Throws:

  • "NullParameterError" if mandatory parameter is null.

splitPathname(name* : String) : List<String>

Splits a fully specified element name to names of its components which are separated by the namespace separator (::). For instance, splitPathname("module::'role 1'") results in ["module", "role 1"].

Throws:

  • "NullParameterError" if mandatory parameter is null.
  • "IncorrectPathnameError" if syntax of the specified name is incorrect.