Expression Editor
Last updated
Last updated
Expression Editor is a tool that enables the creation and editing of expressions at runtime, which can then be used to perform calculations and manipulate data. The Expression Editor offers smart code completion, syntax highlighting, and error-reporting functionalities.
The Expression Editor becomes available whenever you need to define a parameter as an expression within a node.
When you're working with the Assign node, you can set an expression for the assignment, or when dealing with the If or Switch node, you can specify a condition and open the Expression Editor by clicking on the input field.
After the click, the Expression Editor pop-up window will open.
In the left panel, you can find all the data that can be used in an expression for the selected node — inputs, output, nodes variables, global and local variables. Each variable has a name, a type, and the indicator of the node that generated this variable.
You can filter the variables to find the necessary data. Click on the search field where you can enter the name of the element you need to find.
Click on the required data item or variable to add it to the expression.
There is a functions tree at the bottom of the Expression editor window. Different types of functions are available. There are casting functions to convert primitive types, mathematical functions, functions on maps, array, date, and strings.
Click on the required function to add it to the expression.
Click on a function name to see its description on the right, or double-click to add the selected function to the expression.
Auto-completion is also available in the process of writing an expression. The possible options for auto-completion will be displayed. Selection of one of them can be done using the arrows and the enter key or by clicking on the expression.
Description:
Additional:
toString
Converts any value to string
Arguments:
Any — any value.
Result: String — converted value.
clone
Clones any object
Arguments:
Any — any value.
Result: String — cloned object.
Description:
Additional:
uuid
Static factory to retrieve a type 4 (pseudo randomly generated) UUID. The UUID is generated using a cryptographically strong pseudo random number generator.
Result: String — A randomly generated 36 characters long UUID.
Description:
Additional:
asBoolean New 5.0.5 release
Converts the JSON object to a boolean value.
Arguments:
JsonObject - the json object
Result: Boolean - the input JSON object converted to a boolean value.
asFloat New 5.0.5 release
Converts the JSON object to a float value.
Arguments:
JsonObject - the json object
Result: Float - the input JSON object converted to a float value.
asInteger New 5.0.5 release
Converts the JSON object to an integer value.
Arguments:
JsonObject - the json object
Result: Integer - the input JSON object converted to an integer value.
asText New 5.0.5 release
Converts the JSON object to a string value.
Arguments:
JsonObject - the json object
Result: String - the input JSON object converted to a string value.
at New 5.0.5 release
Gets a JSON object at the specified path.
Arguments:
JsonObject - the json object
String - the path
Result: JsonObject - the JSON object at the specified path.
canConvertToInteger New 5.0.5 release
Checks if the JSON object can be converted to an integer value.
Arguments:
JsonObject - the json object
Result: Boolean - true if the JSON object can be converted to an integer value.
isNumber New 5.0.5 release
Checks if the JSON object is a number.
Arguments:
JsonObject - the json object
Result: Boolean - true if the JSON object is a number.
elements New 5.0.5 release
Method for accessing all value nodes of this JSON object, if this node is a JSON Array or Object node.
Arguments:
JsonObject - the json object
Result: Array<JsonObject> - an array of the elements of the JSON object.
fields New 5.0.5 release
Method for accessing all field names (keys) and field values.
Arguments:
JsonObject - the json object
Result: Map<JsonObject> - a map of the field names and field values.
findParent New 5.0.5 release
Method for finding a JSON Object that contains specified field, within this node or its descendants.
Arguments:
JsonObject - the json object
String - the field name
Result: JsonObject - the parent of the JSON object.
findParents New 5.0.5 release
Method for finding all JSON Objects that contain specified field, within this node or its descendants.
Arguments:
JsonObject - the json object
String - the field name
Result: Array<JsonObject> - an array of the parents of the JSON object.
findValue New 5.0.5 release
Method for finding a JSON Object field with specified name in this node or its child nodes, and returning value it has.
Arguments:
JsonObject - the json object
String - the field name
Result: JsonObject - the value of the field.
findValues New 5.0.5 release
Method for finding JSON Object fields with specified name in this node or its child nodes, and returning values they have.
Arguments:
JsonObject - the json object
String - the field name
Result: Array<JsonObject> - an array of the values of the fields.
getByIndex New 5.0.5 release
Method for accessing value of the specified element of an JSON array.
Arguments:
JsonArray - the json array
Integer - the index
Result: JsonObject - the JSON object at the specified index.
get New 5.0.5 release
Method for accessing value of the specified field of an JSON object.
Arguments:
JsonObject - the json object
String - the field name
Result: JsonObject - the value of the field.
hasIndex New 5.0.5 release
Method that allows checking whether this object is JSON Array and contains a value for specified index If this is the case (including case of specified indexing having null as value), returns true; otherwise returns false.
Arguments:
JsonArray - the json array
Integer - the index
Result: Boolean - true if the JSON array contains an element with the specified index.
hasNotNullIndex New 5.0.5 release
Method that allows checking whether this object is JSON Array and contains a non-null value for specified index If this is the case, returns true; otherwise returns false.
Arguments:
JsonArray - the json array
Integer - the index
Result: Boolean - true if the JSON array contains a non-null element with the specified index.
has New 5.0.5 release
Method that allows checking whether this object is JSON Object and contains specified field If this is the case (including case of specified field having null as value), returns true; otherwise returns false.
Arguments:
JsonObject — the json object
String — the field name
Result:
boolean — true if the JSON object contains the specified field.
hasNotNull New 5.0.5 release
Method that allows checking whether this object is JSON Object and contains specified field If this is the case, returns true; otherwise returns false.
Arguments:
JsonObject - the json object
String - the field name
Result: Boolean - true if the JSON object contains the specified field.
getType New 5.0.5 release
Gets a type of the JSON object.
Arguments:
JsonObject - the json object
Result: String - the type of the JSON object.
isArray
Checks if the input object is an array.
Arguments: JSONObject — any JSON object.
Result: Boolean — true if the input object is an JSONArray.
isBinary New 5.0.5 release
Method that can be used to check if this object represents binary data (Base64 encoded).
Arguments:
JsonObject - the json object
Result: Boolean - true if the JSON object is a binary value.
isBoolean New 5.0.5 release
Method that can be used to check if this object was created from JSON boolean value (literals "true" and "false").
Arguments:
JsonObject - the json object
Result: Boolean - true if the JSON object is a boolean value.
isContainerNode New 5.0.5 release
Method that can be used to check if this object is a JSON Array or JSON Object.
Arguments:
JsonObject - the json object
Result: Boolean - true if the JSON object is a container node.
isFloat New 5.0.5 release
Method that can be used to check if this object was created from JSON floating-point number value (literals such as "2.25" or "-0.003").
Arguments:
JsonObject - the json object
Result: Boolean - true if the JSON object is a float value.
isInteger New 5.0.5 release
Method that can be used to check if this object was created from JSON integer number value (literals such as "2", "-3" or "0").
Arguments:
JsonObject - the json object
Result: Boolean - true if the JSON object is an integer value.
isIntegralNumber New 5.0.5 release
Method that can be used to check if this object was created from JSON number without any fractional digits (like "2", "-3" or "0")
Arguments:
JsonObject - the json object
Result: Boolean - true if the JSON object is an integral number.
isMissingNode New 5.0.5 release
Method that returns true for "virtual" objects which represent missing entries constructed by path accessor methods when there is no actual node matching given criteria.
Arguments:
JsonObject - the json object
Result: Boolean - true if the JSON object is a missing node.
isNull New 5.0.5 release
Method that can be used to check if this object was created from JSON literal null value.
Arguments:
JsonObject - the json object
Result: Boolean - true if the JSON object is a null value.
isObject New 5.0.5 release
Method that can be used to check if this object is JSON Object.
Arguments:
JsonObject - the json object
Result: Boolean - true if the JSON object is an object node.
isTextual New 5.0.5 release
Method that checks whether this object represents basic JSON String value.
Arguments:
JsonObject - the json object
Result: Boolean - true if the JSON object is a textual value.
isValueNode New 5.0.5 release
Method that returns true for all value nodes: ones that are not containers, and that do not represent "missing" nodes in the path.
Arguments:
JsonObject - the json object
Result: Boolean - true if the JSON object is a value node.
pathByIndex New 5.0.5 release
This method is similar to getByIndex, except that instead of returning null if no such element exists (due to index being out of range, or this node not being an array), a "missing node" (node that returns true for isMissingNode()) will be returned.
Arguments:
JsonArray - the json array
Integer - the index
Result: JsonObject - the JSON object at the specified index.
path New 5.0.5 release
This method is similar to get, except that instead of returning null if no such value exists (due to this node not being an object, or object not having value for the specified field), a "missing node" (node that returns true for isMissingNode()) will be returned.
Arguments:
JsonObject - the json object
String - the field name
Result: JsonObject - the value of the field.
toJsonObject New 5.0.5 release
Converts the input object to a JsonObject.
Arguments:
Any - any object
Result: JsonObject - the input object converted to a JsonObject.
diff New 5.0.5 release
Compares two JsonObjects and returns an array of operations that need to be applied to the first object to make it equal to the second one.
Arguments:
JsonObject - the first json object
JsonObject - the second json object
Result: Array - an array of patch operations.
merge New 5.0.5 release
Merges two JsonObjects and returns a new JsonObject that contain attribute from both objects.
Arguments:
JsonObject - the first json object
JsonObject - the second json object
Result: JsonObject - a new JsonObject.
patch New 5.0.5 release
Applies an array of patch operations to the input json object and returns a new JsonObject.
Arguments:
JsonObject - the json object
Array<JsonOperation> - an array of patch operations
Result: JsonObject - a new JsonObject.
hasAttribute New 5.0.5 release
Checks if the input object has the specified attribute.
Arguments:
JsonObject - any json object
String - attribute name
Result: Boolean - true if the input object has the specified attribute.
isAttributeNotNull New 5.0.5 release
Checks if the input object has the specified attribute and it is not null.
Arguments:
JsonObject - any json object
String - attribute name
Result: Boolean - true if the input object has the specified attribute and it is not null.
isAttributeNotNull New 5.0.5 release
Checks if the input object has the specified attribute and it is not null.
Arguments:
JsonObject - any json object
String - attribute name
Result: Boolean - true if the input object has the specified attribute and it is not null.
objectToArray
Converts the input object to an array.
Arguments: JSONObject— any JSON object.
Result: JSONArray — the input object converted to an array.
getAttributeNames
Gets a list of attribute names of the input object.
Arguments: JSONObject — any JSON object.
Result: Array<String> — list of attribute names.
getInteger
Gets an integer value of the JSONObject attribute.
Arguments: JSONObject — any JSON object. String — attribute name.
Result: Integer — attribute value.
getIntegerArray
Gets an array of integer values of the JSONObject attribute.
Arguments: JSONObject — any JSON object. String — attribute name.
Result: Array<Integer> — attribute value.
getFloat
Gets a float value of the JSONObject attribute.
Arguments: JSONObject — any JSON object. String — attribute name.
Result: Float — attribute value.
getFloatArray
Gets an array of float values of the JSONObject attribute.
Arguments: JSONObject — any JSON object. String — attribute name.
Result: Array<Float> — attribute value.
getBoolean
Gets a boolean value of the JSONObject attribute.
Arguments: JSONObject — any JSON object. String — attribute name.
Result: Boolean — attribute value.
getBooleanArray
Gets an array of boolean values of the JSONObject attribute.
Arguments: JSONObject — any JSON object. String — attribute name.
Result: Array<Boolean> — attribute value.
getString
Gets a string value of the JSONObject attribute.
Arguments: JSONObject — any JSON object. String — attribute name.
Result: String — attribute value.
getStringArray
Gets an array of string values of the JSONObject attribute.
Arguments: JSONObject — any JSON object. String — attribute name.
Result: Array<String> — attribute value.
getJsonObject
Gets a JSONObject value of the JSONObject attribute.
Arguments: JSONObject — any JSON object. String — attribute name.
Result: JSONObject — attribute value.
getJsonArray
Gets an array of JSONObject values of the JSONObject attribute.
Arguments: JSONObject — any JSON object. String — attribute name.
Result: JSONArray — attribute value.
getArraySize
Gets a size of the JSONArray.
Arguments: JSONArray — any JSON array.
Result: Integer — size.
getArrayItem
Gets an element of the JsonArray.
Arguments: JSONArray — any JSON array. Integer — index.
Result: JSONObject — element.
Description:
Additional:
encodeStringToBase64
Encodes a String into a newly—allocated Base64 encoded String.
Arguments: String — the string to encode.
Result: String — a newly—allocated base 64 string.
encodeFileToBase64
Encodes a File into a newly—allocated Base64 encoded String.
Arguments: File — the file to encode.
Result: String — a newly—allocated base 64 string.
decodeBase64ToFile
Decodes a Base64 string into a File.
Arguments: String - а base 64 string to decode.
Result: File - the file representeation of decocded base64 string.
hexStringToIntegerArray
Converts a hex string to an array of integers (each integer represents a byte).
Arguments:
String - hex string.
Result: Array<Integer> - array of integers.
integerArrayToHexString
Converts an array of integers (byte values) to a hex string.
Arguments:
Array<Integer> - array of integers.
Result: String - hex string.
asciiStringToHex
Converts an ASCII string to a hex string.
Arguments:
String - ASCII string
Integer - size of output hex string: can be set to 0 - output hex string will have size that is required for hex representation (double ASCII string length), can be set greater than ASCII string length - output hex string will have trailing zeros up to specified size
Result: String - hex string.
hexStringToAscii
Converts a hex string to an ASCII string.
Arguments: String — hex string.
Result: String — ASCII string.
Description:
Additional:
getMetaType
Gets a meta type File.
Arguments: File — any file.
Result: String — mime type.
getName
Gets a name of a File.
Arguments: File — any file.
Result: String — file name.
getSize
Gets a size in bytes of a File.
Arguments: File — any file.
Result: Integer — file size in bytes.
toByteArray
Returns a byte array as a sequence of bytes that represents the contents of the File.
Arguments: File — any file.
Result: Array <byte> — an array of bytes.
Description:
Additional:
encode
Encode the raw string. Generally, a good encoding algorithm applies a SHA-1 or greater hash combined with an 8-byte or greater randomly generated salt.
Arguments: CleanString — any string.
Result: String — encoded input string.
match
Verify the encoded string matches the submitted clean string after it is encoded. Returns true if the strings match, false if they do not. The encoded string itself is never decoded.
Arguments: CleanString — any string. EncodedString — string encoded by pdk.util.Crypto.encode function.
Result: Boolean — true if the clean password, after encoding, matches the encoded string.
Description:
Additional:
booleanToString
Converts boolean to string.
Arguments: Boolean — object for converting.
Result: String — converted value.
dateToString
Converts date to string by using format.
Arguments: Date — object for converting. String — the format of the date represented by the string.
Result: String — converted object.
dateToStringISO New 5.0.5. release
Converts date to string by using ISO format: 2023-10-20T08:24:45−07:00
Arguments: Date — object for converting.
Result: String— converted date.
integerToFloat
Converts integer to float number.
Arguments: Integer — object for converting.
Result: Float — converted value.
integerToString
Converts integer to string.
Arguments: Integer — object for converting.
Result: String — converted value.
integerToDate
Converts integer to the date object.
Arguments: Integer — assume that this argument represents date milliseconds.
Result: Date — converted object.
floatToString
Converts float to string.
Arguments: Float — the number to be converted.
Result: String — converted object.
stringToInteger
Parses the string argument as a signed decimal integer. The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign '-' to indicate a negative value or an ASCII plus sign '+' to indicate a positive value.
Arguments: String — the string to be converted.
Result: Integer — the value represented by the argument in decimal.
stringToFloat
Returns a Float object holding the float value represented by the argument string.
Arguments: String — the string to be converted.
Result: Float — object holding the value represented by the String argument.
stringToBoolean
Parses the string argument as a boolean. The boolean returned represents the value true if the string argument is not null and is equal, ignoring cases, to the string "true".
Arguments: String — object for converting.
Result: Boolean — converted value.
stringToDateISO New 5.0.5 release
Converts string to date by using ISO format: 2023-10-20T08:24:45−07:00
Arguments: String — object for converting.
Result: Date — converted date.
Description:
Additional:
size
Returns the number of key-value mappings in the map.
Arguments: Map<V> — any map.
Result: Integer — the number of key-value mappings in the map.
containsKey
Returns true if the map contains mapping for the specified key. More specifically, returns true if and only if this map contains a mapping for a key k such that (key==null ? k==null : key = k). (There can be at most one mapping of this type.).
Arguments: Map<V> — any map. K — key whose presence in this map is to be tested.
Result: Boolean — true if the map contains a mapping for the specified key.
get
Returns the value to which the specified key is mapped, or null if the map contains no mapping for the key.
Arguments: Map<V> — any map. K — the key whose associated value is to be returned.
Result: V — the value to which the specified key is mapped, or null if the map contains no mapping for the key.
keys
Returns a Set view of the keys contained in the map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration will be undefined.
Arguments: Map<V> — any map.
Result: Array<K> — an array view of the keys contained in the map.
values
Returns an array view of the values contained in the map.
Arguments: Map<V> — any map.
Result: Array<V> — an array view of the values contained in the map.
entryArray
Returns an Array view of the mappings contained in the map.
Arguments: Map<V> — any map.
Result: Array<Entry<V>> — an array view of the elements contained in the map.
isEmpty
Returns true if this map contains no key-value mappings.
Arguments: Map<V> — any map.
Result: Boolean
Description:
Additional:
absInt
Returns the absolute value of an integer value.
Arguments: Integer — the argument whose absolute value is to be determined.
Result: Integer — the absolute value of the argument.
absFloat
Returns the absolute value of a float value.
Arguments: Float — the argument whose absolute value is to be determined.
Result: Float — the absolute value of the argument.
acos
Returns the arc cosine of a value; the returned angle is in the range 0.0 through pi. Special case:
If the argument is NaN or its absolute value is greater than 1, then the result is NaN.
The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
Arguments: Float — the value whose arc cosine is to be returned.
Result: Float — the arc cosine of the argument.
asin
Returns the arc sine of a value; the returned angle is in the range -pi/2 through pi/2. Special cases:
If the argument is NaN or its absolute value is greater than 1, then the result is NaN.
If the argument is zero, then the result is a zero with the same sign as the argument.
Arguments: Float — the value whose arc sine is to be returned.
Result: Float — the arc sine of the argument.
atan
Returns the arc tangent of a value; the returned angle is in the range -pi/2 through pi/2. Special cases:
If the argument is NaN, then the result is NaN.
If the argument is zero, then the result is a zero with the same sign as the argument.
The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
Arguments: Float — the value whose arc tangent is to be returned.
Result: Float — the arc tangent of the argument.
cbrt
Returns the cube root of a float value. For positive finite x, cbrt(-x) == -cbrt(x); that is, the cube root of a negative value is the negative of the cube root of that value's magnitude. Special cases:
If the argument is NaN, then the result is NaN.
If the argument is infinite, then the result is infinity with the same sign as the argument.
If the argument is zero, then the result is a zero with the same sign as the argument.
The computed result must be within 1 ulp of the exact result.
Arguments:
Float — a value.
Result:
Float — the cube root of a.
ceil
Returns the smallest (closest to negative infinity) float value that is greater than or equal to the argument and is equal to a mathematical integer. Special cases:
If the argument value is already equal to a mathematical integer, then the result is the same as the argument.
If the argument is NaN or an infinity or positive zero or negative zero, then the result is the same as the argument.
If the argument value is less than zero but greater than -1.0, then the result is negative zero.
Arguments: Float — a value.
Result: Integer — the smallest (closest to negative infinity) value that is greater than or equal to the argument and is equal to a mathematical integer.
cos
Returns the trigonometric cosine of an angle. Special cases:
If the argument is NaN or an infinity, then the result is NaN.
The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
Arguments: Float — an angle, in radians.
Result: Float — the cosine of the argument.
cosh
Returns the hyperbolic cosine of x.
Arguments: Float — value for which to find the hyperbolic cosine.
Result: Float — hyperbolic cosine of x.
exp
Returns Euler's number e raised to the power of a float value. Special cases:
If the argument is NaN or an infinity, then the result is NaN.
If the argument is positive infinity, then the result is positive infinity.
If the argument is negative infinity, then the result is positive zero.
The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
Arguments: Float — the exponent to raise e to.
Result: Float — the value eFloat, where e is the base of the natural logarithms.
expm1
Compute exp(x) — 1.
Arguments: Float — number to compute shifted exponential.
Result: Float — exp(x) - 1.
floor
Returns the largest (closest to positive infinity) integer value that is less than or equal to the argument. Special cases:
If the argument value is already equal to a mathematical integer, then the result is the same as the argument.
If the argument is NaN or an infinity or positive zero or negative zero, then the result is the same as the argument.
Arguments: Float — a value.
Result: Float — the largest (closest to positive infinity) floating-point value that is less than or equal to the argument and is equal to a mathematical integer.
factorial
Returns n!. Shorthand for n Factorial, the product of the numbers 1,...,n.
Arguments: Integer — argument.
Result: Integer — n!.
gcd
Gets the greatest common divisor of the absolute value of two numbers, using the 'binary gcd' method which avoids division and modulo operations. See Knuth 4.5.2 algorithm B. This algorithm is due to Josef Stein (1961).
Arguments: Integer — any number. Integer — any number.
Result: Integer — the greatest common divisor, never negative.
hypot
Returns the hypotenuse of a triangle with sides x and y - sqrt(x2 +y2) avoiding intermediate overflow or underflow.
Arguments: Float — the first leg. Float — the second leg.
Result: Float — returns the hypotenuse of a triangle with sides x and y - sqrt(pow(x, 2) + pow(y, 2)).
Icm
Returns the least common multiple of the absolute value of two numbers, using the formula lcm(a,b) = (a / gcd(a,b)) * b.
Arguments: Integer — any number. Integer — any number.
Result: Integer — the least common multiple, never negative.
log
Returns the natural logarithm (base e) of a float value. Special cases:
If the argument is NaN or less than zero, then the result is NaN.
If the argument is positive infinity, then the result is positive infinity.
If the argument is positive zero or negative zero, then the result is negative infinity.
The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
Arguments: Float — a value.
Result: Float — the value ln, the natural logarithm.
log10
Returns the base 10 logarithm of a float value. Special cases:
If the argument is NaN or less than zero, then the result is NaN.
If the argument is positive infinity, then the result is positive infinity.
If the argument is positive zero or negative zero, then the result is negative infinity.
If the argument is equal to 10n for integer n, then the result is n.
The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
Arguments: Float — a value.
Result: Float — the base 10 logarithm.
maxFloat
Returns the greater of two float values. That is, the result is the argument closer to positive infinity. If the arguments have the same value, the result is that same value. If either value is NaN, then the result is NaN. Unlike the numerical comparison operators, this method considers negative zero to be strictly smaller than positive zero. If one argument is positive zero and the other negative zero, the result is positive zero.
Arguments: Float — an argument. Float — another argument.
Result: Float — the larger of the arguments.
maxFloatValue
Returns maximum value a Flow can have, (2 - Math.pow(2,-52)) * Math.pow(2,1023).
Result: Float — max possible value.
maxInt
Returns the greater of two integer values. That is, the result is the argument closer to positive infinity. If the arguments have the same value, the result is that same value. If either value is NaN, then the result is NaN. Unlike the numerical comparison operators, this method considers negative zero to be strictly smaller than positive zero. If one argument is positive zero and the other negative zero, the result is positive zero.
Arguments: Integer — an argument. Integer — another argument.
Result: Integer — the larger of the arguments.
maxIntegerValue
Returns maximum value an Integer can have, Math.pow(2,63)-1.
Result: Integer — max possible value.
minFloat
Returns the smaller of two float values. That is, the result is the value closer to negative infinity. If the arguments have the same value, the result is that same value. If either value is NaN, then the result is NaN. Unlike the numerical comparison operators, this method considers negative zero to be strictly smaller than positive zero. If one argument is positive zero and the other is negative zero, the result is negative zero.
Arguments: Float — an argument. Float — another argument.
Result: Float — the smaller of the arguments.
minFloatValue
Returns minimum value a Flow can have, -(2 - Math.pow(2,-52)) * Math.pow(2,1023).
Result: Float — min possible value.
minInt
Returns the smaller of two integer values. That is, the result is the value closer to negative infinity. If the arguments have the same value, the result is that same value. If either value is NaN, then the result is NaN. Unlike the numerical comparison operators, this method considers negative zero to be strictly smaller than positive zero. If one argument is positive zero and the other is negative zero, the result is negative zero.
Arguments: Integer — an argument. Integer — another argument.
Result: Integer — the smaller of the arguments.
minIntegerValue
Returns minimum value an Integer can have, -Math.pow(2,63).
Result: Integer — min possible value.
pow
Returns the value of the first argument raised to the power of the second argument.
Arguments: Integer — the base. Integer — the exponent.
Result: Integer — the result.
random
Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0. Returned values are chosen pseudorandomly with (approximately) uniform distribution from that range.
Result: Float — a pseudorandom float greater than or equal to 0.0 and less than 1.0.
round
Returns the closest int to the argument, with ties rounding up. Special cases:
If the argument is NaN, the result is 0.
If the argument is negative infinity or any value less than or equal to the value of Integer.MIN_VALUE, the result is equal to the value of Integer.MIN_VALUE.
If the argument is positive infinity or any value greater than or equal to the value of Integer.MAX_VALUE, the result is equal to the value of Integer.MAX_VALUE.
Arguments: Float — a floating-point value to be rounded to an integer.
Result: Integer — the value of the argument rounded to the nearest integer value.
roundFloat
Rounding mode to round towards nearest neighbor, unless both neighbors are equidistant, in which case round up.
If the discarded fraction is >= 0.5, then rounding up takes place up to a nearest integer; otherwise, rounding down to the nearest integer.
Arguments: Float — a floating-point value to be rounded to an integer.
Result: Integer — the value of the argument rounded to the scale value.
sign
Returns the sign for number x.
Arguments: Number — any number x.
Result: Integer — +1, 0, or -1, depending on the sign of x.
sin
Returns the trigonometric sine of an angle. Special cases:
If the argument is NaN or an infinity, then the result is NaN.
If the argument is zero, then the result is a zero with the same sign as the argument.
The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
Arguments: Float — an angle, in radians.
Result: Float — the sine of the argument.
sinh
Returns the hyperbolic sine.
Arguments: Float — double value for which to find the hyperbolic sine.
Result: Float — hyperbolic sine.
sqrt
Returns the correctly rounded positive square root of a double value. Special cases:
If the argument is NaN or less than zero, then the result is NaN.
If the argument is positive infinity, then the result is positive infinity.
If the argument is positive zero or negative zero, then the result is the same as the argument.
Otherwise, the result is the double value closest to the true mathematical square root of the argument value.
Arguments: Float — a value.
Result: Float — the positive square root of the argument. If the argument is NaN or less than zero, the result is NaN.
tan
Returns the trigonometric tangent of an angle. Special cases:
If the argument is NaN or an infinity, then the result is NaN.
If the argument is zero, then the result is a zero with the same sign as the argument.
The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
Arguments: Float — an angle, in radians.
Result: Float — the tangent of the argument.
tooDegrees
Convert radians to degrees, with error of less than 0.5 ULP.
Arguments: Float — an angle, in radians.
Result: Float — converted into degrees.
tooRadians
Convert degrees to radians, with error of less than 0.5 ULP.
Arguments: Float — an angle, in degrees.
Result: Float — converted into radians.
Description:
Additional:
contains
Returns true if the array contains the specified element.
Arguments: Array<T> — an array. T — element whose presence in this array is to be tested.
Result: Boolean — true if this array contains the specified element.
containsAll
Returns true if this array contains all of the elements of the specified array.
Arguments: Array<T> — an array. Array<T> — collection to be checked for containment in this array.
Result: Boolean — true if this array contains all of the elements of the specified array.
size
Returns the number of elements in the array.
Arguments: Array<T> — an array.
Result: Integer — length.
subArray
Returns a view of the portion of the array between the specified fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned list is empty.).
Arguments: Array<T> — an array. Integer — from index. Integer — to index.
Result: Array — new array.
Description:
Additional:
addDays
Adds or subtracts the specified amount of days to the date object, based on the calendar's rules.
Arguments: Date — date object. Integer — days amount.
Result: Date — new date object.
addHours
Adds or subtracts the specified amount of hours to the date object, based on the calendar's rules.
Arguments: Date — date object. Integer — hours amount.
Result: Date — new date object.
addMilliseconds
Adds or subtracts the specified amount of milliseconds to the date object, based on the calendar's rules.
Arguments: Date — date object. Integer — milliseconds amount.
Result: Date — new date object.
addMinutes
Adds or subtracts the specified amount of minutes to the date object, based on the calendar's rules.
Arguments: Date — date object. Integer — minutes amount.
Result: Date — new date object.
addMonths
Adds or subtracts the specified amount of months to the date object, based on the calendar's rules.
Arguments: Date — date object. Integer — months amount.
Result: Date — new date object.
addSeconds
Adds or subtracts the specified amount of seconds to the date object, based on the calendar's rules.
Arguments: Date — date object. Integer — seconds amount.
Result: Date — new date object.
addWeeks
Adds or subtracts the specified amount of weeks to the date object, based on the calendar's rules.
Arguments: Date — date object. Integer — weeks amount.
Result: Date — new date object.
addYears
Adds or subtracts the specified amount of years to the date object, based on the calendar's rules.
Arguments:
Date — date object.
Integer — years amount.
Result:
Date — new date object.
after
Returns whether the first argument represents a time after the time represented by the second argument.
Arguments: Date — date object. Date — the date to be compared.
Result: Boolean — true if the time of the first argument is after the time represented by the second argument; false otherwise.
before
Returns whether the first argument represents a time before the time represented by the second argument.
Arguments: Date — date object. Date — the date to be compared.
Result: Boolean — true if the time of the first argument is before the time represented by the second argument; false otherwise.
currentDate
Returns a Date object representing the current time value (UTC).
Result: Date — a Date representing the time value.
difference
Returns the difference between two dates by specified field. If the difference is more then N and less then N+1, then N is a result. For example, if you had the date of 25 May 2020 12:34:56.345 and 27 May 2020 16:10:12.300, if you passed with 3 (Day), it would return 2. If this was passed with 1 (Year), it would return 0. Fields indicators:
Year - 1
Month - 2
Day - 3
Hour - 4
Minute - 5
Second - 6
Arguments: Date — the first date. Date — the second date. Integer — field.
Result: Integer — the difference.
getDaysCountInMonth
Returns the amount of days for specified year and month.
Arguments: Integer — year. Integer — month.
Result: Integer — days count.
getDaysCountInYear
Returns the amount of days for a specified year.
Arguments: Integer — year.
Result: Integer — days count.
getDayOfYear
Returns the value that indicates the day number within the data year.
Arguments: Date — date object.
Result: Integer — day number.
getDayOfMonth
Returns the value that indicates the day number within the data month.
Arguments: Date — date object.
Result: Integer — day number.
getDayOfWeek
Returns the value that indicates the day number within the data week.
Arguments: Date — date object.
Result: Integer — day number.
getFirstDayOfMonth
Returns the first day of the specified month.
Arguments: Integer — year. Integer — month.
Result: Integer — value from range 1-7. Where 1 - Sunday, 2 - Monday, 3 - Tuesday, 4 - Wednesday, 5 - Thursday, 6 - Friday, 7 - Saturday
getFirstDayOfYear
Returns the first day of the specified year.
Arguments: Integer — year.
Result: Integer — value from range 1-7. Where 1 - Sunday, 2 - Monday, 3 - Tuesday, 4 - Wednesday, 5 - Thursday, 6 - Friday, 7 - Saturday
getHour
Returns the value that indicates the hour of the morning or afternoon. NOTE value is in 12 hours format.
Arguments: Date — date object.
Result: Integer — hour.
getHourOfDay
Returns the value that indicates the hour of the day.
Arguments: Date — date object.
Result: Integer — hour.
getMilliseconds
Returns the value that indicates the millisecond within the second.
Arguments: Date — date object.
Result: Integer — milliseconds.
getMinute
Returns the value that indicates the minute within the hour.
Arguments: Date — date object.
Result: Integer — minutes.
getMonth
Returns the value that indicates the month within the year.
Arguments: Date — date object.
Result: Integer — month.
getSecond
Returns the value that indicates the second within the minute.
Arguments: Date — date object.
Result: Integer — seconds.
getTimeInMills
The currently set time for the argument date, expressed in milliseconds after January 1, 1970, 0:00:00 GMT.
Arguments: Date — date object.
Result: Integer — milliseconds.
getWeekOfMonth
Returns the value that indicates the week number within the argument date month.
Arguments: Date — date object.
Result: Integer — week.
getWeekOfYear
Returns the value that indicates the week number within the argument date year.
Arguments: Date — date object.
Result: Integer — week.
getYear
Returns the value that indicates the argument year.
Arguments: Date — date object.
Result: Integer — year.
fromString
Parses text from the beginning of the given string to produce a date.
Arguments: String — the string to be converted. String — the format of the date represented by the string.
Format examples: Date and Time Pattern: "yyyy-MM-dd" Result: 2001-07-04T00:00:00Z
Date and Time Pattern: "yyyy-MM-dd'T'HH:mm:ss"
Result: 2001-07-04T12:08:56 Result: Date — new date object.
If you use a date in a timeless format, the system will add time. For example, for the date "2023-10-16", the result will be "2020-10-16T00:00:00:00"
isSameDay
Checks if two date objects are on the same day ignoring time. 05 May 2020 11:00 and 05 May 2020 23:45 would return true. 05 May 2020 11:00 and 10 May 2020 14:30 would return false.
Arguments: Date — the first date. Date — the second date.
Result: Boolean — true, if they represent the same day.
truncate
Truncates a date, leaving the field specified as the most significant field. For example, if you had the date-time of 05 May 2020 12:34:56.345, if you passed with 4 (Hour), it would return 05 May 2020 12:00:00.000. If this was passed with 2 (Month), it would return 1 May 2020 0:00:00.000. Fields:
Year - 1
Month - 2
Day - 3
Hour - 4
Minute - 5
Second - 6
Arguments: Date — the date to work with. Integer — the field.
Result: Date — the truncated date.
round
Rounds a date, leaving the field specified as the most significant field. For example, if you had the date-time of 25 May 2020 12:34:56.345, if you passed with 4 (Hour), it would return 05 May 2020 13:00:00.000. If this was passed with 2 (Month), it would return 1 August 2020 0:00:00.000. Fields:
Year - 1
Month - 2
Day - 3
Hour - 4
Minute - 5
Second - 6
Arguments: Date — the date to work with. Integer — the field.
Result: Date — the rounded date.
Description:
Additional:
capitalize
Capitalizes a String changing the first character to title case. No other characters are changed. Example: String.capitalize('teST') will return 'TeST'.
Arguments: String — the String to capitalize.
Result: String — the capitalized String.
concat
Concatenates the second defined string to the end of the first defined string.
Arguments: String — the source string. String — concatenated to the end of the result String.
Result: String — represents the concatenation of the first argument string followed by the second string argument's characters.
contains
Returns true, if, and only if, the first defined string contains the second defined string.
Arguments: String — the source string. String — the text to search for.
Result: Boolean — true, if the first argument String contains the second argument String, false otherwise.
countMatсhes
Counts how many times the substring appears in the larger string.
Arguments: String — the String to check, may be null. String — the substring to count, may be null.
Result: Integer — the number of occurrences, 0 if either String is null.
difference
Compares two Strings, and returns the portion where they differ. More precisely, returns the remainder of the second String, starting from where it's different from the first. This means that the difference between 'abc' and 'ab' is the empty String and not 'c'. Examples: String.difference('abcde', 'abcfgh xyz')='fgh xyz' String.difference('test', 'test some')=' some'
Arguments: String — the first String, may be null. String — the second String, may be null.
Result: String — the portion of the second String where it differs from the first one; returns the empty String if they are equal.
endsWith
Tests if this string ends with the specified suffix.
Arguments: String — the source string. String — the end suffix.
Result: Boolean — true, if the character sequence represented by the second argument is a suffix of the character sequence represented by the first argument; false otherwise. Note that the result will be true if the second argument is the empty string or is equal to the first argument.
equalsIgnoreCase
Compares this String to another String, ignoring case considerations. Two strings are considered equal ignoring cases if they are of the same length and corresponding characters in the two strings are equal ignoring cases.
Arguments: String — the source string. String — the string to compare.
Result: Boolean — true, if the arguments are not null and they are equivalent ignoring case; false otherwise
getCommonPrefix
Compares all Strings in an array and returns the initial sequence of characters that is common to all of them. Example: A - Array that contains strings 'abcde' and 'abcfg'. String.getCommonPrefix(A) = 'abc'.
Arguments: Array<String> — array of String objects, entries may be null.
Result: String — the initial sequence of characters that are common to all Strings in the array; empty String if the array is null, the elements are all null or if there is no common prefix.
indexOf
Returns the index within this string of the first occurrence of the specified string.
Arguments: String — the source string. String — search string.
Result: Integer — the index of the first occurrence of the second argument in the first argument, or -1 if the string does not occur.
indexOfDifference
Compares all Strings in an array and returns the index at which the CharSequences begin to differ. Examples: A — The array that contains strings: 'abc', 'abd', 'ae'. String.indexOfDifference(A)=1 A — The array that contains strings: 'abc', 'abd', 'abe'. String.indexOfDifference(A)=2
Arguments: Array<String> - array of CharSequences, entries may be null.
Result: Integer — the index where the strings begin to differ; -1 if they are all equal.
indexOfWithFrom
Returns the index within this string of the first occurrence of the specified string, starting the search at the specified index.
Arguments: String — the source string. String — the search string. Integer — the starting index.
Result: Integer - the index of the first occurrence of the second argument in the first argument that is greater than or equal to the starting index, or -1 if the search string does not occur.
isEmpty
Returns true if, and only if, length is 0.
Arguments: String — the source string.
Result: Boolean — true if length is 0, otherwise false
isNumber
Checks if the String contains only Unicode digits. A decimal point is not a Unicode digit and returns false. null will return false. An empty String (length=0) will return false. Example: String.isNumeric(null)=false String.isNumeric('123')=true String.isNumeric('12.3')=false String.isNumeric('-123')=false
Arguments: String — the string to check, may be null
Result: Boolean — true if only contains digits, and is non-null.
join
Joins the elements of the provided array into a single String containing the provided list of elements. No delimiter is added before or after the list. Null objects or empty strings within the array are represented by empty strings.
Arguments: Array<String> — the array of values to join together, may be null. String — the separator character to use.
Result: String — the joined String, null if null array input.
lastIndexOf
Returns the index within this string of the last occurrence of the specified string.
Arguments: String — the source string. String — the search string.
Result: Integer — the index of the last occurrence of the second argument in the first argument, or -1 if the search string does not occur.
lastIndexOfWithFrom
Returns the index within the first argument string of the last occurrence of the second argument string, searching backward starting at the specified index.
Arguments: String — the source string. String — the search string. Integer — the index to start the search from. There is no restriction on the value of fromIndex. If it is greater than or equal to the length of the source string, it has the same effect as if it were equal to one less than the length of the source string: the second argument string may be searched. If it is negative, it has the same effect as if it were -1: -1 is returned.
Result: Integer - the index of the last occurrence of the second argument in the first argument, or -1 if the search string does not occur.
length
Returns the length of the string.
Arguments: String — the source string.
Result: Integer — the length of the string.
mathes
Tells whether or not this string matches the given regular expression.
Arguments: String — the source string. String — the regular expression to which the source string is to be matched.
Result: Boolean — true, if, and only if, the first argument string matches the given regular expression.
replace
Returns a new string resulting from replacing all occurrences of oldString in this string with the newString.
Arguments: String — the source string. String — the string to be replaced for. String — the replacing string.
Result: String — a string derived from the first argument String by replacing every occurrence of the second argument string with the third argument string.
replaceFirst
Replaces the first substring of this string that matches the given regular expression with the given replacement.
Arguments: String — the source string. String — the regular expression to which this string is to be matched. String — the string to be substituted for the first match.
Result: String — the resulting String.
replaceAll
Replaces each substring of this string that matches the given regular expression with the given replacement.
Arguments: String — the source string. String — the regular expression to which the source string is to be matched. String — the string to be substituted for each match.
Result: String — the resulting String.
repeat
Returns a string whose value is the concatenation of this string repeated count times. If this string is empty or count is zero then the empty string is returned.
Arguments: String — the source string. Integer — number of times to repeat.
Result: String — a string composed of this string repeated count times or the empty string if this string is empty or count is zero.
reverse
Reverses a String.
Arguments: String — the String to reverse, may be null.
Result: String — the reversed String, null if null String input.
split
Splits this string around matches of the given regular expression.
Arguments: String — the source string. String — the delimiting regular expression.
Result: Array<String> — the array of strings computed by splitting the source string around matches of the given regular expression.
startWith
Tests if this string starts with the specified suffix.
Arguments: String — the source string. String — the prefix string.
Result: Boolean — true if the character sequence represented by the second argument is a prefix of the character sequence represented by the first argument string; false otherwise. Note also that true will be returned if the prefix string is an empty string or is equal to the source string.
substringTillEnd
Returns a new string that is a substring of this string from start index till the end.
Arguments: String — the source string. Integer - the beginning index, inclusive.
Result: String — the specified substring.
substring
Returns a new string that is a substring of this string.
Arguments: String — the source string. Integer — the beginning index, inclusive. Integer — the ending index, exclusive.
Result: String — the specified substring.
symbolAt
Returns the character at the specified index.
Arguments: String — the source string. Integer — the index.
Result: String — the char value at the specified index of this string. The first char value is at index 0.
toLowerCase
Converts all of the characters in this String to lowercase.
Arguments: String — the source string.
Result: String — the String, converted to lowercase.
toUpperCase
Converts all of the characters in this String to uppercase.
Arguments: String — the source string.
Result: String — the String, converted to uppercase.
trim
Returns a copy of the string, with leading and trailing whitespace omitted.
Arguments: String — the source string.
Result: String — a copy of the source string with leading and trailing white space removed, or this string if it has no leading or trailing white space.
uncapitalize
Uncapitalizes a String, changing the first character to lowercase as per Character.toLowerCase(int). No other characters are changed. Example: String.uncapitalize('TeST') will return 'teST'.
Arguments: String — the String to uncapitalize, may be null.
Result: String — the uncapitalized String, null if null String input.
wrap
Wraps a String with another String. Example - String.wrap('some', 'x')='xsomex'
Arguments:
String — the String to be wrapper, may be null.
String — the String that will wrap str.
Result: String — wrapped String, null if null String input.
Description:
Additional:
generateToken
Actually builds the JWT and serializes it to a compact, URL-safe string according to the JWT Compact Serialization rules. HS512 is used to sign.
Arguments: User — an instance of pdk.jwt.JwtUser. Term — used to calculate expiration date. Value in seconds. Secret — string constant used to sign the token.
Result: String — serialized JWT.
validateToken
Verify the token belongs to the input JwtUser.
Arguments: User — an instance of pdk.jwt.JwtUser. Token — serialized JWT. Secret — string constant used to sign the token.
Result: Boolean — true if the token contains the same userId as JwtUser's userId.
isTokenExpired
Verify the token has been expired.
Arguments: Token — serialized JWT. Secret — string constant used to sign the token.
Result: Boolean — true if the token is not expired.
getUserIdFromToken
Returns the userId attribute from the serialized jwt token.
Arguments: Token — serialized JWT. Secret — string constant used to sign the token.
Result: String — userId.
getUserFromToken
Returns the user as an object from the serialized jwt token.
Arguments: Token (string) — serialized JWT. Secret — string constant used to sign the token.
Result: String — user as a JWTuser object.
getExpirationDateFromToken
Returns the expiration date from the serialized jwt token.
Arguments: Token — serialized JWT. Secret — string constant used to sign the token.
Result: Date — the expiration date.
Set of actions for the Expression Editor
Let's see what operations are possible here:
Copy — allows you to copy the text for later by transferring it.
Paste — allows you to paste text. It is not available unless you have previously used the Copy or Cut options.
Delete — allows you to delete the text.
Undo — undoes the previous change. The editor keeps all versions of the change to the first one. The change queue is cleared when the dialog is closed.
Redo — redoes the modified change. The queue is repeated when the undo is repeated and cleared on any other action that changed the expression.
There’s a panel with logical, comparison, and math operators, as well as round and square brackets that can be used in expressions below the expression input field.
Plus. Used to add numbers or strings
Minus. Used to subtract numbers or strings
Multiply. Used to multiply numbers or strings
Divide. Used to divide numbers or strings
Equal. Used to test for equality
Greater than. Used to check if the first argument is greater than the second
Less than. Used to check if the first argument is less than the second
Not Equal. Used to test for inequality
Greater than or equal. Used to check if the first argument is greater than or equal to the second
Less than or equal. Used to check if the first argument is less than or equal to the second
and. Used to binary conjunction
or. Used to binary disjunction
not. Used to negate
Round brackets. Operator brackets for operator precedence
Square brackets. Array indicator
null. Null object reference
true. Used when it is necessary to get “yes”/”no” values for the result of a number comparison in more complex operations
false. Used when it is necessary to get “yes”/”no” values for the result of a number comparison in more complex operations