Expression Editor for ProcessMIX is a control that enables creating and editing expressions at run-time, which can then be used to perform calculations and shaping data. Expression Editor offers smart code completion, syntax highlighting, and error reporting functionalities.
Expression editor appears when the node parameter that needs to be defined as an expression is selected. Assign in Assign node, Condition in If or Switch node etc. and open the Expression Editor pop-up window.
In the left panel, you can find all the data that can be used in an expression — inputs, output, nodes variables, and local variables.
You can filter the variables to find the necessary data. Click on the 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.
Function | Description | Additional |
---|---|---|
Any | ||
toString | Converts any value to string | Arguments: Any — any value. Result: String — converted value. |
clone | Clones any object | Arguments: Any — any value. Result: Any — cloned object. |
Util | ||
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. |
Json | ||
isArray | Checks if the input object is an array. | Arguments: JSONObject — any JSON object. Result: Boolean — true if the input object is an JSONArray. |
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. |
Codec | ||
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. |
hexStringToIntegerArray | Converts a hex string to an array of integers. | Arguments: String — hex string. Integer — size. Result: Array<Integer> — array of integers. |
integerArrayToHexString | Converts an array of integers 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. Result: String — hex string. |
hexStringToAscii | Converts a hex string to an ASCII string. | Arguments: String — hex string. Result: String — ASCII string. |
File | ||
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. |
Crypto | ||
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: СleanString — 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. |
Cast | ||
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. |
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. |
Map | ||
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 |
Math | ||
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.Note that the value of Math.cell(x) is exactly the value of -Math.floor(-x). | 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 integer 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. |
Array | ||
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. |
Date | ||
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 current time value (millisecond offset from the Epoch). | 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 – 1Month – 2Day – 3Hour – 4Minute – 5Second – 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. This method may not use the entire text of the given string. | Arguments: String — the string to be converted.String — the format of the date represented by the string. Result: Date — new date object. |
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 – 1Month – 2Day – 3Hour – 4Minute – 5Second – 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 – 1Month – 2Day – 3Hour – 4Minute – 5Second – 6 | Arguments: Date — the date to work with.Integer — the field. Result: Date — the rounded date. |
String | ||
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. |
countMathes | 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: ArrayArray<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 stringInteger — 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. |
JWT | ||
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:
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.