ProcessMIX User Guide
Categories

Expression Editor

Updated on October 5, 2023
Print

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.

How to work with the Expression Editor?

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.

Available functions

FunctionDescriptionAdditional
Any  
toStringConverts any value to stringArguments:
Any — any value.
Result:
String — converted value.
cloneClones any objectArguments:
Any — any value.
Result:
Any — cloned object.
Util
uuidStatic 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
isArrayChecks if the input object is an array.Arguments:
JSONObject — any JSON object.
Result:
Boolean — true if the input object is an JSONArray.
objectToArrayConverts the input object to an array.Arguments:
JSONObject— any JSON object.
Result:
JSONArray — the input object converted to an array.
getAttributeNamesGets a list of attribute names of the input object.Arguments:
JSONObject — any JSON object.
Result:
Array<String> — list of attribute names.
getIntegerGets an integer value of the JSONObject attribute.Arguments:
JSONObject — any JSON object.
String — attribute name.
Result:
Integer — attribute value.
getIntegerArrayGets an array of integer values of the JSONObject attribute.Arguments:
JSONObject — any JSON object.
String — attribute name.
Result:
Array<Integer> — attribute value.
getFloatGets a float value of the JSONObject attribute.Arguments:
JSONObject — any JSON object.
String — attribute name.
Result:
Float — attribute value.
getFloatArrayGets an array of float values of the JSONObject attribute.Arguments:
JSONObject — any JSON object.
String — attribute name.
Result:
Array<Float> — attribute value.
getBooleanGets a boolean value of the JSONObject attribute.Arguments:
JSONObject — any JSON object.
String — attribute name.
Result:
Boolean — attribute value.
getBooleanArrayGets an array of boolean values of the JSONObject attribute.Arguments:
JSONObject — any JSON object.
String — attribute name.
Result:
Array<Boolean> — attribute value.
getStringGets a string value of the JSONObject attribute.Arguments:
JSONObject — any JSON object.
String — attribute name.
Result:
String — attribute value.
getStringArrayGets an array of string values of the JSONObject attribute.Arguments:
JSONObject — any JSON object.
String — attribute name.
Result:
Array<String> — attribute value.
getJsonObjectGets a JSONObject value of the JSONObject attribute.Arguments:
JSONObject — any JSON object.
String — attribute name.
Result:
JSONObject — attribute value.
getJsonArrayGets an array of JSONObject values of the JSONObject attribute.Arguments:
JSONObject — any JSON object.
String — attribute name.
Result:
JSONArray — attribute value.
getArraySizeGets a size of the JSONArray.Arguments:
JSONArray — any JSON array.
Result:
Integer — size.
getArrayItemGets an element of the JSONArray.Arguments:
JSONArray — any JSON array.
Integer — index.
Result:
JSONObject — element.
Codec
encodeStringToBase64Encodes a String into a newly—allocated Base64 encoded String.Arguments:
String — the string to encode.
Result:
String — a newly—allocated base 64 string.
encodeFileToBase64Encodes a File into a newly—allocated Base64 encoded String.Arguments:
File — the file to encode.
Result:
String — a newly—allocated base 64 string.
hexStringToIntegerArrayConverts a hex string to an array of integers.Arguments:
String — hex string.
Integer — size.
Result:
Array<Integer> — array of integers.
integerArrayToHexStringConverts an array of integers to a hex string.Arguments:
Array<Integer> — array of integers.
Result:
String — hex string.
asciiStringToHexConverts an ASCII string to a hex string.Arguments:
String — ASCII string.
Result:
String — hex string.
hexStringToAsciiConverts a hex string to an ASCII string.Arguments:
String — hex string.
Result:
String — ASCII string.
File
getMetaTypeGets a meta type File.Arguments:
File — any file.
Result:
String — mime type.
getNameGets a name of a File.Arguments:
File — any file.
Result:
String — file name.
getSizeGets a size in bytes of a File.Arguments:
File — any file.
Result:
Integer — file size in bytes.
toByteArrayReturns 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  
encodeEncode 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  
booleanToStringConverts boolean to stringArguments:
Boolean — object for converting.
Result:
String — converted value.
dateToStringConverts 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.
integerToFloatConverts integer to float numberArguments:
Integer — object for converting.
Result:
Float — converted value.
integerToStringConverts integer to stringArguments:
Integer — object for converting.
Result:
String — converted value.
integerToDateConverts integer to the date objectArguments:
Integer — assume that this argument represents date milliseconds.
Result:
Date — converted object.
floatToStringConverts float to stringArguments:
Float — the number to be converted.
Result:
String — converted object.
stringToIntegerParses 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.
stringToFloatReturns 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.
stringToBooleanParses 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  
sizeReturns 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.
containsKeyReturns 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.
getReturns 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.
keysReturns 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.
valuesReturns 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.
entryArrayReturns 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.
isEmptyReturns true if this map contains no key-value mappings. Arguments:
Map<V> — any map.
Result:
Boolean
Math  
absIntReturns 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.
absFloatReturns 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.
acosReturns 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.
asinReturns 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.
atanReturns 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.
cbrtReturns 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.
ceilReturns 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.
cosReturns 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.
coshReturns the hyperbolic cosine of x.Arguments:
Float — value for which to find the hyperbolic cosine.
Result:
Float — hyperbolic cosine of x.
expReturns 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.
expm1Compute exp(x) — 1. Arguments:
Float — number to compute shifted exponential.
Result:
Float — exp(x) – 1.
floorReturns 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.
factorialReturns n!. Shorthand for n Factorial, the product of the numbers 1,…,n.Arguments:
Integer — argument.
Result:
Integer — n!.
gcdGets 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.
hypotReturns 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)).
IcmReturns 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.
logReturns 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.
log10Returns 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.
maxFloatReturns 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.
maxFloatValueReturns maximum value a Flow can have, (2 – Math.pow(2,-52)) * Math.pow(2,1023).Result:
Float — max possible value.
maxIntReturns 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.
maxIntegerValueReturns maximum value an Integer can have, Math.pow(2,63)-1.Result:
Integer — max possible value.
minFloatReturns 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.
minFloatValueReturns minimum value a Flow can have, -(2 – Math.pow(2,-52)) * Math.pow(2,1023).Result:
Float — min possible value.
minIntReturns 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.
minIntegerValueReturns minimum value an Integer can have, -Math.pow(2,63). Result:
Integer — min possible value.
powReturns 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.
randomReturns 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.
roundReturns 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.
roundFloatRounding 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.
signReturns the sign for number x. Arguments:
Number — any number x.
Result:
Integer — +1, 0, or -1, depending on the sign of x.
sinReturns 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.
sinhReturns the hyperbolic sine. Arguments:
Float — double value for which to find the hyperbolic sine.
Result:
Float — hyperbolic sine.
sqrtReturns 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.
tanReturns 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.
tooDegreesConvert radians to degrees, with error of less than 0.5 ULP. Arguments:
Float — an angle, in radians.
Result:
Float — converted into degrees.
tooRadiansConvert degrees to radians, with error of less than 0.5 ULP. Arguments:
Float — an angle, in degrees.
Result:
Float — converted into radians.
Array  
containsReturns 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.
containsAllReturns 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.
sizeReturns the number of elements in the array. Arguments:
Array<T> — an array.
Result:
Integer — length.
subArrayReturns 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  
addDaysAdds 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.
addHoursAdds 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.
addMillisecondsAdds 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.
addMinutesAdds 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.
addMonthsAdds 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.
addSecondsAdds 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.
addWeeksAdds 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.
addYearsAdds 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.
afterReturns 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.
beforeReturns 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.
currentDateReturns a Date object representing current time value (millisecond offset from the Epoch). Result:
Date — a Date representing the time value.
differenceReturns 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.
getDaysCountInMonthReturns the amount of days for specified year and month.Arguments:
Integer — year.Integer — month.
Result:
Integer — days count.
getDaysCountInYearReturns the amount of days for a specified year. Arguments:
Integer — year.
Result:
Integer — days count.
getDayOfYearReturns the value that indicates the day number within the data year. Arguments:
Date — date object.
Result:
Integer — day number.
getDayOfMonthReturns the value that indicates the day number within the data month. Arguments:
Date — date object.
Result:
Integer — day number.
getDayOfWeekReturns the value that indicates the day number within the data week. Arguments:
Date — date object.
Result:
Integer — day number.
getFirstDayOfMonthReturns 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
getFirstDayOfYearReturns 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
getHourReturns 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.
getHourOfDayReturns the value that indicates the hour of the day.Arguments:
Date — date object.
Result:
Integer — hour.
getMillisecondsReturns the value that indicates the millisecond within the second. Arguments:
Date — date object.
Result:
Integer — milliseconds.
getMinuteReturns the value that indicates the minute within the hour.Arguments:
Date — date object.
Result:
Integer — minutes.
getMonthReturns the value that indicates the month within the year. Arguments:
Date — date object.
Result:
Integer — month.
getSecondReturns the value that indicates the second within the minute. Arguments:
Date — date object.
Result:
Integer — seconds.
getTimeInMillsThe 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.
getWeekOfMonthReturns the value that indicates the week number within the argument date month. Arguments:
Date — date object.
Result:
Integer — week.
getWeekOfYearReturns the value that indicates the week number within the argument date year.Arguments:
Date — date object.
Result:
Integer — week.
getYearReturns the value that indicates the argument year. Arguments:
Date — date object.
Result:
Integer — year.
fromStringParses 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.
isSameDayChecks 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.
truncateTruncates 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.
roundRounds 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  
capitalizeCapitalizes 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.
concatConcatenates 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.
containsReturns 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.
countMathesCounts 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.
differenceCompares 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.
endsWithTests 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.
equalsIgnoreCaseCompares 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
getCommonPrefixCompares 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.
indexOfReturns 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.
indexOfDifferenceCompares 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.
indexOfWithFromReturns 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.
isEmptyReturns true if, and only if, length is 0. Arguments:
String — the source string.
Result:
Boolean — true if length is 0, otherwise false
isNumberChecks 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.
joinJoins 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.
lastIndexOfReturns 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.
lastIndexOfWithFromReturns 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.
lengthReturns the length of the string. Arguments:
String — the source string.
Result:
Integer — the length of the string.
mathesTells 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.
replaceReturns 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.
replaceFirstReplaces 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.
replaceAllReplaces 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.
repeatReturns 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.
reverseReverses a String. Arguments:
String — the String to reverse, may be null.
Result:
String — the reversed String, null if null String input.
splitSplits 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.
startWithTests 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.
substringTillEndReturns 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.
substringReturns 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.
symbolAtReturns 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.
toLowerCaseConverts all of the characters in this String to lowercase.Arguments:
String — the source string.
Result:
String — the String, converted to lowercase.
toUpperCaseConverts all of the characters in this String to uppercase. Arguments:
String — the source string.
Result:
String — the String, converted to uppercase.
trimReturns 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.
uncapitalizeUncapitalizes 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.
wrapWraps 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  
generateTokenActually 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.
validateTokenVerify 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.
isTokenExpiredVerify 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.
getUserIdFromTokenReturns the userId attribute from the serialized jwt token. Arguments:
Token — serialized JWT.secret — string constant used to sign the token.
Result:
String — userId.
getUserFromTokenReturns 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.
getExpirationDateFromTokenReturns 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.

Operations with the Expression Editor

Set of actions for the Expression Editor

Let’s see what operations are possible here:

  1. Copy – allows you to copy the text for later by transferring it.
  2. Paste – allows you to paste text. It is not available unless you have previously used the Copy or Cut options.
  3. Delete – allows you to delete the text.
  4. 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.
  5. Redo – redoes the modified change. The queue is repeated when the undo is repeated and cleared on any other action that changed the expression.

How to work with a logical panel?

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.

  1. Plus. Used to add numbers or strings
  2. Minus. Used to subtract numbers or strings
  3. Multiply. Used to multiply numbers or strings
  4. Divide. Used to divide numbers or strings
  5. Equal. Used to test for equality
  6. Greater than. Used to check if the first argument is greater than the second
  7. Less than. Used to check if the first argument is less than the second
  8. Not Equal. Used to test for inequality
  9. Greater than or equal. Used to check if the first argument is greater than or equal to the second
  10. Less than or equal. Used to check if the first argument is less than or equal to the second
  11. and. Used to binary conjunction
  12. or. Used to binary disjunction
  13. not. Used to negate
  14. Round brackets. Operator brackets for operator precedence
  15. Square brackets. Array indicator
  16. null. Null object reference
  17. true. Used when it is necessary to get “yes”/”no” values for the result of a number comparison in more complex operations.
  18. false. Used when it is necessary to get “yes”/”no” values for the result of a number comparison in more complex operations.