LSPS documentation logo
LSPS Documentation
Functions

Proxy

getProxyLevel(record* : Record) : Integer

Returns proxy level of the record.

Parameters:

  • record

Throws:

  • NullParameterError if mandatory parameter is null
isProxy(record* : Record) : Boolean

Returns true if the record is proxy, false otherwise.

Parameters:

  • record

Throws:

  • NullParameterError if a mandatory parameter is null
mergeAllProxies(records* : Collection<T>) : List<T>SIDE EFFECT

Merges changes from the proxies to the proxied records. It returns proxied records with applied changes.

Parameters:

  • records

Throws:

  • NullParameterError if a mandatory parameter is null
mergeAllProxies(checkConflicts* : Boolean, records* : Collection<T>) : List<T>SIDE EFFECT

Merges changes from the proxies to the proxied records. It returns proxied records with applied changes.

Parameters:

  • checkConflicts
  • records

Throws:

  • NullParameterError if a mandatory parameter is null
mergeAllProxiesDeep(records : Collection<T>) : List<T>SIDE EFFECT

Merges changes from the proxies to the proxied records. It merges changes from all proxies that can be accessed from the record and has same proxy level. It returns proxied records with applied changes.

Parameters:

  • records

Throws:

  • NullParameterError if a mandatory parameter is null
mergeAllProxiesDeep(checkConflicts : Boolean, records : Collection<T>) : List<T>SIDE EFFECT

Merges changes from the proxies to the proxied records. It merges changes from all proxies that can be accessed from the record and has same proxy level. It returns proxied records with applied changes.

Parameters:

  • checkConflicts
  • records

Throws:

  • NullParameterError if a mandatory parameter is null
mergeProxies(records : T...) : List<T>SIDE EFFECT

Merges changes from the proxies to the proxied records. It returns proxied records with applied changes.

Parameters:

  • records
mergeProxies(checkConflicts* : Boolean, records : T...) : List<T>SIDE EFFECT

Merges changes from the proxies to the proxied records. It returns proxied records with applied changes.

Parameters:

  • checkConflicts
  • records
mergeProxiesDeep(records : T...) : List<T>SIDE EFFECT

Merges changes from the proxies to the proxied records. It merges changes from all proxies that can be accessed from the record and has same proxy level. It returns proxied records with applied changes.

Parameters:

  • records
mergeProxiesDeep(checkConflicts* : Boolean, records : T...) : List<T>SIDE EFFECT

Merges changes from the proxies to the proxied records. It merges changes from all proxies that can be accessed from the record and has same proxy level. It returns proxied records with applied changes.

Parameters:

  • checkConflicts
  • records
proxy(recordType* : Type<T>) : T

Creates a proxy without proxied record. It can be used only for shared records. When merged a shared record is created.

Parameters:

  • recordType

Throws:

  • NullParameterError if mandatory parameter is null
proxy(collection* : List<T>, properties : Property...) : List<T>

Creates change proxies on records from the collection and change proxies for values referenced by named properties. The proxy objects keeps changes that should be executed on the record.

Parameters:

  • collection
  • properties

Throws:

  • NullParameterError if a mandatory parameter is null
proxy(collection* : Set<T>, properties : Property...) : Set<T>

Creates change proxies on records from the collection and change proxies for values referenced by named properties. The proxy objects keeps changes that should be executed on the record.

Parameters:

  • collection
  • properties

Throws:

  • NullParameterError if a mandatory parameter is null
proxy(record* : T, properties : Property...) : T

Creates a change proxy on the record and change proxies for values referenced by named properties. The proxy objects keep changes that should be executed on the record.

Parameters:

  • record
  • properties

Throws:

  • NullParameterError if a mandatory parameter is null
proxy(recordType* : Type<T>, proxyLevel* : Integer) : T

Creates a proxy without proxied record. It can be used only for shared records. It creates proxy on the specified level and all proxies between level 1 and the target level.

Parameters:

  • recordType
  • proxyLevel

Throws:

  • NullParameterError if mandatory parameter is null
proxyOfProperties(record* : Record, properties : Property...) : voidSIDE EFFECT

Creates change proxy for all object referenced by the property and sets the proxy values to the property.

Parameters:

  • record
  • properties

Throws:

  • NullParameterError if a mandatory parameter is null

Collection

+(collection* : Collection<E>, elements* : Collection<E>) : Collection<E>

Returns a collection created by appending the specified elements to the end of the collection parameter. 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.

Parameters:

  • collection
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
+(left* : Map<K, V>, right* : Map<K, V>) : Map<K, V>

Returns a map created as union of keys and their respective values from both of the specified maps. If a key is present in both maps, its value is set to the value of the key specified by the right map.

Parameters:

  • left
  • right

Throws:

  • NullParameterError if a mandatory parameter is not specified
+(list* : List<E>, collection* : Collection<E>) : List<E>

Returns a list created by appending the specified elements (given as a collection) at the end of the list. The original order of the added elements is preserved also in the returned list.

Parameters:

  • list
  • collection

Throws:

  • NullParameterError if a mandatory parameter is not specified
+(set* : Set<E>, collection* : Collection<E>) : Set<E>

Returns a set created by appending the specified elements (given as a collection) at the end of the set. The original order of the added elements is preserved also in the returned set.

Parameters:

  • set
  • collection

Throws:

  • NullParameterError if a mandatory parameter is not specified
-(collection* : Collection<E>, elements* : Collection<E>) : 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.

Parameters:

  • collection
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
-(list* : List<E>, elements* : Collection<E>) : List<E>

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

Parameters:

  • list
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
-(set* : Set<E>, elements* : Collection<E>) : Set<E>

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

Parameters:

  • set
  • elements

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • collection
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
add(list* : List<E>, elements : E...) : List<E>

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

Parameters:

  • list
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
add(set* : Set<E>, elements : E...) : Set<E>

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

Parameters:

  • set
  • elements

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • map
  • key
  • value

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • collections

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • maps

Throws:

  • NullParameterError if a mandatory parameter is not specified
addAll(list* : List<E>, collections* : Collection<E>...) : List<E>

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

Parameters:

  • list
  • collections

Throws:

  • NullParameterError if a mandatory parameter is not specified
addAll(set* : Set<E>, collections* : Collection<E>...) : Set<E>

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

Parameters:

  • set
  • collections

Throws:

  • NullParameterError if a mandatory parameter is not specified
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.

Parameters:

  • collection
  • index
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • OutOfBoundsError if the specified index is out of range (index < 0 or index > size(collection))
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.

Parameters:

  • list
  • index
  • elements

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • set
  • index
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • OutOfBoundsError if the specified 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.

Parameters:

  • collection
  • index
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • OutOfBoundsError if the index is out of range (index < 0 or index > size(collection))
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.

Parameters:

  • list
  • index
  • elements

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • set
  • index
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • OutOfBoundsError if the index is out of range (index < 0 or index > size(set))
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.

Parameters:

  • collection
  • function

Throws:

  • NullParameterError if a mandatory parameter is not specified
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.

Parameters:

  • list
  • function

Throws:

  • NullParameterError if a mandatory parameter is not specified
collect(map* : Map<K, V>, function* : {K, V : E}) : List<E>

Returns a list of values obtained by applying the function to each key-value pair in the given map.

Parameters:

  • map
  • function

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • set
  • function

Throws:

  • NullParameterError if a mandatory parameter is not specified
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.

Parameters:

  • collection
  • function

Throws:

  • NullParameterError if a mandatory parameter is null
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.

Parameters:

  • list
  • function

Throws:

  • NullParameterError if a 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.

Parameters:

  • set
  • function

Throws:

  • NullParameterError if a mandatory parameter is null
compact(collection* : Collection<E>) : Collection<E>

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

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is null
compact(list* : List<E>) : List<E>

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

Parameters:

  • list

Throws:

  • NullParameterError if a mandatory parameter is null
compact(set* : Set<E>) : Set<E>

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

Parameters:

  • set

Throws:

  • NullParameterError if a mandatory parameter is null
contains(collection* : Collection<Object>, elements : Object...) : Boolean

Returns true, if the collection contains all specified elements.

Parameters:

  • collection
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
containsAll(collection* : Collection<Object>, elements* : Collection<Object>) : Boolean

Returns true, if the collection contains all specified elements.

Parameters:

  • collection
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
containsAny(collection* : Collection<Object>, elements* : Collection<Object>) : Boolean

Returns true, if the collection contains any of the specified elements.

Parameters:

  • collection
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
containsKeys(map* : Map<Object, Object>, keys : Object...) : Boolean

Returns true, if the map contains all specified keys.

Parameters:

  • map
  • keys

Throws:

  • NullParameterError if a mandatory parameter is not specified
containsValues(map* : Map<Object, Object>, values : Object...) : Boolean

Returns true, if the map contains all specified values.

Parameters:

  • map
  • values

Throws:

  • NullParameterError if a mandatory parameter is not specified
count(collection* : Collection<E>, condition* : {E : Boolean}) : Integer

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

Parameters:

  • collection
  • condition

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • collection
  • condition

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • collection
  • condition

Throws:

  • NullParameterError if a 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).

Parameters:

  • collection
  • fromIndex
  • condition

Throws:

  • NullParameterError if a 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.

Parameters:

  • collection
  • fromIndex
  • toIndex
  • condition

Throws:

  • NullParameterError if a 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.

Parameters:

  • collection
  • condition

Throws:

  • NullParameterError if a 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.

Parameters:

  • collection
  • toIndex
  • condition

Throws:

  • NullParameterError if a 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.

Parameters:

  • collection
  • fromIndex
  • toIndex
  • condition

Throws:

  • NullParameterError if a 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.

Parameters:

  • collection
  • initialValue
  • function

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • collection
  • initialValue
  • function

Throws:

  • NullParameterError if a mandatory parameter is not specified
forAll(collection* : Collection<E>, condition* : {E : Boolean}) : Boolean

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

Parameters:

  • collection
  • condition

Throws:

  • NullParameterError if a mandatory parameter is not specified
getDuplicates(collection* : Collection<E>) : Set<E>

Returns the set of duplicate elements in the given collection.

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is null
getFirst(collection* : Collection<E>) : E

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

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is null
getFirst(collection* : Collection<E>, condition* : {E : Boolean}) : E

Returns the first element for which the given condition is true. Returns null if the collection is empty or the condition is not true for all elements.

Parameters:

  • collection
  • condition

Throws:

  • NullParameterError if a mandatory parameter is null
getLast(collection* : Collection<E>) : E

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

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is null
getLast(collection* : Collection<E>, condition* : {E : Boolean}) : E

Returns the last element for which the given condition is true. Returns null if the collection is empty or the condition is not true for all elements.

Parameters:

  • collection
  • condition

Throws:

  • NullParameterError if a mandatory parameter is null
groupBy(collection* : Collection<E>, classifier* : {E : K}) : Map<K, List<E>>

The function does a "group by" operation, grouping given elements according to a classifier function, and returning the results in a map.

Parameters:

  • collection
  • classifier

Throws:

  • NullParameterError if a mandatory parameter is null
hasDuplicates(collection* : Collection<Object>) : Boolean

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

Parameters:

  • collection

Throws:

  • NullParameterError if a 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.

Parameters:

  • collection
  • element

Throws:

  • NullParameterError if a mandatory parameter is not specified
isEmpty(collection* : Collection<Object>) : Boolean

Returns true, if the specified collection contains no elements.

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is not specified
isEmpty(map* : Map<Object, Object>) : Boolean

Returns true, if the specified map contains no elements.

Parameters:

  • map

Throws:

  • NullParameterError if a mandatory parameter is not specified
isSubset(set1* : Set<Object>, set2* : Set<Object>) : Boolean

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

Parameters:

  • set1
  • set2

Throws:

  • NullParameterError if a mandatory parameter is not specified
join(collection* : Collection<Object>) : String

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

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is not specified
join(collection* : Collection<Object>, joinString : String) : String

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

Parameters:

  • collection
  • joinString

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • collection
  • joinString
  • includeEmpty

Throws:

  • NullParameterError if a mandatory parameter is not specified
keys(map* : Map<K, V>) : Set<K>

Returns a set of keys contained in the specified map.

Parameters:

  • map

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • map
  • element

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • collection
  • element

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • collections
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.

Parameters:

  • keys
  • valueFunction

Throws:

  • NullParameterError if a mandatory parameter is not specified
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.

Parameters:

  • keys
  • values

Throws:

  • NullParameterError if a mandatory parameter is 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(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.

Parameters:

  • collection
  • keyFunction
  • valueFunction

Throws:

  • NullParameterError if a mandatory parameter is not specified
max(collection* : Collection<Date>) : Date

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

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is null
max(collection* : Collection<Decimal>) : Decimal

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

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is null
max(collection* : Collection<Integer>) : Integer

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

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is null
max(collection* : Collection<String>) : String

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

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is null
min(collection* : Collection<Date>) : Date

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

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is null
min(collection* : Collection<Decimal>) : Decimal

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

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is null
min(collection* : Collection<Integer>) : Integer

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

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is null
min(collection* : Collection<String>) : String

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

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is null
notEmpty(collection* : Collection<Object>) : Boolean

Returns true, if the specified collection contains some elements.

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is null
notEmpty(map* : Map<Object, Object>) : Boolean

Returns true, if the specified map contains some elements.

Parameters:

  • map

Throws:

  • NullParameterError if a mandatory parameter is null
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.

Parameters:

  • collection
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
remove(list* : List<E>, elements : Object...) : List<E>

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

Parameters:

  • list
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
remove(set* : Set<E>, elements : Object...) : Set<E>

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

Parameters:

  • set
  • elements

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • collection
  • elements

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • list
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
removeAll(set* : Set<E>, elements* : Collection<Object>) : Set<E>

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

Parameters:

  • set
  • elements

Throws:

  • NullParameterError if a mandatory parameter is not specified
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.

Parameters:

  • collection
  • index

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • OutOfBoundsError if the specified index is out of range (index < 0 or index >= size(collection))
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.

Parameters:

  • list
  • index

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • set
  • index

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • OutOfBoundsError if the specified index is out of range (index < 0 or index >= size(set))
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.

Parameters:

  • map
  • keys

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • map
  • keys

Throws:

  • NullParameterError if a mandatory parameter is not specified
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.

Parameters:

  • collection
  • fromIndex
  • toIndex

Throws:

  • NullParameterError if a 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.

Parameters:

  • list
  • fromIndex
  • toIndex

Throws:

  • NullParameterError if a mandatory parameter is null
  • OutOfBoundsError fromIndex > toIndex
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.

Parameters:

  • set
  • fromIndex
  • toIndex

Throws:

  • NullParameterError if a 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.

Parameters:

  • map
  • values

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • collection
  • element1
  • element2

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • list
  • element1
  • element2

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • set
  • element1
  • element2

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • map
  • value1
  • value2

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • collection
  • collections

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • list
  • collections

Throws:

  • NullParameterError if a mandatory parameter is not specified
retainAll(set* : Set<E>, collections* : Collection<E>...) : Set<E>

Returns a set created by intersection of the specified sets.

Parameters:

  • set
  • collections

Throws:

  • NullParameterError if a mandatory parameter is not specified
reverse(collection* : Collection<E>) : Collection<E>

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

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is not specified
reverse(list* : List<E>) : List<E>

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

Parameters:

  • list

Throws:

  • NullParameterError if a mandatory parameter is not specified
reverse(set* : Set<E>) : Set<E>

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

Parameters:

  • set

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • collection
  • condition

Throws:

  • NullParameterError if a mandatory parameter is not specified
select(collection* : Collection<Object>, type* : Type<E>) : Collection<E>

Returns a collection containing elements of the given type, null element are not included. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.

Parameters:

  • collection
  • type

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • list
  • condition

Throws:

  • NullParameterError if a mandatory parameter is not specified
select(list* : List<Object>, type* : Type<E>) : List<E>

Returns a list containing elements of the given type, null element are not included.

Parameters:

  • list
  • type

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • map
  • condition

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • set
  • condition

Throws:

  • NullParameterError if a mandatory parameter is not specified
select(set* : Set<Object>, type* : Type<E>) : Set<E>

Returns a set containing elements of the given type, null element are not included.

Parameters:

  • set
  • type

Throws:

  • NullParameterError if a mandatory parameter is not specified
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.

Parameters:

  • collection
  • index
  • element

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • OutOfBoundsError if the specified index is out of range (index < 0 or index >= size(collection))
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.

Parameters:

  • list
  • index
  • element

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • set
  • index
  • element

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • OutOfBoundsError if the specified index is out of range (index < 0 or index >= size(set))
size(collection* : Collection<Object>) : Integer

Returns the number of elements in the specified collection.

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is not specified
size(map* : Map<Object, Object>) : Integer

Returns the number of elements in the specified map.

Parameters:

  • map

Throws:

  • NullParameterError if a mandatory parameter is not specified
sort(collection* : Collection<Date>, ascending* : Boolean) : Collection<Date>

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

Parameters:

  • collection
  • ascending

Throws:

  • NullParameterError if a mandatory parameter is null
sort(collection* : Collection<Decimal>, ascending* : Boolean) : Collection<Decimal>

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

Parameters:

  • collection
  • ascending

Throws:

  • NullParameterError if a mandatory parameter is null
sort(collection* : Collection<Integer>, ascending* : Boolean) : Collection<Integer>

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

Parameters:

  • collection
  • ascending

Throws:

  • NullParameterError if a mandatory parameter is null
sort(collection* : Collection<String>, ascending* : Boolean) : Collection<String>

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

Parameters:

  • collection
  • ascending

Throws:

  • NullParameterError if a mandatory parameter is null
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

Parameters:

  • collection
  • comparator

Throws:

  • NullParameterError if a mandatory parameter is not specified
sort(list* : List<Date>, ascending* : Boolean) : List<Date>

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

Parameters:

  • list
  • ascending

Throws:

  • NullParameterError if a mandatory parameter is null
sort(list* : List<Decimal>, ascending* : Boolean) : List<Decimal>

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

Parameters:

  • list
  • ascending

Throws:

  • NullParameterError if a mandatory parameter is null
sort(list* : List<Integer>, ascending* : Boolean) : List<Integer>

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

Parameters:

  • list
  • ascending

Throws:

  • NullParameterError if a mandatory parameter is null
sort(list* : List<String>, ascending* : Boolean) : List<String>

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

Parameters:

  • list
  • ascending

Throws:

  • NullParameterError if a mandatory parameter is null
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.

Parameters:

  • list
  • comparator

Throws:

  • NullParameterError if a mandatory parameter is not specified
sort(set* : Set<Date>, ascending* : Boolean) : Set<Date>

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

Parameters:

  • set
  • ascending

Throws:

  • NullParameterError if a mandatory parameter is null
sort(set* : Set<Decimal>, ascending* : Boolean) : Set<Decimal>

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

Parameters:

  • set
  • ascending

Throws:

  • NullParameterError if a mandatory parameter is null
sort(set* : Set<Integer>, ascending* : Boolean) : Set<Integer>

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

Parameters:

  • set
  • ascending

Throws:

  • NullParameterError if a mandatory parameter is null
sort(set* : Set<String>, ascending* : Boolean) : Set<String>

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

Parameters:

  • set
  • ascending

Throws:

  • NullParameterError if a mandatory parameter is null
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.

Parameters:

  • set
  • comparator

Throws:

  • NullParameterError if a mandatory parameter is not specified
sortByKey(collection* : Collection<E>, keyExtractor* : {E : Object}, ascending* : Boolean, nullsFirst* : Boolean) : List<E>

Returns a collection sorted by keys produced by the given key extractor. It is assumed that keys produced by key extractor are comparable, (i.e. strings or decimals or integers or dates). The parameter ascending specifies whether natural or reverse order is used (set ascending to true to have a natural order). The parameter nullsFirst specifies whether null keys are considered smaller or greater in natural order (set nullsFirst to true to have nulls at the beginning of the result collection, if ascending is true).

Parameters:

  • collection
  • keyExtractor
  • ascending
  • nullsFirst

Throws:

  • NullParameterError if a mandatory parameter is null
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).

Parameters:

  • collection
  • fromIndex
  • toIndex

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • OutOfBoundsError if fromIndex > toIndex
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).

Parameters:

  • list
  • fromIndex
  • toIndex

Throws:

  • NullParameterError if a mandatory parameter is 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).

Parameters:

  • set
  • fromIndex
  • toIndex

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • OutOfBoundsError if fromIndex > toIndex
sum(collection* : Collection<E>) : E

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

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is not specified
swap(list* : List<T>, index1* : Integer, index2* : Integer) : List<T>

Returns a new list which contains the same elements as the original list, with elements at given indexes swapped.

Parameters:

  • list
  • index1
  • index2

Throws:

  • NullParameterError if a mandatory parameter is not specified
toList(collection* : Collection<E>) : List<E>

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

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is not specified
toSet(collection* : Collection<E>) : Set<E>

Returns a set of values contained in the specified list.

Parameters:

  • collection

Throws:

  • NullParameterError if a mandatory parameter is not specified
values(map* : Map<K, V>) : List<V>

Returns a list of values contained in the specified map.

Parameters:

  • map

Throws:

  • NullParameterError if a mandatory parameter is not specified

Binary

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.

Parameters:

  • fileName
  • description
  • content
  • mime
  • charset

Throws:

  • NullParameterError if a mandatory parameter is null
  • UnsupportedEncodingError if the specified charset is not supported
getBinaryHandle(id* : Integer) : BinaryHandleDEPRECATED

Returns a binary handle of the specified identifier.

Parameters:

  • id

Throws:

  • NullParameterError if a mandatory parameter is null
  • BinaryHandleNotFoundError if there is no such a binary handle
getBinaryHandleMetadata(binaryData* : BinaryHandle) : Map<String, String>

Returns a binary handle metadata

Parameters:

  • binaryData

Throws:

  • NullParameterError if a mandatory parameter is null
getResource(module* : String, path* : String) : File

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

Parameters:

  • module
  • path

Throws:

  • NullParameterError if a mandatory parameter is null
  • ResourceNotFoundError if the specified module is not available or the resource is not found at the given path
resource(module* : String, path* : String) : BinaryHandleSIDE EFFECTDEPRECATED

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

Parameters:

  • module
  • path

Throws:

  • NullParameterError if a 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.

Parameters:

  • binary
toBinary(string : String) : Binary

Converts the specified string to binary.

Parameters:

  • string
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.

Parameters:

  • binary
  • charset

Throws:

  • NullParameterError if a mandatory parameter is null
  • UnsupportedEncodingError if the encoding is not supported

Enumeration

literalToName(literal* : Enumeration) : String

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

Parameters:

  • literal

Throws:

  • NullParameterError if mandatory parameter is null
literals(enumeration* : Type<E>) : List<E>

Returns a list of literals from the specified enumeration

Parameters:

  • enumeration

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.

Parameters:

  • enumeration
  • name

Throws:

  • NullParameterError if mandatory parameter is null
  • DoesNotExistError if the specified name does not corespond to any literal
toEnumeration(string* : String) : Enumeration

Transforms the specified enumeration full name to the corresponding value Enumeration full name has the following format: MODULE_NAME::ENUMERATION_NAME.LITERAL_NAME

Parameters:

  • string

Throws:

  • NullParameterError if mandatory parameter is null or empty string
  • FormatError if the string is not a valid enumeration full name

Label

getLabel(literal* : Enumeration) : String

Returns the enumeration literal label.

Parameters:

  • literal

Throws:

  • NullParameterError if mandatory parameter is null
getLabel(property* : Property) : String

Returns the property label.

Parameters:

  • property

Throws:

  • NullParameterError if mandatory parameter is null
getLabel(type* : Type<Object>) : String

Returns the type label.

Parameters:

  • type

Throws:

  • NullParameterError if mandatory parameter is null

Pdf

fillPdfTemplate(pdfTemplate* : Binary, fdfDocument* : Binary) : Binary

Returns a PDF document obtained by filling the values of PDF form template from the FDF document.

Parameters:

  • pdfTemplate
  • fdfDocument
fillPdfTemplate(pdfTemplate* : Binary, values : Map<Object, Object>) : Binary

Returns a PDF document obtained by filling the values of PDF form template parameters using the FDF merging method. Form parameter names and their values are specified in the parameters map.

Parameters:

  • pdfTemplate
  • values
fillXfaPdfTemplate(pdfTemplate* : Binary, data* : Record) : Binary

Returns a PDF document obtained by populating the XFA template with the specified data. The type of populated record must specify the XML mapping that conforms to the XML schema required by the template.

Parameters:

  • pdfTemplate
  • data
fillXfaPdfTemplate(pdfTemplate* : Binary, xml* : String) : Binary

Returns a PDF document obtained by populating the XFA template with the specified data. The provided XML data must conform to the XML schema required by the template.

Parameters:

  • pdfTemplate
  • xml

Validation

findTag(name* : String) : Tag

Finds a tag by a given name which can be a simple name or full name. Returns null 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.

Parameters:

  • name

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • AmbiguousNameError if the given name is ambiguous
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.

Parameters:

  • record
  • property
  • tags
  • context

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.

Parameters:

  • record
  • property
  • tags
  • context

Throws:

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

String

contains(string* : String, substring* : String) : Boolean
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.

Parameters:

  • string
  • regexp

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.

Parameters:

  • pattern
  • arguments

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • pattern
  • locale
  • arguments

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • FormatError if the specified format is incorrect
indexOf(string* : String, substring* : String) : Integer

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

Parameters:

  • string
  • substring

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.

Parameters:

  • string
  • substring
  • fromIndex

Throws:

  • NullParameterError if mandatory parameter is null
  • OutOfBoundsError if the index is out of range (index < 0 or index >= length(string))
isBlank(string : String) : Boolean

Returns true if the string is either null, has zero length (contains no characters) or only consists of whitespaces.

Parameters:

  • string
isEmpty(string : String) : Boolean

Returns true if the string is either null or has zero length (contains no characters).

Parameters:

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

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

Parameters:

  • string
  • substring

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.

Parameters:

  • string
  • substring
  • fromIndex

Throws:

  • NullParameterError if mandatory parameter is null
  • OutOfBoundsError if the index is out of range (index < 0 or index >= length(string))
length(string* : String) : Integer

Returns the length of the specified string.

Parameters:

  • string

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • string string to localize
  • language language code

Throws:

  • NullParameterError if a mandatory parameter is not specified
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.

Parameters:

  • string
  • regexp

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • string
  • regexp
  • replacement

Throws:

  • NullParameterError if a mandatory parameter is not specified
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.

Parameters:

  • string
  • regexp
  • replacement

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • string
  • regexp

Throws:

  • NullParameterError if a mandatory parameter is not specified
substring(string* : String, fromIndex : Integer, toIndex : Integer) : String

Returns a substring of the string starting at the fromIndex position (inclusive) and ending at the toIndex position (exclusive). If the fromIndex is null or is less than 0, the substring starts from the beginning of the string (index 0). If the 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.

Parameters:

  • string
  • fromIndex
  • toIndex

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • OutOfBoundsError if fromIndex > toIndex
toDecimal(string* : String) : Decimal

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

Parameters:

  • string

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • FormatError if the string does not represent a decimal value
toInteger(string* : String) : Integer

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

Parameters:

  • string

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • FormatError if the string does not represents an integer value
toInteger(string* : String, radix* : Integer) : Integer

If possible, converts the specified string in the specified radix to an integer. If not possible, the function throws a runtime exception. Radix must be between 2 and 36 (inclusive).

Parameters:

  • string
  • radix

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • FormatError if the string does not represents an integer value
toLowerCase(string* : String) : String

Converts all characters of the specified string to lower case.

Parameters:

  • string

Throws:

  • NullParameterError if mandatory parameter is null
toString(object : Object) : String

Converts the specified object to a string.

Parameters:

  • object
toUpperCase(string* : String) : String

Converts all characters of the specified string to upper case.

Parameters:

  • string

Throws:

  • NullParameterError if mandatory parameter is null
trim(string* : String) : String

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

Parameters:

  • string

Throws:

  • NullParameterError if a mandatory parameter is not specified

Xml

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.

Parameters:

  • object

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncompatibleTypeError if the type of the object is not record
  • UnableToConvertToXmlError if an error occurred during conversion
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.

Parameters:

  • xml
  • resultType

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncompatibleTypeError if the resultType parameter is not record
  • UnableToParseXmlError if the specified xml cannot be parsed

Reflection

achieved() : StringDEPRECATED
Returns a string representing "Achieved" state. Deprecated. Replaced by constant ACHIEVED.
activate(goals : Collection<Goal>) : voidSIDE EFFECT

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

Parameters:

  • goals

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • FinishedProcessInstanceError if the process instance of any activated goal is finished
active() : StringDEPRECATED
Returns a string representing "Active" state. Deprecated. Replaced by constant ACTIVE.
alive() : StringDEPRECATED
Returns a string representing "Alive" state. Deprecated. Replaced by constant ALIVE.
deactivate(goals : Collection<Goal>) : voidSIDE EFFECT

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

Parameters:

  • goals

Throws:

  • NullParameterError if a mandatory parameter is not specified
deactivated() : StringDEPRECATED
Returns a string representing "Deactivated" state. Deprecated. Replaced by constant DEACTIVATED.
failed() : StringDEPRECATED
Returns a string representing "Failed" state. Deprecated. Replaced by constant FAILED.
finished() : StringDEPRECATED
Returns a string representing "Finished" state. Deprecated. Replaced by constant FINISHED.
getAllSubGoals(goal* : Goal) : Set<AchieveGoal>

Returns a set of all sub-goals, i.e. the goals that the given goal is decomposed into, directly or indirectly.

Parameters:

  • goal
getSubGoals(goal* : Goal) : Set<AchieveGoal>

Returns a set of direct sub-goals, i.e. the goals that the given goal is decomposed into.

Parameters:

  • goal
inactive() : StringDEPRECATED
Returns a string representing "Inactive" state. Deprecated. Replaced by constant INACTIVE.
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.

Parameters:

  • goalPlan
  • state

Throws:

  • NullParameterError if a mandatory parameter is not specified
notFinished() : StringDEPRECATED
Returns a string representing "Not finished" state. Deprecated. Replaced by constant NOT_FINISHED.
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.

Type

getIndexType(mapType* : Type<Map<K, V>>) : Type<K>DEPRECATED

Returns the key type of the given map type. Deprecated. Use getKeyType(Type<Map<K,V>>) instead.

Parameters:

  • mapType

Throws:

  • NullParameterError if a mandatory parameter is null
getItemType(collectionType* : Type<Collection<E>>) : Type<E>

Returns the item type of the given collection type.

Parameters:

  • collectionType

Throws:

  • NullParameterError if a mandatory parameter is null
getItemType(mapType* : Type<Map<K, V>>) : Type<V>DEPRECATED

Returns the value type of the given map type. Deprecated. Use getValueType(Type<Map<K,V>>) instead.

Parameters:

  • mapType

Throws:

  • NullParameterError if a mandatory parameter is null
getKeyType(mapType* : Type<Map<K, V>>) : Type<K>

Returns the key type of the given map type.

Parameters:

  • mapType

Throws:

  • NullParameterError if a mandatory parameter is null
getReferencedType(referenceType* : Type<Reference<E>>) : Type<E>

Returns the referenced type of the given reference type.

Parameters:

  • referenceType

Throws:

  • NullParameterError if a mandatory parameter is null
getValueType(mapType* : Type<Map<K, V>>) : Type<V>

Returns the value type of the given map type.

Parameters:

  • mapType

Throws:

  • NullParameterError if a mandatory parameter is null
toType(string* : String) : Type<Object>

If possible, parses the specified string to a type. If the given string does not represent a valid type, the function throws an error.

Parameters:

  • string

Throws:

  • NullParameterError if a mandatory parameter is not specified.
  • InvalidTypeError if the string does not represent a valid type.

Number

abs(number* : Decimal) : Decimal

Returns an absolute value of the number.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is not specified
abs(number* : Integer) : Integer

Returns an absolute value of the number.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is not specified
max(numbers* : Decimal...) : Decimal

Returns the maximal number from a list of decimals.

Parameters:

  • numbers

Throws:

  • NullParameterError if a mandatory parameter is not specified
max(numbers* : Integer...) : Integer

Returns the maximal number from a list of integers.

Parameters:

  • numbers

Throws:

  • NullParameterError if a mandatory parameter is not specified
min(numbers* : Decimal...) : Decimal

Returns the minimal number from a list of decimals.

Parameters:

  • numbers

Throws:

  • NullParameterError if a mandatory parameter is not specified
min(numbers* : Integer...) : Integer

Returns the minimal number from a list of integers.

Parameters:

  • numbers

Throws:

  • NullParameterError if a mandatory parameter is 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).

Parameters:

  • upperBound

Throws:

  • NullParameterError if a mandatory parameter is not specified
roundCeiling(number* : Decimal) : Integer

Returns rounding of the specified number towards positive infinity.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is not specified
roundDown(number* : Decimal) : Integer

Returns rounding of the specified number towards zero.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is not specified
roundFloor(number* : Decimal) : Integer

Returns rounding of the specified number towards negative infinity.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is not specified
roundHalfDown(number* : Decimal) : Integer

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

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is not specified
roundHalfUp(number* : Decimal) : Integer

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

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is not specified
roundUp(number* : Decimal) : Integer

Returns rounding of the specified number away from zero.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is not specified
scale(number* : Decimal) : Integer

Returns the scale of the specified number.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is 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).

Parameters:

  • number
  • scale
  • roundingMode

Throws:

  • NullParameterError if a mandatory parameter is not specified

Model

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

Creates and starts a new instance of the given 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.

Returns the created model instance.

Parameters:

  • synchronous
  • model
  • properties

Throws:

  • NullParameterError if a mandatory parameter is null
  • ModelInstantiationError if the model instance did not start due to an internal initiation error
  • ModelInterpretationError if the model instance did not start due to an internal model interpretation (startup) error
createModelInstance(synchronous* : Boolean, model* : Model, processEntity* : Record, properties : Map<String, String>) : ModelInstanceSIDE EFFECT

Creates and starts a new model instance of the given model with a given process entity (must be a shared record). The string representation of primary key of the shared record is put into initialization properties, allowing additional properties specified in the properties parameter. 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.

Returns the created model instance.

Parameters:

  • synchronous
  • model
  • processEntity
  • properties

Throws:

  • NullParameterError if a mandatory parameter is null
  • ModelInstantiationError if the model instance did not start due to an internal initiation error
  • ModelInterpretationError if the model instance did not start due to an internal model interpretation (startup) error
  • IncompatibleTypeError if the processEntity is not a shared record
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.

Parameters:

  • model
  • version
  • isRunning
  • properties
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.

Parameters:

  • name
  • version
  • latestOnly
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.

Parameters:

  • filter

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • modelInstance
  • filter

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.

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.

Parameters:

  • name
  • version

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.

Parameters:

  • 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.

Parameters:

  • modelInstance

Throws:

  • NullParameterError if mandatory parameter is null.
getProcessEntity(type* : Type<T>) : T

Returns the associated process entity. Process entity information (a string representation of its primary key) is stored in the model instance properties. Expected type must be specified and must be a shared record type and must match the the type of the record which was used to create the model instance, see function createModelInstance(Boolean synchronous, Model model, Record processEntity, Map<String,String> properties). (If the types do not match, the behavior is unspecified.)

Parameters:

  • type

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncompatibleTypeError if type is not a shared record type
notifyModelInstance(modelInstanceId* : Decimal, reason : String, synchronously* : Boolean) : void

Notify provided model instance.

Parameters:

  • modelInstanceId
  • reason
  • synchronously

Throws:

  • ErrorException if fails, e.g. the model instance was not found, model instance state is invalid

Params:

  • "modelInstanceId" model instance id to notify
  • "reason" string used for logging
  • "synchronously" execute notification synchronously
sendSignal(synchronous* : Boolean, recipients* : Set<ModelInstance>, signal* : Object) : voidSIDE 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.

Parameters:

  • synchronous
  • recipients
  • signal

Throws:

  • NullParameterError if a mandatory parameter is null
  • SendSignalError if sending or receiving of the signal was not successful
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.
thisModelInstanceProperties() : Map<String, String>
Returns a map of initialization properties of the model instance that executed this function. Returns null if executed from document.
thisModelInstanceProperty(propertyName* : String) : String

Returns a value of the initialization property of the given name of the model instance that executed this function. Returns null if there is no property with a given name or if executed from document.

Parameters:

  • propertyName

Throws:

  • NullParameterError if a mandatory parameter is not specified.
thisProcessInstance() : ProcessInstance
Returns the process instance that executed the function; or null, if the function is executed in the global context of a module.
throwEscalation(code* : String, payload : Object) : voidSIDE 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.

Parameters:

  • code
  • payload

Throws:

  • NullParameterError if a mandatory parameter is null

Date

*(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.

Parameters:

  • duration
  • number
*(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.

Parameters:

  • number
  • duration
+(duration : Duration) : Duration

Unary operator which returns the specified duration.

Parameters:

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

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

Parameters:

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

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

Parameters:

  • duration
  • date
+(duration1 : Duration, duration2 : Duration) : Duration

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

Parameters:

  • duration1
  • duration2
-(duration : Duration) : Duration

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

Parameters:

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

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

Parameters:

  • date
  • duration
-(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.

Parameters:

  • date1
  • date2
-(duration1 : Duration, duration2 : Duration) : Duration

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

Parameters:

  • duration1
  • duration2
date(epochMillis* : Integer) : Date

Create a date object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.

Parameters:

  • epochMillis

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • string

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.

Parameters:

  • string
  • pattern

Throws:

  • NullParameterError if mandatory parameter is 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
date(string* : String, pattern* : String, locale : 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. The function takes an optional locale parameter.

Parameters:

  • string
  • pattern
  • locale Optional locale name, e.g. "en_US".

Throws:

  • NullParameterError if mandatory parameter is 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
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.

Parameters:

  • year
  • month
  • dayOfMonth

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • year
  • month
  • dayOfMonth
  • hour
  • minute
  • second
  • millis

Throws:

  • NullParameterError if mandatory parameters are not specified.
days(number* : Integer) : Duration

Returns a duration with the specified number of days.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is not specified
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.

Parameters:

  • date
  • pattern
  • timeZone

Throws:

  • NullParameterError if a mandatory parameter are not specified
  • FormatError if the specified format or timeZone is incorrect
formatDate(date* : Date, pattern* : String, timeZone : String, locale : 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. The function takes an optional locale parameter.

Parameters:

  • date
  • pattern
  • timeZone
  • locale Optional locale name, e.g. "en_US".

Throws:

  • NullParameterError if a mandatory parameter are not specified
  • FormatError if the specified format or timeZone is incorrect
getDayOfMonth(date* : Date) : Integer

Returns the day of the month of the specified date.

Parameters:

  • date

Throws:

  • NullParameterError if a mandatory parameter is not specified
getDayOfWeek(date* : Date) : Integer

Returns the day of the week of the specified date.

Parameters:

  • date

Throws:

  • NullParameterError if a mandatory parameter is not specified
getDayOfYear(date* : Date) : Integer

Returns the day of the year of the specified date.

Parameters:

  • date

Throws:

  • NullParameterError if a mandatory parameter is not specified
getEpochMillis(date* : Date) : Integer

Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this date object.

Parameters:

  • date

Throws:

  • NullParameterError if a mandatory parameter is not specified
getHour(date* : Date) : Integer

Returns the hour of the day of the specified date.

Parameters:

  • date

Throws:

  • NullParameterError if a mandatory parameter is not specified
getMillis(date* : Date) : Integer

Returns the millisecond of the second of the specified date.

Parameters:

  • date

Throws:

  • NullParameterError if a mandatory parameter is not specified
getMinute(date* : Date) : Integer

Returns the minute of the hour of the specified date.

Parameters:

  • date

Throws:

  • NullParameterError if mandatory parameters are not specified
getMonth(date* : Date) : Integer

Returns the month of the year of the specified date.

Parameters:

  • date

Throws:

  • NullParameterError if mandatory parameters are not specified
getSecond(date* : Date) : Integer

Returns the second of a minute of the specified date.

Parameters:

  • date

Throws:

  • NullParameterError if a mandatory parameter is not specified
getWeek(date* : Date) : Integer

Returns the week of the year of the specified date.

Parameters:

  • date

Throws:

  • NullParameterError if a mandatory parameter is not specified
getYear(date* : Date) : Integer

Returns the year of the specified date.

Parameters:

  • date

Throws:

  • NullParameterError if a mandatory parameter is not specified
hours(number* : Integer) : Duration

Returns a duration with the specified number of hours.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date1
  • date2

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date1
  • date2

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date1
  • date2

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date1
  • date2

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date1
  • date2

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date1
  • date2

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date1
  • date2

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date1
  • date2

Throws:

  • NullParameterError if a mandatory parameter is not specified
max(dates* : Date...) : Date

Returns the maximal date from a list of dates.

Parameters:

  • dates

Throws:

  • NullParameterError if a mandatory parameter is not specified
millis(number* : Integer) : Duration

Returns a duration with the specified number of milliseconds.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is not specified
min(dates* : Date...) : Date

Returns the minimal date from a list of dates.

Parameters:

  • dates

Throws:

  • NullParameterError if a mandatory parameter is not specified
minutes(number* : Integer) : Duration

Returns a duration with the specified number of minutes.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is not specified
months(number* : Integer) : Duration

Returns a duration with the specified number of months.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is not specified
now() : Date
Returns the current date and time.
seconds(number* : Integer) : Duration

Returns a duration with the specified number of seconds.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date
  • year
  • month
  • dayOfMonth

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date
  • dayOfMonth

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date
  • dayOfWeek

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date
  • dayOfYear

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date
  • hour

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date
  • millis

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date
  • minute

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date
  • month

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date
  • second

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date
  • hour
  • minute
  • second
  • millis

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date
  • week

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • date
  • year

Throws:

  • NullParameterError if a mandatory parameter is not specified
today() : Date
Returns the current date in the time zone of the LSPS Server, without specifying the time.
weeks(number* : Integer) : Duration

Returns a duration with the specified number of weeks.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is not specified
years(number* : Integer) : Duration

Returns a duration with the specified number of years.

Parameters:

  • number

Throws:

  • NullParameterError if a mandatory parameter is not specified

Record

createInstance(recordType : Type<T>, 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.

Parameters:

  • recordType
  • properties

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • IncompatibleTypeError if the specified properties do not belong to the specified record type
deleteRecords(records* : Record...) : voidSIDE 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.

Parameters:

  • 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>) : voidSIDE 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.

Parameters:

  • records

Throws:

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

Property

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

Returns all properties of the given record type.

Parameters:

  • type

Throws:

  • NullParameterError if a mandatory parameter is null
getProperty(type* : Type<Record>, name* : String) : Property

Returns the property of the given record type with a given name, or null if the type does not have such a property.

Parameters:

  • type
  • name

Throws:

  • NullParameterError if a mandatory parameter is null
getPropertyMetadata(property* : Property) : Map<String, String>

Returns the property metadata.

Parameters:

  • property

Throws:

  • NullParameterError if a mandatory parameter is null
getPropertyName(property* : Property) : String

Returns the property name.

Parameters:

  • property

Throws:

  • NullParameterError if a mandatory parameter is null
getPropertyNames(propertyPath* : PropertyPath) : List<String>

Returns the property names.

Parameters:

  • propertyPath

Throws:

  • NullParameterError if a mandatory parameter is null
getPropertyPathRecordType(propertyPath* : PropertyPath) : Type<Record>

Returns the property path record type. It is the record type where the given property path starts.

Parameters:

  • propertyPath

Throws:

  • NullParameterError if a mandatory parameter is null
getPropertyPathType(propertyPath* : PropertyPath) : Type<Object>

Returns the property path type (the type of the last property).

Parameters:

  • propertyPath

Throws:

  • NullParameterError if a mandatory parameter is null
getPropertyPathValue(record* : Record, propertyPath* : PropertyPath) : Object

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

Parameters:

  • record
  • propertyPath

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncompatibleTypeError if the record the the given property are not compatible
getPropertyRecordType(property* : Property) : Type<Record>

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

Parameters:

  • property

Throws:

  • NullParameterError if a 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.

Parameters:

  • reference
  • properties

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncompatibleTypeError if the given record and property are not compatible
getPropertyType(property* : Property) : Type<Object>

Returns the property type.

Parameters:

  • property

Throws:

  • NullParameterError if a mandatory parameter is null
getPropertyValue(record* : Record, property* : Property) : Object

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

Parameters:

  • record
  • property

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncompatibleTypeError if the record the the given property are not compatible
setPropertyPathValue(record* : Record, propertyPath* : PropertyPath, value : Object) : voidSIDE EFFECT

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

Parameters:

  • record
  • propertyPath
  • value

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncompatibleTypeError if the record and the given property are not compatible
setPropertyValue(record* : Record, property* : Property, value : Object) : voidSIDE EFFECT

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

Parameters:

  • record
  • property
  • value

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncompatibleTypeError if the record and the given 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.

Parameters:

  • object
  • objectType

Throws:

  • NullParameterError if a mandatory parameter is not specified
  • IncompatibleTypeError if the type of the object is not compatible with the specified objectTyp
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.

Parameters:

  • object
error(code* : String) : NullSIDE EFFECT

Throws an error with the specified code.

Parameters:

  • code

Throws:

  • NullParameterError if a mandatory parameter is not specified
error(code* : String, message : String) : NullSIDE EFFECT

Throws an error with the specified code and an optional message.

Parameters:

  • code
  • message

Throws:

  • NullParameterError if a mandatory parameter is not specified
getType(object : E) : Type<E>

Returns the type of specified object.

Parameters:

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

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

Parameters:

  • object
  • objectType

Throws:

  • NullParameterError if a mandatory parameter is 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.

Parameters:

  • subtype
  • supertype

Throws:

  • NullParameterError if a mandatory parameter is not specified
isSubtypeOf(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.

Parameters:

  • subtype
  • supertype

Throws:

  • NullParameterError if a mandatory parameter is not specified
typeOf(object : E) : Type<E>

Returns the type of specified object.

Parameters:

  • object

Json

convertToJson(object* : Object) : String

Converts internal data structures passed as the object parameter to JSON representation. The object parameter must be an instance of a Record, List, Set or Map type otherwise an exception is thrown. Furthermore, the data structure represented by the object parameter can consist only of the following types: String, Boolean, Binary, Decimal, Integer, Date, Set, List, Map, Record, Enumeration. The function returns a string which represents the data in JSON format.

Parameters:

  • object

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncompatibleTypeError if the object is not a Record, List, Set, Map or the data structure represented by the object parameter contains an unsupported type
  • JsonProcessingError if an error occurred during conversion to JSON
jsonToMap(json* : String) : Map<String, Object>

Parses JSON string to a map. The json parameter represents the JSON string to parse.

Parameters:

  • json

Throws:

  • NullParameterError if a mandatory parameter is null
  • JsonProcessingError if the specified json cannot be parsed
mapToJson(map* : Map<String, Object>) : String

Converts map to JSON representation. The string keys of the map represent the keys of JSON object. The values of the map must be instances of String, Boolean, Binary, Decimal, Integer, Date, Record, Enumeration, Null, Set and List of the previously mentioned types, or Map<String, Object>. Otherwise an exception is thrown. Nested JSON objects are represented either by values of type Map<String, Object> or record instances. The function returns a string which represents the data in JSON format.

Parameters:

  • map

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncompatibleTypeError if the map value contains an unsupported type
  • JsonProcessingError if an error occurred during conversion to JSON
parseJson(json* : String, resultType* : Type<E>) : E

Parses JSON string to internal data structures. The json parameter represents the JSON string to parse and the resultType parameter determines the type of the returned data. The referred type must be a Record, List, Set or Map type, otherwise an exception is thrown. Furthermore the data structure represented by the resultType can consist only from these supported types: String, Boolean, Binary, Decimal, Integer, Date, Set, List, Map, Record, Enumeration.

Parameters:

  • json
  • resultType

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncompatibleTypeError if the resultType parameter is not a a Record, List, Set or Map type or if the data structure represented by the resultType parameter contains an unsupported type
  • JsonProcessingError if the json cannot be parsed

Ws

callHttp(sslConfig : SslConfig, endpointAddress* : String, httpMethod* : String, requestContentType* : String, input : String, login : String, password : String, readTimeout : Decimal, requestHeaders : Map<String, String>, responseHeaders : Reference<Map<String, String>>, resposeCode : Reference<Integer>, logMessages : Boolean) : String

Synchronous http call.

Parameters:

  • sslConfig ssl configuration if secure communication is required
  • endpointAddress url
  • httpMethod GET|PUT|POST|DETETE
  • requestContentType should be set if there is an input (payload)
  • input a payload (for PUT|POST)
  • login login name
  • password password
  • readTimeout timeout in milliseconds
  • requestHeaders request headers
  • responseHeaders reference where response headers are set
  • error reference where error object is set
  • logMessages if true request and response messages are logged to console
callWebservice(soapMetadata* : Map<String, String>, sslConfig : SslConfig, endpointAddress : String, login : String, password : String, input* : Record, requestSoapHeaders : List<Object>, requestHeaders : Map<String, String>, readTimeout : Decimal, outputType* : Type<T>, responseSoapHeaders : List<Object>, responseHeaders : Reference<Map<String, String>>, error : Reference<Object>, logMessages : Boolean) : T

Synchronous call of a webservice. It provides same functionality as the generated webservice task but can be used in expressions. It uses same data objects that are generated for webservice task and the same metadata.

Parameters:

  • soapMetadata same metadata as for webservice task
  • sslConfig ssl configuration if secure communication is required
  • endpointAddress webservice url. If not specified endpoint from metadata is used.
  • login login name
  • password password
  • input webservice input represented by a record
  • requestSoapHeaders map of soap request headers
  • requestHeaders map of request headers
  • readTimeout timeout in milliseconds
  • outputType lsps type of return value
  • responseSoapHeaders reference where response soap headers are set
  • responseHeaders reference where response headers are set
  • error reference where error object is set
  • logMessages if true request and response messages are logged to console

Auditing

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

Returns the audited record in the revision.

findByRevision(getBookByTitle("Death in Venice"), 7)

Parameters:

  • record the audited shared record
  • revision the required revision of the record

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 transaction.

Parameters:

  • revisionEntityType the
  • persist if true, a new revision entity is created even if no audited record was changed in the transaction

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncompatibleTypeError if the revisionEntity type is not a custom revision entity record type
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 either of the parameters is null, the period is unbounded from start or end respectively.

Parameters:

  • record the shared record changed in the revisions
  • from start of the period when the revisions were created
  • to end of the period when the revision were created

Throws:

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

Query

countAll(type* : Type<Record>) : Integer

Returns the count of all shared records of the given type.

Parameters:

  • type

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncompatibleTypeError if the type parameter is not a shared record type
findAll(type* : Type<E>) : List<E>

Returns all shared records of the given type.

Parameters:

  • type

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncompatibleTypeError if the type parameter is not a shared record type
findById(id* : Object, type* : Type<E>) : EDEPRECATED

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.

Parameters:

  • id
  • type

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncompatibleTypeError if the type parameter is not a shared record type
findById(type* : Type<E>, id* : Object) : 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.

Parameters:

  • type
  • id

Throws:

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

Utilities

debugLevel() : IntegerDEPRECATED
Returns an integer (100) representing the "Debug" log level. Deprecated. Replaced by constant DEBUG_LEVEL.
debugLog(message* : { : String}) : StringSIDE EFFECT

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.

Parameters:

  • message

Throws:

  • NullParameterError if a mandatory parameter is null
debugLog(message* : { : String}, level* : Integer) : StringSIDE EFFECT

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.

Parameters:

  • message
  • level

Throws:

  • NullParameterError if a mandatory parameter is null
errorLevel() : IntegerDEPRECATED
Returns an integer (400) representing the "Error" log level. Deprecated. Replaced by constant ERROR_LEVEL.
executeSqlFile(binaryInput* : Binary) : voidSIDE EFFECT

Execute provided SQL file. It skips empty lines and lines starting with – or ;

Parameters:

  • binaryInput
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.

Parameters:

  • key

Throws:

  • NullParameterError if a mandatory parameter is null
infoLevel() : IntegerDEPRECATED
Returns an integer (200) representing the "Info" log level. Deprecated. Replaced by constant INFO_LEVEL.
log(message* : String, level : Integer) : voidSIDE EFFECT

Logs a specified message to the application log at the specified log level. Unspecified level value logs at the "Info" level (value 200).

Parameters:

  • message
  • level

Throws:

  • NullParameterError if a 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"].

Parameters:

  • name

Throws:

  • NullParameterError if a mandatory parameter is null
  • IncorrectPathnameError if syntax of the specified name is incorrect
uuid() : String
Returns an universally unique identifier (UUID).
warningLevel() : IntegerDEPRECATED
Returns an integer (300) representing the "Warning" log level. Deprecated. Replaced by constant WARNING_LEVEL.