Creates new record proxy set with parent proxy set.
Parameters:
Returns proxied record of the proxy.
Parameters:
Returns true if the record is proxy, false otherwise.
Parameters:
Throws:
Merges changes from the proxies to the proxied records. It returns proxied records with applied changes.
Parameters:
Throws:
Merges changes from the proxies to the proxied records. It returns proxied records with applied changes.
Parameters:
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. The proxy objects are added to the proxy set if specified.
Parameters:
Throws:
Creates a proxy without proxied record. It can be used only for shared records. When merged a shared record is created.
Parameters:
Throws:
Creates proxy on the record and proxies for values referenced by named properties.
Parameters:
Throws:
Creates change proxy for all object referenced by the property and sets the proxy values to the property. If there are no listed properties the action is executed for all properties of the record type.
Parameters:
Throws:
Returns a collection created by appending the specified elements to the end of the collection. The original order of the added elements is preserved. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.
[1,2] + {2,3} //returns [1,2,2,3]; {2,3} + [1,2] //returns {2,3,1}
Parameters:
Throws:
Returns a map created as the union of the keys and their values of the two input maps. If a key is present in both maps, its value is set to the value of the key specified by the right map.
[1 -> "a"] + [1 -> "b", 2 -> "c"] //returns [1->"b",2->"c"]
Parameters:
Throws:
Returns a list created by appending the specified elements to the end of the list. The original order of the added elements is preserved in the returned list.
Parameters:
Throws:
Returns a set created by appending the specified elements to the end of the input set. The original order of the added elements is preserved.
{"s", "e", "a", "t"} + ["e", "d"] // returns{"s","e","a","t","d"}
Parameters:
Throws:
Removes all occurrences of the elements from the collection and returns the resulting 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.
[1,1,2,3] - [1]; // returns: [2,3] { "hello", 1,2,3} - ["hello"] // returns = {1,2,3}
Parameters:
Throws:
Removes all occurrences of the elements from the input list and returns the resulting list.
[ "hello", "hello", 1,2,3] - ["hello"] // returns = [1,2,3]
Parameters:
Throws:
Removes the elements from the input set and returns the resulting set.
{1,2,3} - [1]; // returns: [2,3]
Parameters:
Throws:
Returns a collection with the input-collection items and the specified elements added to the end of the collection. If the input collection is a set, the returned collection is Set. If the input collection is a list, the returned collectionc is List.
Parameters:
Throws:
Returns a list with the input-list items and the specified elements added to the end of the list.
[1,2,3].add(4, 4, 5)//returns [1,2,3,4,4,5]
Parameters:
Throws:
Returns a set with the input-set items and the specified elements added to the end of the set.
{1,2,3}.add(4, 4, 5)//returns {1,2,3,4,5}
Parameters:
Throws:
Returns a map with the input-map items and the element with the specified key-value pair added to the end of the map. If the key already exists in the map, the specified value overwrites the value of the existing key.
Parameters:
Throws:
Returns a collection created as the concatenation of the specified collections. 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.
addAll([1,2,3], {"a", "b"}, {true, false, null}) //returns [1,2,3,"a","b",true,false,null]
Parameters:
Throws:
Returns a map created as the union of keys and their respective values of all input 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.
addAll([1 -> "a"], [1 -> "b", 2 -> "a"], [1 -> "c"] ) //returns [1->"c",2->"a"]
Parameters:
Throws:
Returns a list created as concatenation of the input list and collections.
addAll([1,2],{3,4}, [4,5]) // returns [1,2,3,4,4,5]
Parameters:
Throws:
Returns a set created by concatenating the set and collections.
addAll({1,2},[3,4], [4,5]) //returns {1,2,3,4,5}
Parameters:
Throws:
Returns a collection with the input-collection items and the specified elements inserted at the position defined by the index parameter. The element originally located at the index position and any subsequent elements to the right are shifted to the indices incremented by the number of the elements added to the collection. The returned collection preserves the original order of the added elements. If the input collection is a set, the returned collection is Set. If the input collection is a list, the returned collection is List.
addAll({1,2}, 1, {42, 73}, {13})//returns {1,42,73,13,2}
Parameters:
Throws:
Returns a list with the input-list items and the specified elements inserted at the position defined by the index parameter. The element originally located at the index position and any subsequent elements to the right are shifted to the indices incremented by the number of the elements added to the list. The returned list preserves the original order of the added elements.
addAll([1,2], 1, [42, 73], [13]) //returns [1,42,73,13,2]
Parameters:
Throws:
Returns a set with the input-set items and the specified elements inserted at the position defined by the index parameter. The element originally located at the index position and any subsequent elements to the right are shifted to the indices incremented by the number of the elements added to the set. The returned set preserves the original order of the added elements.
addAll({1,2}, 1, {42, 73}, {13})//returns {1,42,73,13,2}
Parameters:
Throws:
Returns a collection created by adding the input elements to the input collection at the position specified by the index. The element at the index position and the subsequent elements are shifted to the index positions incremented by the number of the elements added to the set. 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:
Throws:
Returns a list created by adding the input elements to the input list at the position specified by the index. The element at the index position and the subsequent elements are shifted to the index positions incremented by the number of the elements added to the list.
addAt([1,1,2,3], 1, "a", 4.2) //returns [1,"a",4.2,1,2,3]
Parameters:
Throws:
Returns a set created by adding the input elements to the input set at the position specified by the index. The element at the index position and the subsequent elements are shifted to the index positions incremented by the number of the elements added to the set.
addAt({1,1,2,3}, 1, "a", 4.2) //returns [1,"a",4.2,1,2,3]
Parameters:
Throws:
Runs the function on each collection element and returns a collection with the output values as its elements. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.
collect({1,2}, {i:Integer -> i + 1}) //returns {2,3}
Parameters:
Throws:
Runs the function on each list element and returns a list with the output values as its elements.
collect([1,2], {i:Integer -> i + 1}) //returns [2,3]
Parameters:
Throws:
Runs the function on each map key-value pair and returns a list with the output values as its elements.
collect(["key" -> "value"], { key:String, value:String -> key + " " + value}) // returns ["key value"]
Parameters:
Throws:
Runs the function on each set element and returns a set with the output values as its elements.
collect({1,2}, {i:Integer -> i + 1}) //returns {2,3}
Parameters:
Throws:
Runs the function on each element of the input collection and returns a collection with the output values as its elements. The function takes 2 parameters: the index of the element and the element itself. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.
collectWithIndex( collection -> {"a", "b"}, function -> { index:Integer, item:String -> if index == 0 then item := "c" else item :="d" end } ) //returns {"c","d"}
Parameters:
Throws:
Runs the function on each list element and returns a list with the output values as its elements. The function takes 2 parameters: the index of the element and the element itself.
collectWithIndex( ["a", "b"], { index:Integer, item:String -> if index == 0 then item := "c" else item :="d" end } ) //returns ["c","d"]
Parameters:
Throws:
Runs the function on each set element and returns a set with the output values as its elements. The function takes 2 parameters: the index of the element and the item element.
collectWithIndex( {"a", "b"}, { index:Integer, item:String -> if index == 0 then item := "c" else item :="d" end } ) //returns {"c","d"}
Parameters:
Throws:
Removes the elements with the null
value from the input collection and returns a collection with the non-null elements. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.
compact({"a", "b", null}) // returns {"a","b"}
Parameters:
Throws:
Removes the elements with the null
value from the input list and returns a list with the non-null elements.
compact(["a", "b", null]) // returns ["a","b"]
Parameters:
Throws:
Removes the elements with the null
value from the input set and returns a set with the non-null elements.
compact({"a", "b", null}) // returns {"a","b"}
Parameters:
Throws:
Returns true
if the collection contains all specified elements.
contains(["a","b"], "a", "b") //returns true
Parameters:
Throws:
Returns true
if the collection contains all elements from the specified collection.
containsAll({1,2,3}, [1, 1, 2]) //returns true
Parameters:
Throws:
Returns true
if the collection contains any of the specified elements.
containsAny([1,1,11], {1, 3}) // returns true
Parameters:
Throws:
Returns true
if the map contains all specified keys.
containsKeys(["a"-> 1, "b" -> 2], "a", "c") //returns false
Parameters:
Throws:
Returns true
if the map contains all specified values.
containsKeys(["a"-> 1, "b" -> 2], 1, 2) //returns true
Parameters:
Throws:
Returns the number of elements in the given collection which satisfy the given condition.
count([1,2,3,4,55], {i:Integer -> i > 3}) //returns 2
Parameters:
Throws:
Returns true
if the condition is true
for at least one element in the collection.
exists([1,2,3,4,55], {i:Integer -> i > 54}) //returns trues
Parameters:
Throws:
Returns the index of the first collection element which satisfies the specified condition. If the condition is false
for all elements of the collection, it returns -1
.
findIndex( collection -> [1,22,3, 44], condition -> { i:Integer -> i > 21 } ) //returns 1
Parameters:
Throws:
Returns the index of the first collection element starting at fromIndex inclusive, which satisfies the specified condition. If the condition is false
for all elements of the collection starting at fromIndex, it returns -1
. If the fromIndex parameter is null
or is less than 0, index 0 is used as the fromIndex.
findIndex( collection -> [1,22,3, 44], fromIndex -> 2, condition -> { i:Integer -> i > 21 } ) //returns 3
Parameters:
Throws:
Returns the index of the first collection element starting at fromIndex inclusive and ending with the toIndex exclusive which satisfies the specified condition. If the condition is false
for all elements of the collection in the specified range, it returns -1
. If the fromIndex parameter is null
or is less than 0, index 0 is used as the fromIndex. If the toIndex parameter is null
or greater or equal to the size of the collection, it is set to the last index of the collection.
findIndex( collection -> [1,22,3, 44], fromIndex -> 2, toIndex -> 3, condition -> { i:Integer -> i > 21 } ) //returns -1
Parameters:
Throws:
Returns the index of the last collection element which satisfies the specified condition. If the condition is false
for all elements of the collection, it returns -1
.
findLastIndex( collection -> [1,22,3, 44], condition -> { i:Integer -> i > 21 } ) // returns 3
Parameters:
Throws:
Returns the index of the last collection element which meets the condition. The check takes the elements starting from the toIndex position and continues toward index 0. If no element meets the condition, it returns -1
. If toIndex is null
, or greater or equal to the size of the collection, it is set to the last index of the collection.
findLastIndex( collection -> [1, 33, 4, 22,3, 44], toIndex -> 5, condition -> { i:Integer -> i > 21 }) ) //returns 3 (checked 3 and 22; //returned the position of 22)
Parameters:
Throws:
Returns the index of the last collection element that meets the condition. The function searches starting from the toIndex and ending at the element preceeding the fromIndex element. If no element that meets the condition is found in the specified element range, it returns -1
. If the fromIndex parameter is null
or less than 0, the search finishes at the beginning of the collection (index 0). If the toIndex parameter is null
or greater or equal to the size of the collection, it is considered to be the end of the collection.
findLastIndex( collection -> [1, 33, 4, 22,3, 44], fromIndex -> 1, toIndex -> 4, condition -> { i:Integer -> i > 21 }) //returns 3 (the index of 22)
Parameters:
Throws:
Combines the elements of the collection using the binary function, an operation upon two operands of the same type. The binary function executes over the input collection from left to right. The first input T for the function is defined by initialValue and the first element in the collection. In each next iteration, the function returns the resulting computed value which is used as the input value for the next iteration with the next element of the collection. The last computed value is the result of the fold function.
fold([1,2,3], 4, { i:Integer, n:Integer -> i + n}); // returns 10: 4 + 1 = 5; 5 + 2 = 7; 7 + 3 = 10 fold([ "b", "c", "d"] , "a;", { param1:String, param2:String -> param1 + " " + param2+ ";"}) //returns "a; b; c; d;"
Parameters:
Throws:
Combines the elements of the collection using the binary function, an operation upon two operands of the same type. The binary function executes over the input collection from left to right. The first input T for the function is defined by initialValue and the first element in the collection. In each next iteration, the function returns the resulting computed value which is used as the input value for the next iteration with the next element of the collection. Input of the function includes the index number of the E element. The last computed value is the result of the fold function.
foldWithIndex(["a","b","c","d"],"d",{i:Integer, t:String, e:String -> t + e + " index: " + i.toString() + "; "}) // returns "da index: 0; b index: 1; c index: 2; d index: 3; "
Parameters:
Throws:
Returns true if the condition is true for all elements in the collection.
forAll({4,3,2,1}, {e:Integer -> e > 0}); //returns true forAll({4,3,2,1}, {e:Integer -> e > 1}) //returns false
Parameters:
Throws:
Returns the set of duplicate elements in the given collection.
getDuplicates([1,2,3,1, "a","a", "b"]) //result {1,"a"}
Parameters:
Throws:
Returns the first element of the collection, or null if the collection is empty.
getFirst({4,3,2,1}) //returns 4
Parameters:
Throws:
Returns the first element for which the condition is true. Returns <code>null</cod> if the collection is empty or the condition is not true for any of the collection elements.
getFirst({4,3,2,1},{e:Integer -> e<4}) //returns 3
Parameters:
Throws:
Returns the last item of the collection, or null if the collection is empty.
getLast({4,3,2,1}) //returns 1
Parameters:
Throws:
Returns the last element for which the condition is true. Returns <code>null</cod> if the collection is empty or the condition is not true for any of the collection elements.
getLast([1,2,4,3,1],{e:Integer -> e>1}); //returns 3 getLast({4,3,2,1},{e:Integer -> e>1}); //returns 2
Parameters:
Throws:
The function performs a group-by operation on the collection elements according to the value returned by the classifier function, and returns the result in a map.
groupBy([1,2,3,4,5], {e:Integer -> e < 3}); //returns [false->[3,4,5],true->[1,2]] groupBy(["a", "b", "c", 1, 2, now()], {e:Object -> e.getType()}) //returns [Integer->[1,2],String->["a","b","c"],Date->[d'2018-06-05 16:19:29.106']]
Parameters:
Throws:
Returns true
if the collection contains duplicate elements, false
otherwise.
hasDuplicates([2,2]) //returns true
Parameters:
Throws:
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.
indexOf([0,1,2,3,4, 2], 2) //returns 2
Parameters:
Throws:
Returns true
if the collection contains no elements.
isEmpty([]) // returns true
Parameters:
Throws:
Returns true if the specified map contains no elements.
isEmpty([null -> null]); //returns false isEmpty(["" -> ""]); //returns false isEmpty([->]); //returns true
Parameters:
Throws:
Returns true
if set1 is a subset of set2.
isSubset({1,2,3},{1,2,3,4}); //returns true isSubset({null,1,2,3},{1,2,3,4}) //returns false
Parameters:
Throws:
Concatenates all non-empty string representations of the collection elements separating them with a comma and space (", ").
join(["a", "b", "c", null, "", "d"]) //returns "a, b, c, d"
Parameters:
Throws:
Concatenates all non-empty string representations of the collection elements separating them with joinString.
join(["a", "b", "c", null, "", "d"], ", ") //returns "a, b, c, d"
Parameters:
Throws:
Concatenates all string representations of the collection elements. The element are separated with joinString. If includeEmpty is true
, null
and empty elements are included in the resulting string.
join(["a", "b", "c", null, "", "d"], ", ", false) // returns "a, b, c, d"
join(["a", "b", "c", null, "", "d"], ", ", true) //returns "a, b, c, , , d"</pre>
Parameters:
Throws:
Returns a set of keys contained in the specified map.
keys([1->"a", 2->"b", 3 -> "a"]) //returns {1,2,3}
Parameters:
Throws:
Returns the keys for all occurrences of the specified value included in the map.
keysOf([1->"a", 2->"b", 3 -> "a"], "a") //returns {1,3}
Parameters:
Throws:
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.
lastIndexOf([1,2,3,1,5,6], 1) //returns 3
Parameters:
Throws:
Returns a list containing all elements from all the collections. Null values of collection are treated as empty collections.
listUnion([[null, 1,2,3, "hello"], [1,2,55]]) = [null,1,2,3,"hello",1,2,55]
Parameters:
Returns a map with the collection elements as its keys and values computed from the collection elements by the valueFunction.
map({1,2,3}, {e:Integer -> e + 10} ) //returns [1->11,2->12,3->13]
Parameters:
Throws:
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 map. If the keys parameter contains the same key several times, the most recently used key-value pair is included in the resulting map.
map([1,1,3, null],["a","b","c", null]) //result [1->"b",3->"c", null->null]
Parameters:
Throws:
Returns a map with keys and values both computed based on the collection elements. For each map key-value pair, the key is calculated with the keyFunction and the value with the valueFunction. Both have the collection element as their input.
map({1,2,3}, {e:Integer -> e + 1 }, {e:Integer -> e + 10} ) //returns [2->11,3->12,4->13]
Parameters:
Throws:
Returns the minimum element of the collection or null
if the collection is empty.
Parameters:
Throws:
Returns maximal value from collection; or null, if the collection is empty.
Parameters:
Throws:
Returns the maximum element of the collection or <code>null</ccode> if the collection is empty.
max([0.1,1.4,2.2,3.9,-2.8]) //returns 3.9
Parameters:
Throws:
Returns the maximum element of the collection or <code>null</ccode> if the collection is empty.
max([0,1,2,3,-2]) //returns 3
Parameters:
Throws:
Returns the string that is first as per Java lexicographic ordering of strings. Returns null
if the collection is empty.
max(["haha", "yes", "no"]) //returns "yes"
Parameters:
Throws:
Returns the minimum element of the collection or null
if the collection is empty.
Parameters:
Throws:
Returns minimal value from collection; or null, if the collection is empty.
Parameters:
Throws:
Returns the minimum element of the collection or null
if the collection is empty.
min([0.9,1.0,2.4,3.1,-2.9]) //returns -2.9
Parameters:
Throws:
Returns the minimum element of the collection or <code>null</ccode> if the collection is empty.
min([0,1,2,3,-2]) //returns -2
Parameters:
Throws:
Returns the string that is first as per Java lexicographic ordering of strings. Returns null
if the collection is empty.
min(["haha", "yes", "no"]) //returns "haha"
Parameters:
Throws:
Returns true
, if the specified collection contains at least one element.
Parameters:
Throws:
Returns true
if the input map contains at least one element.
notEmpty([1->1]) // returns true
Parameters:
Throws:
Removes the first occurrence of each of the elements from the input collection and returns the resulting 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.
remove([1,1,2,3] ,1,2); // returns: [1,3] remove({1,2,3} , 2) // returns = {1,3}
Parameters:
Throws:
Removes the first occurrence of the elements from the input list and returns the resulting list.
removeAll([1,1,2,3] ,[1]); // returns: [2,3]
Parameters:
Throws:
Removes the elements from the input set and returns the resulting set.
remove({1,2,3,"hello"} , "hello", 2) // returns = {1,3}
Parameters:
Throws:
Removes all occurrences of the elements from the input collection and returns the resulting 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.
removeAll([1,1,2,3] ,[1]); // returns: [2,3] removeAll({ "hello", 1,2,3} , ["hello"]) // returns = {1,2,3}
Parameters:
Throws:
Removes all occurrences of the elements from the input list and returns the resulting list.
removeAll([ "hello", "hello", 1,2,3], ["hello"]) // returns [1,2,3]
Parameters:
Throws:
Removes the elements from the input set and returns the resulting set.
{1,2,3} - [1]; // returns: {2,3}
Parameters:
Throws:
Removes the element at the index position in the input collection and returns the new 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.
removeAt([1,2,3,4], 2) // returns [1,2,4]
Parameters:
Throws:
Removes the element at the index position in the input list and returns the new list.
removeAt([1,2,3,4], 2) // returns [1,2,4]
Parameters:
Throws:
Removes the element at the index position in the input set and returns the new set.
removeAt({1,2,3,4}, 2) // returns {1,2,4}
Parameters:
Throws:
Removes all key-value pairs with the keys defined by the keys parameter and returns the resulting map.
removeKey([ 1 -> "a", "a" -> 2, 3 -> "c"], "a", "c") // returns ["a"->2,3->"c"]
Parameters:
Throws:
Removes all key-value pairs with the keys defined by the keys parameter and returns the resulting map.
removeKeys([ 1 -> "a", "a" -> 2, 3 -> "c"], ["a", "c"]) // returns ["a"->2,3->"c"]
Parameters:
Throws:
Returns a collection with the elements of the input collection that are out of the specified element range. The range of removed elements starts with fromIndex and finishes at the element preceding the toIndex element. If fromIndex is null
or is less than 0, the range starts from the beginning of the collection (index 0). If toIndex is null
or greater or equal to the size of the collection, the range ends at the end of 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.
removeRange([0, 1, 2, 3, 4], 2, 4) // returns [0,1,4]
Parameters:
Throws:
Removes the elements of the input list that are in the specified element range from the input list and return the resulting list. The range of removed elements starts with fromIndex and finishes at the element preceding the toIndex element. If fromIndex is null
or is less than 0, the range starts from the beginning of the list (index 0). If toIndex is null
or greater or equal to the size of the list, the range ends at the end of the list.
removeRange({0, 1, 2, 3, 4}, 2, 4) // returns {0,1,4}
Parameters:
Throws:
Removes the elements of the input set that in the specified element range and returns the resulting set. The range of removed elements starts with fromIndex and finishes at the element preceding the toIndex element. If fromIndex is null
or is less than 0, the range starts from the beginning of the set (index 0). If toIndex is null
or greater or equal to the size of the set, the range ends at the end of the set.
removeRange([0, 1, 2, 3, 4], 2, 4) // returns [0,1,4]
Parameters:
Throws:
Returns a map created by removing all key-value pairs with the values defined by the values parameter.
removeValue([ 1 -> "a", "a" -> 2, 3 -> "c"], "a", "c") // returns ["a"->2]
Parameters:
Throws:
Returns a collection created by replacing all occurrences of element1 with element2 in 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.
replace([1,2,3,1,2,3],1, "hello") // returns ["hello",2,3,"hello",2,3]
Parameters:
Throws:
Returns a list created by replacing all occurrences of element1 with element2 in the input list.
replace([1,1,2,3], 1, "hello") // returns ["hello","hello",2,3]
Parameters:
Throws:
Returns a set created by replacing element1 with element2 in the input set.
replace({1,1,2,3}, 1, "hello") = {"hello",2,3}
Parameters:
Throws:
Returns a map created by replacing all values defined by value1<i> with <i>value2 in the input map.
replaceValue([ 1 -> 1.0, 2 -> 1.0, 3 -> 2.0], 1.0, 4.2) // return [1 -> 4.2, 2 -> 4.2, 3 -> 2]
Parameters:
Throws:
Returns a collection of the elements from the input collection that are contained in each of the 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.
retainAll([1,1,2,3], [1,3,4,5], [1,1,1,3,4,5]); // returns [1,1,3] retainAll({1,2,3}, [1,2,3,4,5], [1,3,4]) //returns {1,3}
Parameters:
Throws:
Returns a list of the elements from the input list that are contained in each of the collections. The relative order of the retained elements remains unchanged.
retainAll([1,1,2,3], [1,3,4,5], [1,1,1,3,4,5]); // returns [1,1,3]
Parameters:
Throws:
Returns a set created by the intersection all the collections, the input set and the collections. The relative order of the retained elements remains unchanged.
retainAll({1,2,3}, [1,2,3,4,5], {1,3,4}) //returns {1,3}
Parameters:
Throws:
Reverses the order of the elements in the input collection and returns them in a new 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.
reverse([1,1,2.1,2.1,3,4.2]) // returns [4.2,3,2.1,2.1,1,1]; reverse({1,1,2.1,3,4.2}) // returns {4.2,3,2.1,1}
Parameters:
Throws:
Reverses the order of the elements in the input list and returns them in a new list.
reverse([1,1,2.1,2.1,3,4.2]) // returns [4.2,3,2.1,2.1,1,1]
Parameters:
Throws:
Reverses the order of the elements in the input set and returns them in a new set.
reverse({1,1,2.1,3,4.2}) // returns {4.2,3,2.1,1}
Parameters:
Throws:
Returns a colection with 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.
select([1,1,2.1,3,4.2],{ d:Decimal -> d > 2}) // returns [2.1,3,4.2]
Parameters:
Throws:
Returns a collection with those input-collection elements that are of the given type. The null
elements are excluded. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.
select([1,1,2.1,3,4.2, null],Integer) // returns [1,1,3] select({1,2.1,3,4.2, null},Integer) // returns {1,3}
Parameters:
Throws:
Returns a list with those elements from the input list which meet the condition.
select([1,1,2.1,2.1,3,4.2],{ d:Decimal -> d > 2}) // returns [2.1,2.1,3,4.2]
Parameters:
Throws:
Returns a list with those input-list elements that are of the given type. The null
elements are excluded.
select({1,2.1,3,4.2, null},Integer) // returns {1,3}
Parameters:
Throws:
Returns a map with those elements of the input map for which the condition closure return true
select([1 -> "a", 2 -> "b", 3 -> "b"], {k:Integer, v:String -> k > 1 and v =="b"}) // returns [2->"b",3->"b"]
Parameters:
Throws:
Returns a set with those elements from the input set which meet the condition.
select({1,1,2.1,3,4.2},{ d:Decimal -> d > 2}) // returns {2.1,3,4.2}
Parameters:
Throws:
Returns a set with those input-set elements that are of the given type. The null
elements are excluded.
select({1,2.1,3,4.2, null},Integer) // returns {1,3}
Parameters:
Throws:
Replaces the element of the collection at the index position with the new element and returns the new 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.
setAt([1,2,4], 2, 3) //returns [1,2,3]
Parameters:
Throws:
Replaces the element of the list at the index position with the new element and returns the new list.
setAt([1,2,4], 2, 3) //returns [1,2,3]
Parameters:
Throws:
Replaces the element of the set at the index position with the new element and returns the new set.
setAt([1,2,4], 2, 3) //returns [1,2,3]
Parameters:
Throws:
Returns the number of elements in the collection.
Parameters:
Throws:
Returns the number of elements in the map.
Parameters:
Throws:
Sorts the input-collection elements sorted in ascending or descending order and returns the resulting collection.
sort([d'2015-12-24 20:00:00.000', now()] , true) //returns [d'2015-12-24 20:00:00.000',d'2018-06-04 10:25:01.142']
Parameters:
Throws:
Sort the input-collection elements in ascending or descending order and returns the resulting collection.
sort([ 2e+12, 0, -1.2342e0, -4.2] , true) //returns [-4.2,-1.2342,0,2000000000000]
Parameters:
Throws:
Sorts the input-collection elements in ascending or descending order and returns the resulting collection.
sort([ 1, 0, 1, -4], true) //returns [-4,0,1,1]
Parameters:
Throws:
Sorts the input-collection elements in ascending or descending order and returns the resulting collection.
sort(["č", "4","aa", "#", "C", "c"], true) //returns ["#","4","C","aa","c","č"]
Parameters:
Throws:
Sorts the collection elements according to the comparator closure and returns the resulting collection. The comparator defines the total ordering function: It takes two elements of the input collection and returns a negative integer when the first parameter is less than the second parameter, zero when the first parameter is equal to the second parameter, or a positive integer when the first parameter is greater than the second parameter. If the input collection is a set, the returned type is Set. If the input collection is a list, the returned type is List.
sort({ 100, 1, 123, 342}, { a:Integer, b:Integer -> if a > b then 1 elsif a=b then 0 else -2 end}) //returns {1,100,123,342}
Parameters:
Throws:
Sorts the input-list elements in ascending or descending order and returns the resulting list.
sort([d'2015-12-24 20:00:00.000', now()] , true) //returns [d'2015-12-24 20:00:00.000',d'2018-06-04 10:25:01.142']
Parameters:
Throws:
Sorts the input-list elements in ascending or descending order and returns the resulting list.
sort([ 2e+12, 0, 0,-1.2342e0, -4.2] , true) //returns [-4.2,-1.2342,0,0,2000000000000]
Parameters:
Throws:
Sorts the input-list elements in ascending or descending order and returns the resulting list.
sort([ 1, 0, 1, -4], true) //returns [-4,0,1,1]
Parameters:
Throws:
Sorts the input-list elements in ascending or descending order and returns the resulting list.
sort(["č", "4","aa", "#", "C", "c", "aa"], true) //returns ["#","4","C","aa","aa","c","č"]
Parameters:
Throws:
Sorts the elements of the collection according to the comparator closure and returns the resulting list. The comparator defines the total ordering function: it takes two elements of the input collection and returns a negative integer when the first parameter is less than the second parameter, zero when the first parameter is equal to the second parameter, or a positive integer when the first parameter is greater than the second parameter.
sort( [4, 1, 3, 0, 2, 2], { a:Integer, b:Integer -> if a > b then 1 elsif a=b then 0 else -2 end}) //returns [0,1,2,2,3,4]
Parameters:
Throws:
Sorts the input-set elements sorted in ascending or descending order and returns the resulting set.
sort({d'2015-12-24 20:00:00.000', now(), now()} , true) //returns [d'2015-12-24 20:00:00.000',d'2018-06-04 10:25:01.142']
Parameters:
Throws:
Sorts the input-set elements in ascending or descending order and returns the resulting set.
Parameters:
Throws:
Sorts the input-set elements in ascending or descending order and returns the resulting set.
sort({ 1, 0, 1, -4, -4}, true) //returns {-4,0,1,1}
Parameters:
Throws:
Sorts the input-set elements in ascending or descending order and returns the resulting set.
sort({"č", "4","aa", "aa","#", "C", "c", "aa"}, true) //returns {"#","4","C","aa","c","č"}
Parameters:
Throws:
Sort the elements of the collection according to the comparator closure and returns the resulting set. The comparator defines the total ordering function: it takes two elements of the input collection and returns a negative integer when the first parameter is less than the second parameter, zero when the first parameter is equal to the second parameter, or a positive integer when the first parameter is greater than the second parameter.
sort({ 4, 1, 3, 0, 2, 2}, { a:Integer, b:Integer -> if a > b then 1 elsif a=b then 0 else -2 end}) //returns {0,1,2,3,4}
Parameters:
Throws:
Sorts the input-collection elements by the keys produced by the keyExtractor closure and returns the resulting collection. The keys must be comparable: they must be strings, decimals, integers, or dates. ascending defines whether the list elements are in natural or reverse order: When true
, natural order is used. nullsFirst specifies whether null
keys are considered smaller or greater in natural order: When true
, null
values are at the beginning of the list.
sortByKey( collection -> [10,3,2,13, null, 4], keyExtractor -> { i:Integer -> i }, ascending -> true, nullsFirst -> true ) //returns [null, 2,3,4,10,13]
Parameters:
Throws:
Returns the part of the input collection which starts with the element on the fromIndex position and finishes at the element preceding the toIndex. If fromIndex is null
or is less than 0, the sub-collection starts from the beginning of the collection. If toIndex is null
or, equal or greater than the size of the collection, the sub-collection ends at the end of the input collection.
subCollection([0, 1, 2, 3, 4], -2, 10) // returns [0,1,2,3,4]
Parameters:
Throws:
Returns the part of the input list which starts with the element on the fromIndex position and finishes at the element preceding the toIndex. If fromIndex is null
or is less than 0, the sub-list starts from the beginning of the list. If toIndex is null
or, equal or greater than the size of the list, the sub-list ends at the end of the input list.
subList([1,1,2,3,4, 5], 2, 4) //returns [2,3]
Parameters:
Throws:
Returns the part of the input set which starts with the element on the fromIndex position and finishes at the element preceding the toIndex. If fromIndex is null
or is less than 0, the sub-set starts from the beginning of the set. If toIndex is null
or, equal or greater than the size of the set, the sub-set ends at the end of the input set.
subset({0, 1, 2, 3, 4}, null, 3) // returns {0,1,2}
Parameters:
Throws:
Returns the sum of the decimals in the given collection.
sum( [1,3.2]) //returns 4.2
Parameters:
Throws:
Swaps the elements at the given indexes in the input list and returns the resulting list. s swap ([1, 3, 2], 1, 2) // returns [1,2,3]
Parameters:
Throws:
Returns a list of elements of the input collection arranged in an arbitrary order.
toList([1,1,2,3,3]) ///returns [1,1,2,3,3]
Parameters:
Throws:
Returns a set with the elements of the input collection.
toSet([1 , 1, 2]) // returns {1,2} toSet({1 , 1, 2}) // returns {1,2}
Parameters:
Throws:
Returns a list of values in the input map.
values([1 -> "b", 2 -> "c"]) // returns ["b","c"]
Parameters:
Throws:
Creates a persisted binary handle that represents a file. If the mime type is not specified, it is determined based on the file extension. If no charset is defined, UTF-8 is used.
Parameters:
Throws:
Returns a binary handle with the identifier.
Parameters:
Throws:
Returns a binary handle metadata.
Parameters:
Throws:
Creates a file from the resource of a module of the model. If a model is based on module A and module A imports modules B and C, module B can access resourceses from C.
def File myFile := getResource("my_ imported_module", "output/myfile.txt")
Parameters:
Throws:
Creates a binary handle from a module resource located at the specified path
Parameters:
Throws:
Returns the size of the binary in bytes.
def Integer contentSize : = size(myBinaryHolder.content)
Parameters:
Converts the string to binary.
Parameters:
Converts binary to a string encoded in the given charset. If no charset is defined, UTF-8 is used. The supported charsets are defined in java.nio.charset.StandardCharsets and include US-ASCII, ISO-8859-1, UTF-8, UTF-16BE, UTF-16LE, UTF-16, etc.
Parameters:
Throws:
Transforms the input enumeration literal to its name represented as a string
literalToName(Level.BEGINNER).toLowerCase() //returns "beginner"
Parameters:
Throws:
Returns the list of literals of the input enumeration.
literals(Level) //returns [common::Level.BEGINNER, common::Level.INTERMEDIATE, common::Level.ADVANCED]
Parameters:
Throws:
Transforms the input name to the corresponding literal value of the input enumeration.
nameToLiteral(Level, "BEGINNER") //returns the enumeratation literal common::Level.BEGINNER
Parameters:
Throws:
Transforms the input enumeration name to the corresponding enumeration value. The enumeration name must be in the following format: MODULE_NAME::ENUMERATION_NAME.LITERAL_NAME
toEnumeration("common::Level.BEGINNER") //returns the enumeration literal common::Level.BEGINNER
Parameters:
Throws:
Returns the enumeration literal label.
Parameters:
Throws:
Returns the property label of the record or interface property.
getLabel(Registration.firstName)
Parameters:
Throws:
Returns the label of the record, enumeration, or interface type.
getLabel(RegistrationData)
Parameters:
Throws:
Populates the PDF form template with the values from the FDF document and returns the resulting PDF.
Parameters:
Populates the PDF form template with the values specified by the values parameter using the FDF merging method and returns the resulting PDF document. The parameter names and values are specified by the parameters map.
Parameters:
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:
Populates the XFA template with the specified data and returns the resulting PDF document. The input data must conform to the XML schema required by the template.
Parameters:
Finds a tag with the 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 (more validation tags with the name exist in different imported modules), an error is thrown.
Parameters:
Throws:
Validates the given record property against its constraints with the given tags. If the record is null, an empty list is returned. If the property parameter is null, all properties of the record are validated.
validate(new Simple(field -> "a"), null, null, null)
Parameters:
Throws:
Validates the given property in all records in the collection against the property constraints with the given tags. If the collection is null, an empty list is returned. Null elements of the collection are ignored. If the property parameter is null, all properties of the records are validated.
Parameters:
Throws:
Returns true
if the input string contains the substring.
"hello".contains("he") //returns true
Parameters:
Finds all occurrences of the regexp pattern in the specified string and returns them as a list of strings. If no string is matched, the function returns an empty list. The Java regular expression syntax as defined in the java.util.regex.Pattern class is used.
find("one two three fourteen", "([\w]+)") //returns ["one", "two", "three", "fourteen"]
Parameters:
Throws:
Formats the objects in the arguments parameter using the format in the pattern parameter and returns the resulting string. The pattern uses the syntax defined in the java.util.Formatter class restricted to the formatting commands that apply to the Java data types used to represent the Expression Language data types. The arguments data type 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 other data types -> java.lang.String using the function core::toString
The format() function uses the server locale for formatting numbers and dates.
format( "The boolean is 100%% %2$s, %1$s !", "John", false); //returns "The boolean is 100% false, John !" format( "Today is %tB %tm", now(), now()); //returns "Today is June 06"
Parameters:
Throws:
Formats the objects in the arguments parameter using the format in the pattern parameter and returns the resulting string. The pattern uses the syntax defined in the java.util.Formatter class restricted to the formatting commands that apply to the Java data types used to represent the Expression Language data types. The arguments data type 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 other data types -> java.lang.String using the function core::toString
The locale parameter determines the locale used for formatting numbers and dates. If it is null, the server locale is used.
formatWithLocale("%tB", "en_US", now()); //returns "June" formatWithLocale("%tB.", "it", now()); //returns giugno
Parameters:
Throws:
Returns the index of the first occurrence of the specified substring within the string.
indexOf("abcabc", "b");//returns 1 indexOf("abcasbc", "ca") //returns 2
Parameters:
Throws:
Returns the index of the first occurrence of the specified substring within the input string starting from the specified index.
indexOf("abcdefghabcdefgh", "ab", 2) //returns 8
Parameters:
Throws:
Returns true if the string is null, has zero length (contains no characters) or only contains only whitespaces.
" ".isBlank() //returns true
Parameters:
Returns true if the string is either null or has zero length (contains no characters).
" ".isEmpty(); //returns false "".isEmpty() //returns true
Parameters:
Returns the index of the rightmost occurrence of the specified substring in the input string.
lastIndexOf("ababab", "a") //returns 4
Parameters:
Throws:
Returns the index of the last occurrence of the specified substring within the string searching backward starting at the specified index.
lastIndexOf("aabba", "a", 3) //returns 1
Parameters:
Throws:
Returns the length of the specified string.
"123 45".length() //returns 6
Parameters:
Throws:
Replaces all localizable substrings in the string parameter by the corresponding localized strings from the specified language.
localize($save_button() + ", " + $load_button(), "EN") //returns "Save, Load"
Parameters:
Throws:
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.
"abccccD".matches("\a[^h]c{3}.*") //returns true
Parameters:
Throws:
Replaces each occurence of the regexp<i> parameter substring in the specified <i>string with the replacement parameter. The Java regular expression syntax as defined in the java.util.regex.Pattern class is used.
replaceAll("replace replace me", "w++", "please ") //returns "please please please"
Parameters:
Throws:
Replaces the first occurrence of the regexp parameter in the string parameter with the string specified by the replacement parameter and returns the resulting string. The Java regular expression syntax as defined in the java.util.regex.Pattern class is used.
replaceFirst("replace replace me", "w++", "Please ") //returns "Please replace me"
Parameters:
Throws:
Splits the string at the positions that match the regular expression. The Java regular expression syntax as defined in the java.util.regex.Pattern class is used.
split("one two three", "s") //returns ["one", "two", "three"]
Parameters:
Throws:
Returns a substring of the input string starting at the fromIndex position (inclusive) and ending at the toIndex position (exclusive). If the fromIndex is null or is less than 0, it is considered 0. If the toIndex is null, equal, or greater than the length of the string, the substring ends at the end of the string (index given by length(string)-1).
substring("0123Hello World!", 4, 20 ) //returns "Hello World!"
Parameters:
Throws:
If possible, converts the specified string to a decimal. If not possible, the function throws a runtime exception.
toDecimal("4.2") //returns 4.2
Parameters:
Throws:
If possible, converts the specified string to an integer. If not possible, the function throws a runtime exception.
"123 45".toInteger(); //returns FormatError "12345".toInteger() //returns 12345
Parameters:
Throws:
Converts the integer in the specified string to an integer using the specified radix. The radix must be between 2 and 36 (inclusive). If not possible, the function throws a runtime exception.
toInteger("15",36) //returns 41
Parameters:
Throws:
Converts all characters of the specified string to lowercase.
toLowerCase("Hello World!"); toLowerCase("Hello World!"); "Hello World!".toLowerCase()
Parameters:
Throws:
Converts the specified object to a string.
toString(findById(Model, 1))
Parameters:
Converts all characters of the specified string to uppercase.
toUpperCase("Hello World!") //returns "HELLO WORLD!"
Parameters:
Throws:
Eliminates leading and trailing spaces from the input string and returns the resulting string.
" hello world! ".trim() //returns "hello world!"
Parameters:
Throws:
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.
convertToXml(new MyRecord(item -> "value"))
Parameters:
Throws:
Parses xml to resultType record and returns the result in the resultType record.
parseXml( "<?xml version=""1.0"" encoding=""UTF-8""?> <ns0:ParsedXml xmlns:ns0=""restCall"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""> <ns0:item>value</ns0:item> </ns0:ParsedXml>", ParsedXml)
Parameters:
Throws:
Activates inactive and finished goals. If a goal from the collection is active, the goal status remains unchanged.
Parameters:
Throws:
Deactivates not finished goals. If a goal from the collection is finished or its goal’s process is finished, the goal status remains unchanged.
Parameters:
Throws:
Returns the set of all sub-achieve goals into which the specified goal is directly or indirectly decomposed.
getAllSubGoals(TripArranged)
Parameters:
Returns the set of all direct sub-achieve goals into which the specified goal is decomposed.
getSubGoals(TripArranged)
Parameters:
Returns true
if the goal or the plan defined by the goalPlan parameter is in the specified state or a sub-state of the state. If the goalPlan parameter is specified correctly but the state parameter contains an incorrect string representation of a state or is null, the function returns false
.
Goal2.isInState(READY)
Parameters:
Throws:
Returns the key type of the given map type. Deprecated. Use getKeyType(Type<Map<K,V>>) instead.
Parameters:
Throws:
Returns the item type of the given collection type.
getItemType(getType([1,2,3])),2}])) //returns Set<Integer>
Parameters:
Throws:
Returns the value type of the given map type. Deprecated. Use getValueType(Type<Map<K,V>>) instead.
Parameters:
Throws:
Returns the key type of the given map type.
getKeyType(getType([now()-> 1, now() -> "a"])) //returns Date
Parameters:
Throws:
Returns the referenced type of the given reference type.
def Integer i; getReferencedType(typeOf(&i)) //returns Integer
Parameters:
Throws:
Returns the supertype of the given record type.
Throws: -"NullParameterError" - Mandatory parameter is null.
Parameters:
Returns the value type of the given map type.
getValueType(typeOf([1 -> "a"])) //returns String
Parameters:
Throws:
If possible, parses the specified string to a type. If the given string does not represent a valid type, the function throws an error. <pre>toType("{Integer:Integer}"); //returns {Integer:Integer}
Parameters:
Throws:
Returns the absolute value of the number.
abs(-3.1) //returns 3.1
Parameters:
Throws:
Returns the absolute value of the number.
abs(-42) //returns 42
Parameters:
Throws:
Returns the greatest number from the listed decimals.
max(1.0, -22.4, 188, 0, 2E+5) //returns 200000
Parameters:
Throws:
Returns the greatest number from the listed integers.
max(1, -22, 188, 0) //returns 188
Parameters:
Throws:
Returns the smallest number from the listed decimals.
min(1.1, 2, -3.55) //returns -3.55
Parameters:
Throws:
Returns the smallest number from the listed integers.
min(1, 2, -3) //returns -3
Parameters:
Throws:
Returns a pseudorandom, uniformly distributed integer between 0 (inclusive) and the specified upperBound (exclusive).
random(10)
Parameters:
Throws:
Returns rounding of the specified number towards positive infinity. If the number is positive, rounds up; if the number is negative, rounds down. It does not decrease the number value.
roundCeiling(5.5);//returns 6 roundCeiling(-5.5)//returns -5
Parameters:
Throws:
Returns rounding of the specified number towards zero. It never increases the magnitude of the number.
roundDown(5.5); //returns 5 roundDown(1.6); //returns 1 roundDown(-1.1) //returns -1
Parameters:
Throws:
Returns rounding of the specified number towards negative infinity. If the number is positive, rounds down. If the number is negative, rounds up.
roundFloor(5.55);//returns 5 roundFloor(-5.55)//returns -6
Parameters:
Throws:
Returns rounding of the specified number towards the "closest neighbor"; if both neighbors are equidistant, rounds down.
roundHalfDown(5.4); //returns 5 roundHalfDown(5.5); //returns 5 roundHalfDown(-5.6); //returns -6 roundHalfDown(-5.4); //returns -5 roundHalfDown(-5.5); //returns -5
Parameters:
Throws:
Returns rounding of the specified number towards the "closest neighbor"; if both neighbors are equidistant, rounds towards the even neighbor.
roundHalfEven(4.5); //returns 4 roundHalfEven(5.5); //returns 6 roundHalfEven(-5.5); //returns -6 roundHalfEven(-6.5); //returns -6
Parameters:
Throws:
Returns rounding of the number towards the "closest neighbor"; if both neighbors are equidistant, it rounds up.
roundHalfUp(5.4); //returns 5 roundHalfUp(5.5); //returns 6 roundHalfUp(-5.6); //returns -6 roundHalfUp(-5.4); //returns -5 roundHalfUp(-5.5) //returns -6
Parameters:
Throws:
Returns rounding of the specified number away from zero; it never decreases the magnitude of the number.
roundUp(2.5) ;//returns 3 roundUp(-1.1) //returns -2
Parameters:
Throws:
Returns the scale, the number of decimal places, of the number.
scale(2.53)//returns 2
Parameters:
Throws:
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:
Throws:
Finds the specified model and starts a new instance of the specified model with the initialization properties, and returns the new model instance. If synchronous is set to true, the call waits until the new model instance becomes "started", that is, its first transaction is executed sucessfully. If this does not occur, the transaction is rolled back. If synchronous is false, the execution continues when the model instance becomes "created". Note that in the case of a roll-back, the data of the new model instance is deleted. It is recommended to set synchronous to true when calling from documents and to false when calling from processes.
createModelInstance( synchronous -> false, model -> getModel("registration","1.0"), properties-> ["Triggered by" -> thisModelInstance().id.toString()] )
Parameters:
Throws:
Finds the specified model and starts a new instance of the specified model with the initialization properties and the process entity, and returns the new model instance. If synchronous is set to true, the call waits until the new model instance becomes "started", that is, its first transaction is executed sucessfully. If this does not occur, the transaction is rolled back. If synchronous is false, the execution continues when the model instance becomes "created". Note that in the case of a roll-back, the data of the new model instance is deleted. It is recommended to set synchronous to true when calling from documents and to false when calling from processes. The process entity must be a shared record: the string representation of its primary key is added to the initialization properties.
Parameters:
Throws:
Returns the set of model instances satisfying all specified criteria. All String parameters, including the properties parameter, support the following wildcards: "*" matching none or several characters, and "?" matching exactly one character. Any other character in patterns matches itself. The value of the isRunning parameter must match exactly. null specified as the pattern value matches any value of the model instance field and is equivalent to the "*" pattern.
findModelInstances( model -> "registration*", version -> "2.?", isRunning -> true, properties -> null )
Parameters:
Returns a set of uploaded models satisfying the specified filtering criteria. All Strings parameters support the following wildcards: "*" matching none or several characters, and "?" matching exactly one character. Any other character in patterns matches itself. The value of the isRunning parameter must match exactly. null
specified as the pattern value matches any value of the model and is equivalent to the "*" pattern. When the latestOnly parameter is true
, only the most recently uploaded models with the given name and version are returned if multiple models with the same name and version are stored on the server. When set to false
, the returned set can contain several models with the same name and version.
findModels("registration", "1.0", false)
Parameters:
Returns the set of process instances of the current model instance that satisfy the filter criteria. The filter criteria is specified as a Boolean closure with one ProcessInstance parameter. 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.
findProcessInstances(filter -> {p:ProcessInstance -> p.process == "approval"})
Parameters:
Throws:
Returns the set of process instances generated by the model instance that satisfy the filter criteria. The filter criteria is specified as a Boolean closure with one ProcessInstance parameter. 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: The execution of this function can be slow if accessing a model instance which is not loaded in memory.
findProcessInstances( modelInstance -> getModelInstance(8015), filter -> {p:ProcessInstance -> p.process == "approval"} )
Parameters:
Throws:
Returns the model with the specified name. If multiple models with the same name and any version are uploaded on the server, the most recently uploaded model is returned. Unloaded models are ignored.
getModel("registration")
Parameters:
Throws:
Returns a model with the specified name and version. If multiple models with the same name and any version are uploaded on the server, the most recently uploaded model is returned.
getModel("registration", "2.3")
Parameters:
Throws:
Returns the model instance with the id.
getModelInstance(8013)
Parameters:
Throws:
Returns the map of initialization properties of the specified model instance.
getModelInstanceProperties(getModelInstance(8014))
Parameters:
Throws:
Returns the process entity of the specified type of the model instance. Process entity information, a string representation of its primary key, is stored in the model instance properties. The expected type must be specified and must be the shared record type which was used to create the model instance. If the types do not match, the behavior is unspecified. See the createModelInstance(Boolean synchronous, Model model, Record processEntity, Map<String,String> properties).
getProcessEntity(RegistrationData)
Parameters:
Throws:
Invokes (wakes up) the model instance. The call is used, for example, when the data of the model instance were changed by an external service or by a direct change in the database. If synchronous, the notification call waits until the invocation of the model instance finishes.
Parameters:
Throws:
Sends the signal object to the specified recipients. If synchronous is set to true, the execution waits until the signal is received and processed by its recipients. If synchronous is set to false, the execution continues immediately.
sendSignal(true, {getModelInstance(8014)}, "Dispatch cancel")
Parameters:
Throws:
Terminates a running model instance which becomes finished.
//example task parameters: modelInstance -> getModelInstance(25009)
Parameters:
Throws:
null
when executed from a document. null
when executed from document. <pre>thisModelInstanceProperties() //returns ["InitiatorId"->"admin", "my key"->"my value"] Returns a value of the initialization property with the given name of the model instance that executed the function. Returns null
if no property with the given name exists or if executed from a document.
thisModelInstanceProperty("InitiatorId")
Parameters:
Throws:
null
when the function is executed in the global context of a module or from a document. Throws an escalation signal with the specified code and payload. The escalation signal can be processed This function can be called only from an expression enclosed in a process that can handle the escalation. Otherwise, the calling of this function has no effect.
throwEscalation("Desk head", thisModelInstance())
Parameters:
Throws:
Multiplies each field of the duration by the specified number and rounds the value down, and returns the resulting duration.
(new Duration(minutes -> 2, seconds -> 1))*1.55 //returns core::Duration {hours=0, seconds=1, months=0, weeks=0, minutes=3, days=0, millis=0, years=0}
Parameters:
Multiplies each field of the duration by the specified number and rounds the value down, and returns the resulting duration.
1.7 * (new Duration(minutes -> 2, seconds -> 1)) =//returns core::Duration {hours=0, seconds=1, months=0, weeks=0, minutes=3, days=0, millis=0, years=0}
Parameters:
Unary minus operator which returns the duration.
+seconds(-2) //returns core::Duration {hours=0, seconds=-2, months=0, weeks=0, minutes=0, days=0, millis=0, years=0}
Parameters:
Adds the duration to the input date and returns the resulting date.
d'2018-06-07 00:00:00.000' + minutes(42) //returns d'2018-06-07 00:42:00.000
Parameters:
Adds a duration to a given local date.
Parameters:
Adds the date to the duration and returns the resulting date.
minutes(42)+d'2018-06-07 00:00:00.000' // returns d'2018-06-07 00:42:00.000'
Parameters:
Adds the values of the corresponding fields of duration1 and duration2, and returns the resulting duration.
seconds(100)+minutes(3) //returns core::Duration {hours=0, seconds=100, months=0, weeks=0, minutes=3, days=0, millis=0, years=0}
Parameters:
Negates each field of the specified duration and returns the resulting duration.
-(seconds(10)+days(2)) //returns core::Duration {hours=0, seconds=-10, months=0, weeks=0, minutes=0, days=-2, millis=0, years=0}
Parameters:
Subtracts the duration from the date and returns the resulting date.
d'2018-06-07 00:00:42.000' - seconds(42) //returns d'2018-06-07 00:00:00.000'
Parameters:
Subtracts a duration from a given local date.
Parameters:
Subtracts date2 from date1 and returns the resulting duration. The duration abides by the maximum allowed values for individual fields; that is, 60 seconds are resolved as 1 minute. If date2 > date1, the resulting duration is negative, i.e., all its fields are negative.
d'2018-06-07 00:00:63.000' - d'2010-06-07 00:00:01.000' //result core::Duration {hours=0, seconds=2, months=0, weeks=0, minutes=1, days=0, millis=0, years=8}
Parameters:
Returns a duration obtained by subtracting two dates.
Parameters:
Subtracts each field of duration2 from the corresponding field of duration1 and returns thhe resutling duration.
(seconds(10)+minutes(1))-(minutes(2)+seconds(84)) //returns core::Duration {hours=0, seconds=-74, months=0, weeks=0, minutes=-1, days=0, millis=0, years=0}
Parameters:
Creates a date object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", which is January 1, 1970, 00:00:00 GMT.
date(42) //returns d'1970-01-01 00:00:00.042'
Parameters:
Throws:
Creates a date from the input 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 the year, MM
stands for the month (01-12), dd
stands for the day in the month (01-31), DDD
stands for the day in the year (001-365), ww
stands for the week number and must be prefixed by the letter ‘W’ (W01-W53), and e
stands for the day of the week (1-7). The following formats of time are allowed: HH, HH:mm, and HH:mm:ss; where HH
stands for hour (00-23), mm
stands for minutes (00-59), and ss
stands for seconds (00-59). The following formats of time zones are allowed: \<time\>Z
where ‘Z’ stands for UTC, \<time\>±HH
, \<time\>±HH:mm
, and \<time\>±HH:mm:ss
. Decimal fractions, separated either by comma or by dot, may also be added to hours, minutes or seconds.
date("2100-12-18"); //returns d'2100-12-18 00:00:00.000' date("2100T13:10"); //returns d'2100-01-01 13:10:00.000' date("2100T13:10Z"); //returns d'2100-01-01 13:10:00.000'; date("2100T13:10+02") //returns d'2100-01-01 11:10:00.000'; date("2100T13:10.555+02") //returns d'2100-01-01 11:10:33.300'
Parameters:
Throws:
Creates a date from the input string based on the format defined by the pattern parameter. The pattern defines the format as specified in the java.text.SimpleDateFormat Java class.
date("2100.07.04 AD at 12:08:56 PDT","yyyy.MM.dd G 'at' HH:mm:ss z"); //returns d'2100-07-04 19:08:56.000' date("12:08 PM","h:mm a") //returns d'1970-01-01 12:08:00.000'
Parameters:
Throws:
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.
date("2100.07.04 AD at 12:08:56 PDT","yyyy.MM.dd G 'at' HH:mm:ss z", "en_US"); //returns d'2100-07-04 19:08:56.000'
Parameters:
Throws:
Creates a date from the values given by the parameters. The date is the 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: 0 refers to the item preceeding 1; for months, 1 designates January; hence 0 is the preceeding December.
date(year -> 1991, month -> 0, dayOfMonth -> 0 ); //returns d'1990-11-30 00:00:00.000' date(year -> 1991, month -> 155, dayOfMonth -> 42) //returns d'2003-12-12 00:00:00.000'
Parameters:
Throws:
Creates a date from the values given by the parameters. The 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, for example, 0 refers to the item preceeding 1; for months, 1 designates January; hence 0 is the preceeding December.
date(year -> 2030, month -> -2, dayOfMonth -> -13, hour -> 0, minute -> 0, second -> 0 , millis -> 42); //returns d'2029-09-16 23:00:00.042' date(year -> 2030, month -> 12, dayOfMonth -> 13, hour -> 0, minute -> 0, second -> 0 , millis -> 42); //returns d'2030-12-12 23:00:00.042' date(year -> 2030, month -> 13, dayOfMonth -> 13, hour -> 0, minute -> 0, second -> 0 , millis -> 33333) //returns d'2031-01-13 00:00:33.333'
Parameters:
Throws:
Returns a duration with the specified number of days.
days(42) //returns core::Duration {hours=0, seconds=0, months=0, weeks=0, minutes=0, days=42, millis=0, years=0}
Parameters:
Throws:
Returns a string created by formatting the date to the specified pattern. The pattern uses the syntax defined in the java.time.format.DateTimeFormatter class.
Parameters:
Throws:
Formats the date as a String in 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 by org.joda.time.format.DateTimeFormat.
formatDate(d'2030-12-12 23:00:00.042', "EEE MMM dd HH:mm:ss 'time zone offset: 'Z yyyy", "GMT"); //returns "Thu Dec 12 23:00:00 time zone offset: +0000 2030" formatDate(d'330-12-12 15:10:00.042', "EEE MMM dd G h:mm a Z", null) //retuns "Sat Dec 13 AD 3:19 PM +0009"
Parameters:
Throws:
Formats the date as a String in 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 by org.joda.time.format.DateTimeFormat. Additionaly, you can set the locale code in the locale parameter. If undefined or invalid, the default locale is used.
formatDate(d'2020-12-12 15:10:00.042', "EEE MMM dd G h:mm a Z", null, "fr_FR") //returns "sam. déc. 12 ap. J.-C. 4:10 PM +0100"
Parameters:
Throws:
Returns the day of the month of the input date.
getDayOfMonth(d'2012-30-12 09:48:00.042') //returns 12
Parameters:
Throws:
Returns the day of the month of the specified local date.
Parameters:
Throws:
Returns the day of the week of the input date as an Integer where 1 is Monday and 7 is Sunday.
getDayOfMonth(d'2012-30-12 09:48:00.042') //returns 12
Parameters:
Throws:
Returns the day of the week of the specified local date.
Parameters:
Throws:
Returns the day of the year of the input date.
getDayOfYear(d'2020-1-1 09:48:00.042'); //returns 1 getDayOfYear(d'2013-12-31 09:48:00.042') //returns 365
Parameters:
Throws:
Returns the day of the year of the specified local date.
Parameters:
Throws:
Returns the epoch day of the specified local date.
Parameters:
Throws:
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by the input date.
getEpochMillis(d'2013-12-31 09:48:00.042') //returns 1388483280042
Parameters:
Throws:
Returns the hour of the day of the input date.
getHour(d'2013-12-31 09:06:00.042') //returns 10
Parameters:
Throws:
Returns the millisecond of the second of the input date.
getMillis(d'2013-12-31 09:48:00.042') //returns 42
Parameters:
Throws:
Returns the minute of the hour of the input date.
getMinute(d'2029-09-16 23:02:53.7000'); //returns 3 getMinute(d'2029-09-16 23:02:52.7000'); //returns 2 getMinute(d'2029-09-16 23:02:544.7000'); //returns 11
Parameters:
Throws:
Returns the month of the year of the specified date. <pre>getMonth(d'2029-09-16 23:00:56.7000') //returns 9<pre>
Parameters:
Throws:
Returns the month of the year of the specified local date.
Parameters:
Throws:
Returns the second of the current minute of the input date.
getSecond(d'2029-09-16 23:00:56.700') //returns 56
Parameters:
Throws:
Returns the week of the current year of the input date.
getWeek(date("2025-03-14")) //returns 11
Parameters:
Throws:
Returns the year of the input date.
getYear(date(0)) //returns 1970
Parameters:
Throws:
Returns the year of the specified local date.
Parameters:
Throws:
Returns a duration with the specified number of hours.
hours(25) //returns core::Duration {hours=25, seconds=0, months=0, weeks=0, minutes=0, days=0, millis=0, years=0}
Parameters:
Throws:
Returns the number of days between the date. If date1 > date2, the resulting number is negative.
intervalInDays(date("2030-3-2"), date("2032-3-1")) //returns 730
Parameters:
Throws:
Returns the number of hours between the dates. If date1 > date2, the resulting number is negative.
intervalInHours(date("2030-3-2"), date("2032-3-1")) //returns 17520
Parameters:
Throws:
Returns the number of milliseconds between the dates. If date1 > date2, the resulting number is negative.
intervalInMillis(date("2030-3-2"), date("2030-3-3")) //returns 86400000
Parameters:
Throws:
Returns the number of minutes between the dates. If date1 > date2, the resulting number is negative.
intervalInMinutes(date("2030-3-2"), date("2032-3-1")) //returns 1051200
Parameters:
Throws:
Returns the number of months between the dates. If date1 > date2, the resulting number is negative.
intervalInMonths(date("2030-3-2"), date("2032-3-1")) //returns 23
Parameters:
Throws:
Returns the number of seconds between the dates. If date1 > date2, the resulting number is negative.
intervalInSeconds(date("2030-3-2"), date("2032-3-1")) //returns 63072000
Parameters:
Throws:
Returns the number of weeks between the dates. If date1 > date2, the resulting number is negative.
intervalInWeeks(date("2030-3-2"), date("2032-3-2")) //returns 104
Parameters:
Throws:
Returns the number of years between the dates. If date1 > date2, the resulting number is negative.
intervalInYears(date("2030-3-2"), date("2032-3-1")) //returns 1
Parameters:
Throws:
Creates a local date from the specified epochDay. The epoch day is a simple incrementing count of days where day 0 is 1970-01-01. Negative numbers represent earlier days.
Parameters:
Throws:
Creates a local date from the specified string. The format of the input string is yyyy-MM-dd (ISO 8601).
Parameters:
Throws:
Creates a local date from the values given by the following parameters: year, month (month of year), and dayOfMonth. year must be between -999,999,999 and +999,999,999, month must be between 1 and 12, day must be between 1 and 31 (depends on the month).
Parameters:
Throws:
Returns the latest date from the input dates.
max(date("2100-12-18"), now(), date("1990-12-18")) //returns d'2100-12-17 23:00:00.000'
Parameters:
Throws:
Returns the maximal date from a list of local dates.
Parameters:
Throws:
Returns a duration with the specified number of milliseconds.
millis(120) //returns core::Duration {hours=0, seconds=0, months=0, weeks=0, minutes=0, days=0, millis=120, years=0}
Parameters:
Throws:
Returns the soonest date from the input dates.
min(date("2100-12-18"), now(), date("1990-12-18")) //returns d'1990-12-17 23:00:00.000'
Parameters:
Throws:
Returns the minimal date from a list of local dates.
Parameters:
Throws:
Returns a duration with the specified number of minutes.
minutes(64) //returns core::Duration {hours=0, seconds=0, months=0, weeks=0, minutes=64, days=0, millis=0, years=0}
Parameters:
Throws:
Returns a duration with the specified number of months.
months(15) //returns core::Duration {hours=0, seconds=0, months=15, weeks=0, minutes=0, days=0, millis=0, years=0}
Parameters:
Throws:
Returns the current date and time.
now() //returns d'2018-06-08 09:36:14.015'
Returns a duration with the specified number of seconds.
seconds(64) //returns core::Duration {hours=0, seconds=64, months=0, weeks=0, minutes=0, days=0, millis=0, years=0}
Parameters:
Throws:
Changes the fields of the input date according to the values of the Integer parameters and returns the resulting date. The value must fall into valid ranges. The dayOfMonth must be in the correct range, that is from 1 to the last day of the given month in the year.
setDate(date("2030-1-1"), 2040, 2, 28) //results d'2040-02-28 00:00:00.000'
Parameters:
Throws:
Changes the day field to point to the day of month defined by the dayOfMonth parameter value and returns the resulting date. The dayOfMonth must be in the correct range, that is from 1 to the last day of the given month in the year.
setDayOfMonth(date -> date(0), dayOfMonth -> 13) //returns d'1970-01-13 00:00:00.000' //date(0) resolves to d'1970-01-01 00:00:00.000'
Parameters:
Throws:
Changes the day and month fields to point to the closes day of week defined by the dayOfWeek parameter value and returns the resulting date.
setDayOfWeek(date -> date(0), dayOfWeek -> 2); //results in the closes Tuesday: d'1969-12-30 00:00:00.000'
Parameters:
Throws:
Changes the day and month fields of the input date to correspond to the dayOfYear parameter value and returns the resulting date.
setDayOfYear(date -> date(0), dayOfYear -> 33) //returns d'1970-02-02 00:00:00.000'
Parameters:
Throws:
Changes the hour field of the input date to the hour parameter value and returns the resulting date.
setHour(date -> date(0), hour -> 10) = d'1970-01-01 10:00:00.000'
Parameters:
Throws:
Changes the milliseconds field of the input date to the millis parameter value and returns the resulting date.
setMillis(date-> d'2100-11-01 10:10:10.111', millis -> 42) //returns d'2100-11-01 10:10:10.042'
Parameters:
Throws:
Changes the minute field of the input date to the minute parameter value and returns the resulting date.
setMinute(date-> d'2100-11-01 12:12:13.000', minute -> 42) //returns d'2100-11-01 12:42:13.000'
Parameters:
Throws:
Changes the month field of the input date to the month parameter value and returns the resulting date.
setMonth(date-> d'2100-11-01 12:10:13.000', month -> 2) //returns d'2100-02-01 12:10:13.000'
Parameters:
Throws:
Changes the second field of the input date to the second parameter value and returns the resulting date.
setSecond(date-> d'2100-01-01 12:10:13.000', second -> 42) //returns d'2100-01-01 12:10:42.000'
Parameters:
Throws:
Changes the time fields of the input date to the values of the parameters and returns the resulting date. Parameters defining the time must not exceed their ranges: 0 =< hour < 23; 0 =< minute < 0 or minute > 59 or second < 0 or second > 59 or millis < 0 or millis > 999)
setTime(date -> d'2100-01-01 12:10:00.000', hour -> 20, minute -> 33, second -> 12, millis -> 200) //returns d'2100-01-01 19:33:12.200'
Parameters:
Throws:
Changes the week field of the year of the input date to the week parameter value and returns the resulting date.
setWeek(date("2035-1-15"), 12) //returns d'2035-03-19 00:00:00.000'
Parameters:
Throws:
Changes the year field of the input date to the year parameter value and returns the resulting date.
setYear(date->now(), year-> 2100) //returns d'2100-06-08 12:54:46.141'
Parameters:
Throws:
Returns the date of this local date at start of day. The system default time-zone is used for the conversion.
Parameters:
Throws:
Returns the local date of this date. The system default time-zone is used for the conversion.
Parameters:
Throws:
Returns the current date with the time set to midnight in the time zone of the LSPS Server (by default UTC).
today() //returns d'2018-06-07 22:00:00.000'
Returns a duration with the specified number of weeks.
weeks(12) //returns core::Duration {hours=0, seconds=0, months=0, weeks=12, minutes=0, days=0, millis=0, years=0}
Parameters:
Throws:
Returns a duration with the specified number of years.
years(35) //returns core::Duration {hours=0, seconds=0, months=0, weeks=0, minutes=0, days=0, millis=0, years=35}
Parameters:
Throws:
Returns the starting status of the given model instance. If the modelInstance parameter is is null, the current model instance is used.
Parameters:
Returns map of starting statuses for given model instances. If the modelInstances parameter is is null, statuses for all currently monitored instances are returned.
Parameters:
Sets the number of model instances to be restarted. It can be set in advance of the actual model instance restarting.
Parameters:
Adds the model instance to a list of started model instances. If the modelInstance parameter is is null, the current model instance is used.
Parameters:
Creates and returns a new instance of the specified record type. If the properties are specified, the instance is initialized with the specified values of properties.
createInstance(RegistrationData, [ "approved" -> false ])
Parameters:
Throws:
Deletes the specified records and their related data links navigable from the records. Works for shared and for non-shared records. Values of the deleted records in all slots (variables, function or task call parameters, etc.) referring to the records become null
.
deleteRecords(persona1, persona2, order1)
Parameters:
Throws:
Deletes the specified records and their related data links navigable from the records. Works for shared and for non-shared records. Values of the deleted records in all slots (variables, function or task call parameters, etc.) referring to the records become null
. If the record is referred to from a collection or a key in a map, it is removed.
deleteRecords([persona1, persona2, order1])
Parameters:
Throws:
Executes flush on all relevant sessions and refreshes (re-reads) from the database on the records. It is useful in the cases when the records might have been modified by custom objects or third-party systems.
Parameters:
Returns all properties of the given record type.
Parameters:
Throws:
Returns the property of the given record type with the specified name, or null if the type has no such property.
Parameters:
Throws:
Returns the property metadata.
Parameters:
Throws:
Returns the property name as a string.
Parameters:
Throws:
Returns the property names.
Parameters:
Throws:
Returns the property path record type. It is the record type where the given property path starts.
Parameters:
Throws:
Returns the property path type (the type of the last property).
Parameters:
Throws:
Returns the value of the given property path of the given record object.
Parameters:
Throws:
Returns the record type where the specified property is declared.
getPropertyRecordType(SubRecord.fieldInSuperRecord) //returns SuperRecord
Parameters:
Throws:
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:
Throws:
Returns the property type.
getPropertyType(Person.name) //returns String
Parameters:
Throws:
Returns the value of the given property of the given record object.
Parameters:
Throws:
Returns true if the given property is autogenerated (usually a primary key from a sequence).
Throws: -"NullParameterError" if mandatory parameter is null.
Parameters:
Returns true if the given property is a primary key of a shared record (or a part of composite primary key).
Throws: -"NullParameterError" if mandatory parameter is null.
Parameters:
Returns true if the given property path is read only.
Throws: -"NullParameterError" if mandatory parameter is null.
Parameters:
Returns true if the given property is a version field.
Throws: -"NullParameterError" if mandatory parameter is null.
Parameters:
Sets the value of the given property path of the given record object.
Parameters:
Throws:
Sets the value of the given property of the given record object. Returns null.
Parameters:
Throws:
If the type of the input object is compatible with the specified objectType, the function casts the object to the objectType.
cast(-1, Decimal); //returns -1 (-1.1).cast(Integer) //returns IncompatibleTypeError
Parameters:
Throws:
Creates and returns a shallow copy of a collection or a user-defined record (related records remain the same), or returns the object itself if it is of another type.
clone([[1,2,3],3, "a", date(0)]); //returns [[1,2,3],3,"a",d'1970-01-01 00:00:00.000'] def Applicant john := new Applicant(name -> "John", surname -> "Doe", tutor -> new Tutor(name -> "Jane")); clone(john); //returns a new applicant with the same tutor: // Applicant(id->7, name->"John", surname->"Doe", tutor->Tutor); clone(Applicant) //retuns myModule::Applicant
Parameters:
Throws an error with the specified code.
error("code red") //returns null, error code: code red
Parameters:
Throws:
Throws an error with the code and a message.
error("code red", "This is really serious.") //returns This is really serious., error code: code red
Parameters:
Throws:
Returns the type of the input object. Note that, unlike typeOf(), getType() is an extension method.
now.getType(); //returns { : Date} now().getType() //returns Date
Parameters:
Returns true if the input object is assignment-compatible with the objectType.
isInstance(1, Decimal); //returns true (1.1).isInstance(Integer) //returns false isInstance(null, String); //returns true
Parameters:
Throws:
Returns true if subtype is a subtype of supertype.
isSubtype(Decimal, Integer); //returns false isSubtype(Integer, Decimal); //returns true isSubtype(Null, Object) //returns true
Parameters:
Throws:
Returns true if subtype is a subtype of supertype. Note that, unlike isSubtype(), isSubtypeOf() is an extension method.
String.isSubtypeOf(Object) //returns true
Parameters:
Throws:
Returns the type of the input object.
typeOf(now()); //returns Date typeOf(1.0); //returns Integer typeOf({ e-> String} ); //returns {Object : Type<String>} typeOf(now) //returns { : Date}
Parameters:
Converts the object to JSON. The object can be an instance of a Record, List, Set or Map with their data structure consisting of the types String, Boolean, Binary, Decimal, Integer, Date, Set, List, Map, Record, or Enumeration.
convertToJson( //record with a related record: new Applicant( name -> "John", surname -> "Doe", tutor -> new Tutor( name -> "Jane", hireDate -> date("2018-1-1") ) ) ) /*returns { "id" : 2, "name" : "John", "surname" : "Doe", "tutor" : { "id" : 1, "name" : "Jane", "hireDate" : 1514761200000 } }*/
Parameters:
Throws:
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. The parameter useExternalRef defines how shared records are converted to JSON. In case the useExternalRef is true the shared record is stored as type and primary key string. In other case all fields of the shared record are stored.
Parameters:
Throws:
Parses JSON string to a map. The json parameter represents the JSON string to parse.
jsonToMap(" { ""name"" : ""John"", ""surname"" : ""Doe"", ""tutor"" : { ""id"" : 1, ""name"" : ""Jane"", ""hireDate"" : 2012-04-23T18:25:43.511Z } }")
Parameters:
Throws:
Parses JSON string to a map. he 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. If there exist a shared record with the same primary key as specified in JSON the record is used by import. Here, it does not matter whether the shared record is specified by external reference or by value in JSON. If the record specified by reference in JSON does not exist in database it is ignored and null is used as its imported value or empty collection for collection of records. No exception is thrown in this case. If the parameter doInsert is true and the database does not contain a shared record specified by value in JSON or the JSON does not specify primary key, the record from JSON is inserted to database. For auto-generated primary keys, a new key value is created, for not auto-generated primary keys, the value of the key from JSON is used. If doInsert is false, a record from JSON which does not exist in the DB is ignored and null is used for its value in the imported data instead; for collections of non-existing records, empty collections are created by import. If the parameter doUpdate is true and the database contains a shared record with the same primary key as a record specified by value in JSON, values of this record fields are updated from JSON. If false, values of fields do not change.
jsonToMap(" { ""name"" : ""John"", ""surname"" : ""Doe"", ""tutor"" : { ""id"" : 1, ""name"" : ""Jane"", ""hireDate"" : 2012-04-23T18:25:43.511Z } }")
Parameters:
Throws:
Converts the map to JSON. The string keys of the map represent the keys of the 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 the type Map<String, Object> or record. The function returns a string which represents the data in JSON format.
mapToJson( [ "name" -> "John", "address" -> ["City"->"Amsterdam"] ] )
Parameters:
Throws:
Deprecated: use parseJson(String json, Type resultType, Boolean doInsert, Boolean doUpdate).
Parses the 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 type must be a Record, List, Set or Map type, otherwise an exception is thrown. Also 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.
Note that when parsing JSON to shared Records if json defines the primary-key value: if the primary key is autogeneratedit, the primary key in the json is ignored: A new shared record is created. If the primary key is not autogenerated and a record with the defined primary key already exists, the call fails with a runtime exception.
parseJson(" { ""id"" : 1, ""approved"" : false, ""firstName"" : ""Jane"", ""lastName"" : ""Doe"" } ", RegistrationData)
Parameters:
Throws:
Parses JSON string to internal data structures. The json parameter is the JSON string and the resultType parameter is the type to switch it should be parsed. The referred type must be a Record, List, Set or Map type. The data structure of the resultType can consist only of the types String, Boolean, Binary, Decimal, Integer, Date, Set, List, Map, Record, or Enumeration.
If a shared record with the primary key equal to the primary key specified in JSON, the record is used by import. Here, it does not matter whether the shared record is specified by external reference or by value in JSON. If the record specified by reference in JSON does not exist in the database, it is ignored and null is used as its imported value or empty collection for collection of records. No exception is thrown in this case. If the parameter doInsert is true and the database does not contain a shared record specified by value in JSON or the JSON does not specify a primary key, the record from JSON is inserted into the database. For auto-generated primary keys, a new key value is created, for non-auto-generated primary keys, the value of the key from JSON is used. If doInsert is false, a record from JSON which does not exist in the DB is ignored and null is used for its value in the imported data instead; for collections of non-existing records, empty collections are created by import. If the parameter doUpdate is true and the database contains a shared record with the same primary key as a record specified by value in JSON, values of this record fields are updated from JSON. If false, such records remain unchanged.
parseJson(" { ""id"" : 1, ""approved"" : false, ""firstName"" : ""Jane"", ""lastName"" : ""Doe"" } ", RegistrationData, true, true)
Parameters:
Throws:
Synchronous http call.
callHttp( sslConfig -> null, endpointAddress-> "http://localhost:9200/myindex/section/_search", httpMethod -> "GET", requestContentType -> "application/json", input -> "{""query"":{""match"":{""title"":""Controlling Flow""}}}", login -> null, password -> null, readTimeout -> null, requestHeaders -> null, responseHeaders -> &responseHeaders, resposeCode -> &responseCode, logMessages -> true )
Parameters:
Synchronous call of a webservice. It provides the same functionality as the generated webservice task but can be used in expressions. It uses the same data objects that are generated for the webservice task and the same metadata.
Parameters:
Returns the audited record in the revision.
findByRevision(getBookByTitle("Death in Venice"), 7)
Parameters:
Throws:
Returns the current custom revision entity. If the persist parameter is set to true
, a new revision entity is created even if no audited record is changed in the transaction.
getCurrentRevision(auditing::MyRevisionEntity, true)
Parameters:
Throws:
Returns the list of revision identifiers in which the audited 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:
Throws:
Returns the count of all shared records of the given type.
Parameters:
Throws:
Returns all shared records of the given type.
findAll(Model)
Parameters:
Throws:
Returns a shared record of the specified type and identified by the given primary key. Composed primary key 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 and values represent the value of the properties. If the key is of the type string then it contains the simple property name. If there is no record with the given id, the function returns null.
findById(ModelInstance, 8000); findById(RecWithComplexPK, ["id1" -> 1, "id2" -> 2])
Parameters:
Throws:
Returns a shared record of the specified type and identified by the given primary key. Composed primary key 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 and values represent the value of the properties. If the key is of the type string then it contains the simple property name. If there is no record with the given id, the function returns null.
ModelInstance.findById(8000); RecWithComplexPK.findById(["id1" -> 1, "id2" -> 2])
Parameters:
Throws:
Logs a message to the console at the debug logging level and returns the logged string or null if no message was logged. If logging is not enabled for the debug level on the server, the message closure is not evaluated.
debugLog({ -> "debug message" })
Parameters:
Throws:
Logs a message to the console at the debug logging level and returns the logged string or null if no message was logged. If logging is not enabled for the debug level on the server, the message closure is not evaluated.
debugLog({ -> "debug message" }, INFO_LEVEL )
Parameters:
Throws:
Execute the SQL in the binary. Empty lines and lines starting with --
or ;
are ignored.
def File file := getResource(module -> "localization", path -> "sqlinsert.txt"); //the file contains SQL statements separated with semicolons executeSqlFile(file.content);
Parameters:
Returns an application data object with the key "locale" string or "user": locale returns the locale and user the login name of the logged-in user in the LSPS Process Application.
getApplicationData("locale")
Parameters:
Throws:
MYSQL
, ORACLE
, etc. Logs the specified message to the application log at the specified log level. If the level is not specified, the level value is set to the "Info" level (value 200).
Parameters:
Throws:
Splits a fully qualified element name to the names of its components as separated by the namespace separator (::).
splitPathname("module::'role 1'") //returns ["module", "role 1"]
Parameters:
Throws:
Returns a universally unique identifier (UUID).
uuid() //returns "3021c2bf-b146-492b-9849-9ebd4abd56e8"