REL Functions and Implicit Objects

Redwood Expression Language (or REL) is a simple expression language that supports basic arithmetic and comparison operators, and some predefined functions. Different scripting contexts have different predefined objects, the functions on this page are available in all contexts.

You can create your own functions for use in REL and RedwoodScript using a library with REL entry points, see Libraries for more information.

The REL can be used to specify:

  • Job definition parameter default values
  • Job definition return code mappings
  • Job chain step preconditions
  • Job chain job preconditions
  • Job chain job parameter mappings
  • Job chain job scheduling parameters
  • Event raiser comments
  • ...

See the scripting contexts topic for more information.

Expressions in REL are designed to be very similar to expressions in RedwoodScript, and the predefined functions are the same. REL expressions start with an equals sign ( =) such as:

=Time.now('Europe/Paris')

You can build sentences by concatenating elements with the plus character (+):

='The time in Paris is ' + Time.now('Europe/Paris') + ', in New York it is ' + Time.now('America/New York')

Operators

Redwood Expression Language provides support for the basic arithmetic operators:

  • + - addition and string concatenation
  • - - subtraction
  • * - multiplication
  • / - division
  • % - integer modulus
  • && - logical AND
  • || - logical OR
  • ! - NOT

It also supports comparison:

  • === - equal to
  • !== - not equal to
  • > - greater than
  • >= - greater than or equal
  • < - less than
  • <= - less than or equal

Escape Character

  • \\ - escape character, and thus must be escaped if the literal is meant to be used. This means that a UNC path would be specified as follows:

    \\\\\\\\server\\\\share\\\\folder\\\\file

Builtin Constants

  • true - true value of the boolean type.
  • false - false value of the boolean type.

Built in function classes

Note: The current<data_type> object designates the object you want to use with the function.

Built in functions

Array

Prefix: Array

Create an array from several elements.

Function Name Signature Description
toStringArray
RelObject Array.toStringArray(final Object[] values)

Change a group of Strings to a String array.

toNumberArray
RelObject Array.toNumberArray(final Object[] values)

Create an array of BigDecimals from a group of numbers.

toDateTimeZoneArray
RelObject Array.toDateTimeZoneArray(final Object[] values)

Create an array of DateTimeZones.

toTimeArray
RelObject Array.toTimeArray(final Object[] values)

Create an array of BigDecimal from DateTime elements (elements evaluated as epoch time).

toString
String Array.toString(Object[] values, String delimiter)

Create a String with all elements of the array, separated by delimiter.

toStringAffix
String Array.toStringAffix(Object[] values, String delimiter, String prefix, String suffix)

Create a String with all elements of the array, separated by delimiter and surrounded by prefix and suffix.

get
Object Array.get(Object[] array, int index)

Retrieve the element from the array at the specified index. This will throw an exception if array is null or the index is out of bounds (index < 0 or index >= array.length).

Example: Array.toStringArray()

=Array.toStringArray('Apples', 'Oranges', 'Bananas', 'Lemons') Returns an array with 4 fruity elements.

Example: Array.toNumberArray()

=Array.toNumberArray(1, 2, 3, 4) Returns an array with 4 numbers.

Example: Array.toDateTimeZoneArray()

=Array.toDateTimeZoneArray(Time.now(),Time.parse('20240803100236','yyyyMMddhhmmss')) Returns an array with 2 date/times elements.

Example: Array.toTimeArray()

=Array.toTimeArray(Time.now(),Time.parse('20240803100236','yyyyMMddhhmmss')) Returns an array with 3 epoch time elements.

Example: Array.toString()

=Array.toString(['Apples', 'Oranges', 'Bananas', 'Lemons'], ',') Returns "Apples,Oranges,Bananas,Lemons".

Example: Array.toStringAffix()

=Array.toStringAffix(['Apples', 'Oranges', 'Bananas', 'Lemons'], ',', '[', ']',) Returns "[Apples,Oranges,Bananas,Lemons]".

Example: Array.get()

=Array.get(['Apples', 'Oranges', 'Bananas', 'Lemons'], 0) Returns "Apples".

Cast

Prefix:

Change a data type to another.

Function Name Signature Description
ToBoolean
Object ToBoolean(Object arg)

Convert arg to a boolean (true/false) if possible.

ToNumber
Object ToNumber(Object arg)

Convert arg to a number if possible.

ToInteger
Object ToInteger(Object arg)

Convert arg to an integer if possible.

ToString
Object ToString(Object arg)

Convert arg to a string.

ToYN
Object ToYN(Object arg)

Convert arg to Y for true and N for any other value.

Example: ToBoolean()

=ToBoolean('true') Returns true.

Example: ToNumber()

=ToNumber('123') Returns 123.

Example: ToInteger()

=ToInteger('123') Returns 123.

Example: ToString()

=ToString(true) Returns true.

Example: ToYN()

=ToYN('true') Returns Y.

Math

Prefix: Math

Mathematical functions for use with Numbers.

Function Name Signature Description
abs
BigDecimal Math.abs(BigDecimal x)

Calculate the absolute value of x.

floor
BigDecimal Math.floor(BigDecimal x)

Calculate the floor (greatest integer less than) of x.

ceil
BigDecimal Math.ceil(BigDecimal x)

Calculate the ceiling (least integer greater than) of x.

round
BigDecimal Math.round(BigDecimal x)

Round x. If x ends in .5, it will be rounded up.

getInstance
BaseMath Math.getInstance()

Example: Math.abs()

=Math.abs(-12.12) Returns 12.12.

Example: Math.floor()

=Math.floor(-12.12) Returns -13.

Example: Math.ceil()

=Math.ceil(-12.12) Returns -12.

Example: Math.round()

=Math.round(12.49) Returns 12.

Example: Math.getInstance()

Range

Prefix: Range

Functions for working with sets and ranges.

Set is written as "XXXXXXX" where X is either '_' or a letter and the first X represents 0 (or Sunday for days of the week, or January for months). Any letter is in the set, and '_' is not in the set.

Example sets:

Set X's English
First month of the quarter X__X__X__X__ J__A__M__O__
Last month of the quarter __X__X__X__X __M__J__S__D
Not last month of the quarter XX_XX_XX_XX_ JF_AM_JA_ON_
Monday, Wednesday, Friday _X_X_X_ _M_W_F_
Saturday, Sunday X_____X S_____S

Ranges are made up of comma separated sections, each of which is a number (eg. 1) or a range of numbers (eg. 4-7). All numbers specified are in the range, other numbers are not.

Function Name Signature Description
inRange
boolean Range.inRange(int candidate, String trueRange)

Return true if candidate is in the range specified by trueRange.

inSet
boolean Range.inSet(int candidate, String trueSet)

Return true if candidate is in the set specified by trueRange.

Example: Range.inRange()

The following example uses the Time.format function. This boolean function checks if the current day of the month is between 1 and 7. =Range.inRange(Time.format(Time.now('Europe/Berlin'), 'd'), '1-7').

Example: Range.inSet()

The following example uses the Time.format function. This boolean function checks if the current month is the first month of a quarter. =Range.inSet(Time.format(Time.now('Europe/Berlin'), 'M'), ' X__X__X__X__'). Note the leading space in trueRange to convert from the 1-based month to the 0-based trueRange.

String

Prefix:

Functions for working with Strings.

Function Name Signature Description
currentString.concat
String currentString.concat(String s1, ...)

Concatenate strings to currentString. Any number of other objects may be passed as arguments.

currentString.toString
String currentString.toString()

Convert currentString to a string.

currentString.charAt
String currentString.charAt(int pos)

Get character at pos in currentString. Note that the position is 0-based, the first character is at position 0.

currentString.indexOf
int currentString.indexOf(String searchFor, [int startIndex])

Get the first index of the string searchFor in currentString, optionally starting at startIndex (default=0).

currentString.lastIndexOf
int currentString.lastIndexOf(String searchFor, [int endIndex])

Get the last index of the string searchFor in the currentString, optionally ending at endIndex, defaults to end of string.

replace
*/ replace(String search, String replaceBy)

Replace search in the given currentString with replaceBy.

currentString.split
String[] currentString.split(String separator, int limit)

Split currentString into an array using the specified separator. Limit the length of the array to limit elements.

currentString.substring
String currentString.substring([int startIndex] [, int endIndex])

Get a substring of currentString, starting at startIndex and ending at endIndex - 1, thus returning a string of length endIndex - startIndex. If endIndex is not set, then the rest of the string will be returned.

currentString.toLowerCase
String currentString.toLowerCase()
Convert currentString to lower case.
currentString.toUpperCase
String currentString.toUpperCase()
Convert currentString to upper case
currentString.length
int currentString.length()

Get the length of currentString

getSystemId
String getSystemId()

Get the current system id.

currentString.contains
boolean currentString.contains()

Return if the string searchFor is contained in currentString.

currentString.startsWith
boolean currentString.startsWith()

Return if currentString starts with the string searchFor.

currentString.trim
String currentString.trim()

Return the currentString with all leading and trailing space removed.

Example: currentString.concat()

='Hello'.concat(' World', '!') Returns Hello World!.

Example: currentString.toString()

='123'.toString() Returns 123, it can be used as a string.

Example: currentString.charAt()

='Hello World!'.charAt(4) Returns o.

Example: currentString.indexOf()

='Hello World!'.indexOf('o') Returns 4.

='Hello World!'.indexOf('o', 5) Returns 7.

Example: currentString.lastIndexOf()

='Hello World!'.lastIndexOf('o') Returns 7.

='Hello World!'.lastIndexOf('o', 5) Returns 4.

Example: replace()

='abc def ghi'.replace('def', '123') Returns [abc 123 ghi].

Example: currentString.split()

='1 2 3 4 5 6 7 8 9 10'.split(' ', 5) Returns [1, 2, 3, 4, 5].

Example: currentString.substring()

='Hello World!'.substring(0) Returns Hello World!.

='Hello World!'.substring(6) Returns World!.

='Hello World!'.substring(1, 3) Returns el.

Example: currentString.toLowerCase()

='HeLLo WorLd!'.toLowerCase() Returns hello world!.

Example: currentString.toUpperCase()

='HeLLo WorLd!'.toUpperCase() Returns HELLO WORLD!.

Example: currentString.length()

='HeLLo WorLd!'.length() Returns 12.

Example: getSystemId()

=getSystemId() Returns redwood-university_test in this system.

Example: currentString.contains()

='Hello'.contains('l') Returns true.

='Hello'.contains('lol') Returns false.

Example: currentString.startsWith()

='Hello'.startsWith('He') Returns true.

='Hello'.startsWith('llo') Returns false.

Example: currentString.trim()

='Hello '.trim() Returns 'Hello'.

=' Hello'.trim() Returns 'Hello'.

=' Hello '.trim() Returns 'Hello'.

='Hel lo'.trim() Returns 'Hel lo'.

String

Prefix: String

Functions for use with Strings.

Functions in the String package for working with Strings.

Function Name Signature Description
concat
String String.concat(String instance, [String s1,] ...)

Concatenate strings to instance. Any number of other objects may be passed as arguments.

toString
String String.toString(String instance)

Convert instance to a string.

charAt
String String.charAt(String instance, int pos)

Get character at pos in instance.

indexOf
int String.indexOf(String instance, String searchFor, [int startIndex])

Get the first index of the string searchFor in instance, optionally starting at startIndex (default=0).

lastIndexOf
int String.lastIndexOf(String instance, String searchFor, [int startIndex])

Get the last index of the string searchFor in the instance, optionally starting at startIndex (default=0).

replace
String String.replace(String input, String search, String replaceBy)

Replace search in the given input with replaceBy.

split
String[] String.split(String instance, String separator, int limit)

Split instance into an array using the specified separator. Limit the length of the array to limit elements.

substring
String String.substring(String instance, [int startIndex] [, int endIndex])

Get a substring of instance, starting at startIndex and ending at endIndex - 1, thus returning a string of length endIndex - startIndex. If endIndex is not set, then the rest of the string will be returned.

toLowerCase
String String.toLowerCase(String instance)

Convert instance to lower case.

toUpperCase
String String.toUpperCase(String instance)

Convert instance to upper case

length
int String.length(String instance)

Get the length of instance

getSystemId
String String.getSystemId()

Get the current system id.

contains
boolean String.contains(String instance, String searchFor)

Return if the string searchFor is contained in instance.

startsWith
boolean String.startsWith(String instance, String searchFor)

Return if the instance starts with the string searchFor.

trim
String String.trim(String instance)

Return the instance with all leading and trailing space removed.

Example: String.concat()

=String.concat(Time.now('Europe/Paris'), ', Rue Toulouse-Lautrec') Returns 2024/08/01 13:08:36,946 Europe/Paris, Rue Toulouse-Lautrec.

Example: String.toString()

=String.toString(123) Returns 123 as a String.

Example: String.charAt()

=String.charAt('Hello John', 4) Returns o.

Example: String.indexOf()

=String.indexOf('Hello', 'l', '3') Returns 3.

Example: String.lastIndexOf()

=String.lastIndexOf('Hello', 'l', '3') Returns 3.

Example: String.replace()

=String.replace('abc def ghi', 'def', '123') Returns [abc 123 ghi].

Example: String.split()

=String.split('Some people like', ' ', '3') Returns [Some, people, like].

Example: String.substring()

=String.substring('like it on ice', 8, 14) Returns on ice.

Example: String.toLowerCase()

=String.toLowerCase('but I like it dry.') Returns but i like it dry..

Example: String.toUpperCase()

=String.toUpperCase('I like it dry.') Returns I LIKE IT DRY..

Example: String.length()

=String.length('but I like it dry.') Returns 18.

Example: String.getSystemId()

=String.getSystemId() Returns redwood-university_test on this system.

Example: String.contains()

=String.contains('Hello', 'l') Returns true.

=String.contains('Hello', 'lol') Returns false.

Example: String.startsWith()

=String.startsWith('Hello', 'He') Returns true.

=String.startsWith('Hello', 'llo') Returns false.

Example: String.trim()

=String.trim('Hello ') Returns 'Hello'.

=String.trim(' Hello') Returns 'Hello'.

=String.trim(' Hello ') Returns 'Hello'.

=String.trim('Hel lo') Returns 'Hel lo'.

Time

Prefix: Time

Time expressions are a sequence of operations, applied in order to a time (generally now, but may be a specified date). They may be:

  • set <specifier> <value> - set <specifier> to <value>
  • add <value> <specifier> - add <value> to <specifier> (This may propagate)
  • subtract <value> <specifier> - subtract <value> from <specifier> (This may propagate)
  • truncate <specifier> - truncate at <specifier> (This will zero everything below <specifier>).

The <value> is always a number:

  • The days of the week start at 1 for Sunday.
  • The days of the year start at 1 for 1 January.

The <specifier> is one of:

  • add/subtract: second, minute, hour, day, week, month, year
  • truncate: second, minute, hour, day, month
  • set: second, minute, hour, day, day_of_week, day_of_year, week_of_month, month

Plurals with an additional 's' are accepted (eg. days, weeks, ...). The day is always the day of the month. English names are accepted for day of week (day_of_week) and month; for example set day_of_week Monday or set month January, three letter abbreviations are accepted as well.

  • add 1 minute
  • add 3 seconds
  • set hour 1
  • set day_of_week Mon
  • truncate day
  • subtract 2 days

The time zone used by default is the JVM time zone. The examples use the Europe/Amsterdam time zone by default.

Function Name Signature Description
now
DateTimeZone Time.now([String timeZoneName])

Return the time in the context time zone (generally the time zone of the job). This can be optionally overridden by specifying the Olson name of a time zone as timeZoneName.

expression
DateTimeZone Time.expression(Object date, String expression)

Apply time expression expression to the date specified. This returns a new DateTimeZone Object so the original input date is not changed.

expressionNow
DateTimeZone Time.expressionNow(String expression)

Apply time expression expression to the current time.

isTimeWindowOpenNow
boolean Time.isTimeWindowOpenNow(String timeWindow)

Return true if the time window timeWindow is open now, false otherwise.

isTimeWindowOpen
boolean Time.isTimeWindowOpen(Object date, String timeWindow)

Return true if the time window timeWindow is open on the specified date, false otherwise. In a JobDefinition or JobChain, you can specify $ as a partition in your REL expression; this will be replaced by the partition of the JobDefinition or JobChain. This is especially helpful in combination with the Promotion module, as long as you keep the objects referencing themselves in one partition. Ensure the time window exists in the partition before you use the job definition or job chain.

Example: Time.now()

=Time.now() Returns the current time with time zone.

Example: Time.expression()

=Time.expression(Time.now('Europe/Amsterdam'), 'add 1 day') Returns tomorrow, Europe/Amsterdam time.

Example: Time.expressionNow()

=Time.expressionNow('truncate day') Returns 2024/08/01 00:00:00,000 Europe/Amsterdam.

Example: Time.isTimeWindowOpenNow()

=Time.isTimeWindowOpenNow('GLOBAL.System_Week_Monday') - boolean functions which returns true if today is Monday.

Example: Time.isTimeWindowOpen()

=Time.isTimeWindowOpen(Time.expressionNow('subtract 1 day'), 'GLOBAL.System_Week_Monday') - boolean function which returns true if today is Tuesday .

=Time.isTimeWindowOpen(Time.expressionNow('truncate day add 3 hours add 25 minutes'), '$.SomeTimeWindow') - this example illustrates the use of the $ identifier for the partition.

Range - Extended

Prefix: Range

Extended Range function with notification.

Function Name Signature Description
inRangeWarning
boolean Range.inRangeWarning(int candidate, String trueRange, String warningRange, int severity, String message)

Return true if candidate is in the range specified by trueRange. Return true, but log a warning operator message if candidate is in the range warningRange. The operator message is specified by the message and severity parameters.

Example: Range.inRangeWarning()

=Range.inRangeWarning(52, '10-50', '51-100', 50, 'Warning: range exceeded') Returns true and creates an operator message.

Repository - Extended

Prefix: Repository

Functions for accessing the data model.

Function Name Signature Description
getSystemId
String Repository.getSystemId()

Get the current system id.

getParentJobId
String Repository.getParentJobId(String jobId)

Get the parent job id of the specified job id, or null if the job id is null or its parent is null.

queryHTMLTable
int Repository.queryHTMLTable(String query [, Object [] bindVariables])

Produce HTML output on stdout for the query query with optional bind variables bindVariables. Bind variable place holders are specified as ? in the query.

queryCSV
int Repository.queryCSV(String query [, Object [] bindVariables])

Produce CSV output on stdout for the query query with optional bind variables bindVariables. Bind variable place holders are specified as ? in the query.

Example: Repository.getSystemId()

=Repository.getSystemId() Returns redwood-university_test on this system.

Example: Repository.getParentJobId()

=Repository.getParentJobId('27') Returns 21 on this system.

Example: Repository.queryHTMLTable()

=Repository.queryHTMLTable('select Job.Description from Job where Job.JobId = 21') Returns My Job on this system.

Example: Repository.queryCSV()

=Repository.queryCSV('select Job.Description from Job where Job.JobId = 21') Returns My Job on this system.

Time - Extended

Prefix: Time

Advanced time functions.

In previous releases, you used sysdate and systimestamp to retrieve the current date and date-time-offset, respectively. You can use the following REL functions to retrieve the data:

  • sysdate - =Time.format(Time.now(), 'dd-MM-yyyy')
  • systimestamp - =Time.format(Time.now(), 'dd-MM-yyyy hh.mm.ss.SSS a XXXXX')

The time zone used by default is the JVM time zone. The examples use the Europe/Amsterdam time zone by default.

Function Name Signature Description
isDayOfWeekInSetNow
boolean Time.isDayOfWeekInSetNow(String weekSet)

Is the current day of the week in weekSet.

isDayOfWeekInSet
boolean Time.isDayOfWeekInSet(Object date, String weekSet)

Is the day of the week of date in the set weekSet.

isDayInRangeNow
boolean Time.isDayInRangeNow(String dayRange)

Is the current day of the month in the range dayRangeSet.

isDayInRange
boolean Time.isDayInRange(Object date, String dayRange)

Is the day of the month of date in the range dayRangeSet.

isLastDayInMonthNow
boolean Time.isLastDayInMonthNow()

Is it currently the last day of the month?

isLastDayInMonth
boolean Time.isLastDayInMonth(Object date)

Is the date specified the last day of that month?

isMonthInSetNow
boolean Time.isMonthInSetNow(String monthSet)

Is the month of the current date in the set monthSet?

isMonthInSet
boolean Time.isMonthInSet(Object date, String monthRange)

Is the month of the specified date in the range monthRange?

format
String Time.format(Object date, String format)

Format the date according to the specified Simple Date Format in the default locale.

formatLocale
String Time.formatLocale(Object date, String format, String localeName)

Format the date according to the specified Simple Date Format, in the specified locale. The locale is language[_country[_variant]].

For example 'en' for English, fr_CA for French (Canada), or TH_TH_th (Thai with Thai Digits).
formatDuration
String Time.formatDuration(BigDecimal duration)
Format a duration in milliseconds using the standard format: |1 week, |# weeks, |1 day, |# days, |#|:#|:#|.#
formatDurationEx
String Time.formatDurationEx(BigDecimal duration, String format)
Format a duration using a custom format. The format is specified as: |1 week, |# weeks, |1 day, |# days, |#|:#|:#|.#| The first element is used for 1 week. The second element is used for n weeks, where n > 1. The third element is used for 1 day. The fourth element is used for n days, where n > 1. The fifth element is used for hours. The sixth element is used for minutes. The seventh element is used for seconds. The eighth element is used for milliseconds. In all elements but the first and third, # is replaced with the actual number. If an element is empty it is omitted. If the first element is empty, weeks are not printed and days may be greater than 7. If the third element is empty, days are not printed and hours may be greater than 24. If the first and third elements are empty, neither weeks nor days are printed and hours may be greater than 168 (24 * 7).
getUTCMillisecondsNow
BigDecimal Time.getUTCMillisecondsNow()

Get the number of milliseconds since midnight on January 1 1970 for the current time.

getUTCMilliseconds
BigDecimal Time.getUTCMilliseconds(Object date)

Get the number of milliseconds since midnight on January 1 1970 for the specified time.

formatNow
String Time.formatNow(String format)

Format the current date according to the specified Simple Date Format.

parse
DateTimeZone Time.parse(Object string, String format)

Parse the string into a date according to the specified Simple Date Format.

nextTimeWindowOpeningNow
DateTimeZone Time.nextTimeWindowOpeningNow(String timeWindow)

Next opening of timeWindow after now. In a JobDefinition or JobChain, you can specify $ as a partition in your REL expression; this will be replaced by the partition of the definition or chain. This is especially helpful in combination with the Promotion module, as long as you keep the objects referencing themselves in one partition. Ensure the time window exists in the partition before you use the JobDefinition or JobChain.

nextTimeWindowOpening
DateTimeZone Time.nextTimeWindowOpening(Object date, String timeWindow)

Next opening of timeWindow after the specified date. In a JobDefinition or JobChain, you can specify $ as a partition in your REL expression; this will be replaced by the partition of the JobDefinition or JobChain. This is especially helpful in combination with the Promotion module, as long as you keep the objects referencing themselves in one partition. Ensure the time window exists in the partition before you use the JobDefinition or JobChain.

nextTimeWindowClosingNow
DateTimeZone Time.nextTimeWindowClosingNow(String timeWindow)

Next closing of timeWindow after now.

nextTimeWindowClosing
DateTimeZone Time.nextTimeWindowClosing(Object date, String timeWindow)

Next closing of timeWindow after the specified date. Note that you can only call this function on currently open time windows.

addOpenDays
DateTimeZone Time.addOpenDays(Object date, String timeWindow, int days)

Adds a number of days to a date according to the given time window.

addOpenDaysFromNow
DateTimeZone Time.addOpenDaysFromNow(String timeWindow, int days)

Adds a number of days to the current date according to the given time window.

Example: Time.isDayOfWeekInSetNow()

=Time.isDayOfWeekInSetNow('_X_X_X_') Returns true if the current day is Monday, Wednesday, or Friday.

Example: Time.isDayOfWeekInSet()

=Time.isDayOfWeekInSet(Time.now('Europe/Paris'), '_X_X_X_') Returns true if the day falls on a Monday, Wednesday, or Friday.

Example: Time.isDayInRangeNow()

=Time.isDayInRangeNow('4-7') Returns true if the current day of the month is between 4 and 7.

Example: Time.isDayInRange()

=Time.isDayInRange(Time.now('Europe/Bratislava'), '4-7') Returns true if the day of the month in the time expression is between 4 and 7.

Example: Time.isLastDayInMonthNow()

=Time.isLastDayInMonthNow() Returns true if the current day is the last day of the month.

Example: Time.isLastDayInMonth()

=Time.isLastDayInMonth(Time.expressionNow('add 2 days')) - return true if the current day is two days before the end of the month.

Example: Time.isMonthInSetNow()

=Time.isMonthInSetNow('_X_X_X_X_X_X') - return true if the current month has an even number.

Example: Time.isMonthInSet()

=Time.isMonthInSet(Time.expression(Time.now(), 'add 1 month'), '_X_X_X_X_X_X') - return true if the current month has an uneven number.

Example: Time.format()

=Time.format(Time.now(), 'yyyy-MM-dd') Returns the date in the yyyy-MM-dd format, as in 2024-08-14.

Example: Time.formatLocale()

=Time.formatLocale(Time.now(), 'yyyy-MM-dd', 'de_DE') Returns the date in the yyyy-MM-dd format, as in 2024-08-14 using the German/Germany locale.

Example: Time.formatDuration()

=Time.formatDuration(100000) Returns 0:01:40.000.

Example: Time.formatDurationEx()

=Time.formatDurationEx(10000000000, '|1 week, |# weeks, |1 day, |# days, |#|:#|:#|.#|') Returns 16 weeks, 3 days, 17:46:40.000.

=Time.formatDurationEx(10000000000, '|1 semaine, |# semaines, |1 jour, |# jours, |#|:#|:#|.#|') Returns 16 semaines, 3 jours, 17:46:40.000.

=Time.formatDurationEx(10000000000, '|||1 day,|# days, |#|:#|:#|.#|') Returns 115 days, 17:46:40.000.

=Time.formatDurationEx(10000000000, '||||# days, |#|:#|:#|.#|') Returns 2777:46:40.000, which is the duration in hours, minutes, seconds, and milliseconds. The first and third elements were empty, causing the second which was empty and the fourth which was # days, to be discarded.

Example: Time.getUTCMillisecondsNow()

=Time.getUTCMillisecondsNow() Returns the milliseconds since January 1 1970, for example 1709323964 on 2024/03/02 01:42:44 Europe/Amsterdam.

Example: Time.getUTCMilliseconds()

=Time.getUTCMilliseconds(Time.now()) Returns the milliseconds since January 1 1970, for example 1709323964 on 2024/03/02 01:42:44 Europe/Amsterdam.

Example: Time.formatNow()

=Time.formatNow('yyyyMMddhhmmss') Returns 20240302014244.

Example: Time.parse()

=Time.parse('20240302014244', 'yyyyMMddhhmmss') Returns 2024/03/02 01:42:44 Europe/Amsterdam.

Example: Time.nextTimeWindowOpeningNow()

=Time.nextTimeWindowOpeningNow('GLOBAL.System_Week_Thursday') Returns 2024/03/07 00:00:00,000 Europe/Amsterdam.

=Time.nextTimeWindowOpeningNow('$.SomeTimeWindow') Returns 2024/03/02 00:00:00,000 Europe/Amsterdam.

Example: Time.nextTimeWindowOpening()

=Time.nextTimeWindowOpening(Time.parse('20240302014244', 'yyyyMMddhhmmss'), 'GLOBAL.System_Week_Thursday') Returns 2024/03/07 00:00:00,000 Europe/Amsterdam .

Example: Time.nextTimeWindowClosingNow()

=Time.nextTimeWindowClosingNow('GLOBAL.System_Week_Sat') Returns 2024-03-03 00:00:00,000 Europe/Amsterdam.

Example: Time.nextTimeWindowClosing()

=Time.nextTimeWindowClosing(Time.parse('20240302014244', 'yyyyMMddhhmmss'), 'GLOBAL.System_Week_Sat') Returns 2024-03-03 00:00:00,000 Europe/Amsterdam.

Example: Time.addOpenDays()

Example: Time.addOpenDaysFromNow()

=Time.addOpenDaysFromNow('System_Week_WorkDays', 10) Returns the date with 10 added days to the current date according to the time window 'System_Week_WorkDays'.

Constraint

Prefix: Constraint

The following methods are used in the ''Simple Constraint Data'' field, the simple constraint type must be set to ''Expression''.

Function Name Signature Description
listConstraint
boolean Constraint.listConstraint(String title, String list[, boolean valid[, String separator]])

Create a dropdown list with a list of values.

The mandatory first parameter (title) is a title. For this type of constraint only one title is needed.

The mandatory second parameter (list) is a comma separated list of values, which will be presented as a drop down list during submit.

The optional third parameter (valid) is a boolean expression which says if the entered value is correct. You can use here the value variable for the value, entered by the user.

The optional fourth parameter (separator) is a String, which is a regular expression to split the elements in the list. By default it is a comma (,)

When you do not supply the third parameter, or it is null, then only values from this list are allowed to be entered.

pairListConstraint
boolean Constraint.pairListConstraint(String titles, String list[, boolean valid])

Create a dropdown list with a list of values.

The mandatory first parameter (titles) is a, comma separated, list of titles. For this type of constraint only two titles are needed.

The mandatory second parameter (list) is a comma separated list of value=description pairs, which will be presented as a drop down list during submit.

The optional third parameter (valid) is a boolean expression which says if the entered value is correct. You can use here the value variable for the value, entered by the user. When you do not supply the third parameter, or it is null, then only values from this list are allowed to be entered.

Example: Constraint.listConstraint()

=Constraint.listConstraint('Country', 'de,nl,gt', value !== '') This will show a drop down list with the values de, gt and nl. However you can fill in any non-empty value, e.g. also mx

=Constraint.listConstraint('Country', 'de,nl,gt') This will show a drop down list with the values de, gt and nl. You can only choose values from this list.

=Constraint.listConstraint('Ciphers or letters', '1,2,3,...|a,b,c,...', null, '\\|') This will show a drop down list with the values 1,2,3,... and a,b,c,.... Note, the commas in the values. Also note, that the bar here is a special character in regular expressions and therefore it needs to be escaped with two slashes. You can only choose values from this list.

Example: Constraint.pairListConstraint()

=Constraint.pairListConstraint('Country, Code', 'de=49,nl=31,gt=502', value !== '').

This will show a drop down list, like

Country Code
de 49
gt 502
nl 31

However, you can fill in any non-empty value, e.g. also mx.

=Constraint.pairListConstraint('Country Code, Country', 'de=Deutschland,nl=Nederland,gt=Guatemala') .

This will show a drop down list, like

Country Code
de Deutschland
gt Guatemala
nl Nederland

You can only choose one of the the values de, nl, or gt.

=Constraint.pairListConstraint('Code|Various symbols', 'C:1,2,3,...|L:a,b,c,...|O:=-*+/', null, '\\|', ':') .

This will show a drop down list, like:

Code Various symbols
C 1,2,3,...
L a,b,c,...
O =-*+/|

Note, the commas and equal sign in the values. Also note, that the bar here is a special character in regular expressions and therefore it needs to be escaped with two slashes. You can only choose values from this list.

Credential

Prefix: Credential

Function Name Signature Description
getProtectedPasswordByProtocolRealUser
String Credential.getProtectedPasswordByProtocolRealUser(String partition, String credentialProtocol, String endpoint, String realUser)

Obtain encrypted credential if present and accessible.

getProtectedPasswordByProtocolVirtualUser
String Credential.getProtectedPasswordByProtocolVirtualUser(String partition, String credentialProtocol, String endpoint, String virtualUser)

Obtain encrypted credential if present and accessible.

getProtectedPassword
String Credential.getProtectedPassword(String endpoint, String realUser)

Obtain encrypted credential for the default partition and login protocol, if present and accessible.

Example: Credential.getProtectedPasswordByProtocolRealUser()

=Credential.getProtectedPasswordByProtocolRealUser('GLOBAL', 'login', 'host', 'root') or.

=Credential.getProtectedPasswordByProtocolRealUser('$', 'login', 'host', 'root') where '$' represents the partition of the Process Definition the parameter is in.

Example: Credential.getProtectedPasswordByProtocolVirtualUser()

=Credential.getProtectedPasswordByProtocolVirtualUser('GLOBAL', 'login', 'host', 'appowner').

Example: Credential.getProtectedPassword()

=Credential.getProtectedPassword('host', 'root').

Functions for working with Events.

Event

Prefix: Event

Function Name Signature Description
isEventRaised
boolean Event.isEventRaised(String name)

Get the status of an event.

Example: Event.isEventRaised()

=Event.isEventRaised('MyPartition.MyEvent') Returns true on this system as the event is currently raised.

JDBC

Prefix: JDBC

Function Name Signature Description
clearCache
String JDBC.clearCache()

Clears the result cache. It always returns an empty String.

constraint
boolean JDBC.constraint()

Create a constraint, with LOV support, based on a query on database tables/views.

The first parameter is string with connection info, in the form [user=<user>] [endpoint=<endpoint>] [cache=[<number>[s|m|h|d|w|M|y]\]], where <user> is the database user to connect with and <endpoint> the name of the database object for the database to connect to. When the cache keyword is used, caching of the results is used. The optional time specification is a number in seconds (default or when suffixed by 's'), minutes ('m'), hours ('h'), days ('d'), weeks ('w'), months ('M') or years ('y'). This time specification means that the cached result is not allowed to be older than specified. Thus the maximum cache age is not defined by the setter, but by the getter of the cache result!

The second parameter is the query as a String.

The rest of the parameters are optional bind variables. Bind variable place holders are specified as ? in the expression.

query
Object JDBC.query()

Execute a database query and return the first column from the first row.

The first parameter is string with connection info, in the form [user=<user>] [endpoint=<endpoint>] [cache=[<number>[s|m|h|d|w|M|y]\]], where <user> is the database user to connect with and <endpoint> the name of the database object for the database to connect to. When the cache keyword is used, caching of the results is used. The optional time specification is a number in seconds (default or when suffixed by 's'), minutes ('m'), hours ('h'), days ('d'), weeks ('w'), months ('M') or years ('y'). This time specification means that the cached result is not allowed to be older than specified. Thus the maximum cache age is not defined by the setter, but by the getter of the cache result!

The second parameter is the query as a String.

The rest of the parameters are optional bind variables. Bind variable place holders are specified as ? in the query.

Example: JDBC.clearCache()

Example: JDBC.constraint()

=JDBC.constraint('user=scott endpoint=xe', 'select name "City", state "State/province" from cities where country = ?', parameters.Country) - Implements a constraint, showing two columns. The first column has the title "City", the second column has the title "State/province". The data in the drop down list is a list of cities from the country as defined in the parameter Country, where the data comes from the database table cities. The actual value that is chosen is the city. The other column is only informational.

Example: JDBC.query()

  • =JDBC.query('user=scott endpoint=xe', 'select global_name from global_name where rownum <= ?', 1) - returns the global name of the Oracle database. Do not use a cached value of the result.
  • =JDBC.query('user=scott endpoint=xe cache=0', 'select global_name from global_name where rownum <= ?', 1) - returns the global name of the Oracle database. Do not use a cached value of the result, but do cache the result for a next time.
  • =JDBC.query('user=scott endpoint=xe cache=60', 'select global_name from global_name where rownum <= ?', 1) Returns the global name of the Oracle database. Do use a cached value of the result, but only when the cached value is not older than 60 seconds.
  • =JDBC.query('user=scott endpoint=xe cache=1m', 'select global_name from global_name where rownum <= ?', 1) - returns the global name of the Oracle database. Do use a cached value of the result, but only when the cached value is not older than 1 minute.
  • =JDBC.query('user=scott endpoint=xe cache', 'select global_name from global_name where rownum <= ?', 1) Returns the global name of the Oracle database. Do use a cached value of the result, but only when the cached value is not older than the number of seconds as specified in the registry key /configuration/REL/JDBC/DefaultMaxCacheAge.

JobChainParameters

Prefix: JobChainParameters

Job chain job names take the form Step name, job job number. For example: Step 2, job 3 or Data load, job 2. This expression is not zero-based, so the first job is Job 1.

Function Name Signature Description
getOutValueString
String JobChainParameters.getOutValueString(String jobName, String parameterName)

Get the value of the String output parameter parameterName of the job named jobName in the current job chain.

When you create a step, add two jobs to it and then delete the first job (Job 1), the second job will become Step 1, Job 1. This means that when you delete a job, you must verify your Relative Job expressions.

getOutValueNumber
BigDecimal JobChainParameters.getOutValueNumber(String jobName, String parameterName)

Get the value of the Number output parameter parameterName of the job named jobName in the current job chain.

getOutValueDate
DateTimeZone JobChainParameters.getOutValueDate(String jobName, String parameterName)

Get the value of the Date output parameter parameterName of the job named jobName in the current job chain.

getOutValueArray
Object[] JobChainParameters.getOutValueArray(String jobName, String parameterName)

Get the value of the Array output parameter parameterName of the job named jobName in the current job chain.

getInValueString
String JobChainParameters.getInValueString(String jobName, String parameterName)

Get the value of the String input parameter parameterName of the job named jobName in the current job chain.

getInValueNumber
BigDecimal JobChainParameters.getInValueNumber(String jobName, String parameterName)

Get the value of the Number input parameter parameterName of the job named jobName in the current job chain.

getInValueDate
DateTimeZone JobChainParameters.getInValueDate(String jobName, String parameterName)

Get the value of the Date input parameter parameterName of the job named jobName in the current job chain.

getInValueArray
Object[] JobChainParameters.getInValueArray(String jobName, String parameterName)

Get the value of the Array input parameter parameterName of the job named jobName in the current job chain.

getJobId
Long JobChainParameters.getJobId(String jobName)

Get the job id of the job named jobName in the current job chain.

getJobStatus
String JobChainParameters.getJobStatus(String jobName)

Get the job status of the job named jobName in the current job chain.

getJobReturnCode
Long JobChainParameters.getJobReturnCode(String jobName)

Get the job return code of the job named jobName in the current job chain.

getJobFilePath
String JobChainParameters.getJobFilePath(String jobName, String jobFileName)

Get the full path of the job file with short name jobFileName on the job named jobName in the current job chain.

jobFileExists
boolean JobChainParameters.jobFileExists(String jobName, String jobFileName)

Returns if a job file with short name jobFileName on the job named jobName in the current job chain exists and can be read.

Example: JobChainParameters.getOutValueString()

=JobChainParameters.getOutValueString('Step 1, Job 1', 'Parameter') Returns the String Out value of the parameter named "Parameter" of the first job (Job 1) in step Step 1.

Example: JobChainParameters.getOutValueNumber()

=JobChainParameters.getOutValueNumber('Step 1, Job 1', 'Parameter') Returns the Number Out value of the parameter named "Parameter" of the first job (Job 1) in step Step 1.

Example: JobChainParameters.getOutValueDate()

=JobChainParameters.getOutValueDate('Step 1, Job 1', 'Parameter') Returns the Date Out value of the parameter named "Parameter" of the first job (Job 1) in step Step 1.

Example: JobChainParameters.getOutValueArray()

=JobChainParameters.getOutValueArray('Step 1, Job 1', 'Parameter') Returns the Array Out value of the parameter named "Parameter" of the first job (Job 1) in step Step 1.

Example: JobChainParameters.getInValueString()

=JobChainParameters.getInValueString('Step 1, Job 1', 'Parameter') Returns the String In value of the parameter named "Parameter" of the first job (Job 1) in step Step 1.

Example: JobChainParameters.getInValueNumber()

=JobChainParameters.getInValueNumber('Step 1, Job 1', 'Parameter') Returns the Number In value of the parameter named "Parameter" of the first job (Job 1) in step Step 1.

Example: JobChainParameters.getInValueDate()

=JobChainParameters.getInValueDate('Step 1, Job 1', 'Parameter') Returns the Date In value of the parameter named "Parameter" of the first job (Job 1) in step Step 1.

Example: JobChainParameters.getInValueArray()

=JobChainParameters.getInValueArray('Step 1, Job 1', 'Parameter') Returns the Array In value of the parameter named "Parameter" of the first job (Job 1) in step Step 1.

Example: JobChainParameters.getJobId()

=JobChainParameters.getJobId('Step 1, Job 1') Returns the job id of the first job (Job 1) of the step Step 1.

Example: JobChainParameters.getJobStatus()

=JobChainParameters.getJobStatus('Step 2, Job 1') Returns the job status of the first job (Job 1) of the step Step 2.

Example: JobChainParameters.getJobReturnCode()

=JobChainParameters.getJobReturnCode('Step 2, Job 1') Returns the job return code of the first job (Job 1) of the step Step 2.

Example: JobChainParameters.getJobFilePath()

=JobChainParameters.getJobFilePath('Step 1, Job 1', 'stdout.log') Returns the path to the output file of the first job (Job 1) of the step Step 1.

Example: JobChainParameters.jobFileExists()

=JobChainParameters.jobFileExists('Step 1, Job 1', 'stdout.log') Returns true if the output file of the first job (Job 1) of the step Step 1 exists and can be read.

Logic

Prefix: Logic

Function Name Signature Description
case
String Logic.case(String expression[, String match1, String result1,] ... [ String matchN, String resultN] [, String resultNoMatch] )

Run and map an expression. Execute the expression, if the result matches matchN return resultN, otherwise return resultNoMatch.

if
String Logic.if(String expression, String trueValue, String falseValue)

Run an expression and return trueValue if it is true, otherwise falseValue. This function does not support else, if you want to use else, use ''Logic.case'' instead.

nvl
String Logic.nvl(String o, String nullValue)

If the first argument is not null, return it, otherwise return the second argument.

Example: Logic.keyword_case()

=Logic.case(getSystemId(), 'redwood-university_test', 'test', 'redwood-university_prod', 'prod', 'Not Matched') Returns test on this system.

Example: Logic.keyword_if()

=Logic.if(getSystemId() === 'redwood-university_test', 'test', 'Not Matched') Returns test on this system.

Example: Logic.nvl()

=Logic.nvl(getSystemId(), 'Not null') Returns redwood-university_test on this system.

Loop

Prefix: Loop

Function Name Signature Description
getString
String Loop.getString(String columnName)

Retrieve a String value for the named table column.

getBigDecimal
BigDecimal Loop.getBigDecimal(String columnName)

Retrieve a BigDecimal value for the named table column.

getDate
DateTimeZone Loop.getDate(String columnName)

Retrieve a DateTimeZone value for the named table column.

formatBigDecimal
String Loop.formatBigDecimal(String columnName, String outputFormat)

Retrieve and format a value for the named table column, using the specified formatting. The column may be of any type, but needs to be parseable as a BigDecimal.

formatDate
String Loop.formatDate(String columnName, String dateFormat)

Retrieve and format a value for the named table column, using the specified formatting. The column may be of any type, but needs to be parseable as a DateTimeZone.

reformatStringAsBigDecimal
String Loop.reformatStringAsBigDecimal(String columnName, String inputFormat, String outputFormat)

Retrieve the string value of a column, parse it using the input format and format it using the output format. The column is assumed to be a number in a string column.

reformatStringAsDate
String Loop.reformatStringAsDate(String columnName, String inputFormat, String outputFormat)

Retrieve the string value of a column, parse it using the input format and format it using the output format. The column is assumed to be a date in a string column.

Example: Loop.getString()

=Loop.getString('symbol') Returns the value of the column named symbol as a String.

Example: Loop.getBigDecimal()

=Loop.getBigDecimal('price') Returns the value of the column named price as a BigDecimal.

Example: Loop.getDate()

=Loop.getString('date') Returns the value of the column named date as a DateTimeZone.

Example: Loop.formatBigDecimal()

=Loop.formatBigDecimal('price', '$#.00') - retrieves the value of the column named price as a BigDecimal and formats it as specified and returns it as a String.

Example: Loop.formatDate()

=Loop.formatDate('date', 'dd-MM-yyyy') - retrieves the value of the date column named date, formats it using dd-MM-yyyy and returns it as a String.

Example: Loop.reformatStringAsBigDecimal()

=Loop.reformatStringAsBigDecimal('price', '$#.00', '#,00') - retrieves the value of the column named price parses it using $#.00 and formats it using #,00 and returns it as a String.

Example: Loop.reformatStringAsDate()

=Loop.reformatStringAsDate('date', 'yyyy-MM-dd', 'dd-MM-yyyy') - retrieves the value of the string column named date, parses it using yyyy-MM-dd, formats it using dd-MMM-yyyy, and returns it as a String.

%none%

Prefix:

Provides the possibility to call getMember on ScriptObjects with REL if supported.

Function Name Signature Description
getMember
Object getMember()

Gets the value from a member of a ScriptObject.

Example: getMember()

=columns.getMember('Price in EUR') - returns the value of the column 'Price in EUR'.

PLSQL

Prefix: PLSQL

Function Name Signature Description
booleanExpr
Boolean PLSQL.booleanExpr()

Evaluate a boolean PL/SQL expression in an Oracle database.

The first parameter is string with connection info, in the form [user=<user>] [endpoint=<endpoint>] [cache=[<number>[s|m|h|d|w|M|y]\]], where <user> is the database user to connect with and <endpoint> the name of the database object for the database to connect to. When the cache keyword is used, caching of the results is used. The optional time specification is a number in seconds (default or when suffixed by 's'), minutes ('m'), hours ('h'), days ('d'), weeks ('w'), months ('M') or years ('y'). This time specification means that the cached result is not allowed to be older than specified. Thus the maximum cache age is not defined by the setter, but by the getter of the cache result!

The second parameter is the boolean PL/SQL expression as a String.

The rest of the parameters are optional bind variables. Bind variable place holders are specified as ? in the expression.

dateExpr
DateTimeZone PLSQL.dateExpr()

See booleanExpr

numberExpr
BigDecimal PLSQL.numberExpr()

See booleanExpr

stringExpr
String PLSQL.stringExpr()

See booleanExpr

Example: PLSQL.booleanExpr()

  • =PLSQL.booleanExpr('user=scott endpoint=xe', '? > 0', 1) Returns true. Do not use a cached value of the result.
  • =PLSQL.booleanExpr('user=scott endpoint=xe cache=0', '? > 0', 1) Returns true. Do not use a cached value of the result, but do cache the result for a next time.
  • =PLSQL.booleanExpr('user=scott endpoint=xe cache=60', '? > 0', 1) Returns true. Do use a cached value of the result, but only when the cached value is not older than 60 seconds.
  • =PLSQL.booleanExpr('user=scott endpoint=xe cache=1m', '? > 0', 1) Returns true. Do use a cached value of the result, but only when the cached value is not older than 1 minute.
  • =PLSQL.booleanExpr('user=scott endpoint=xe cache', '? > 0', 1) Returns true. Do use a cached value of the result, but only when the cached value is not older than the number of seconds as specified in the registry key /configuration/REL/PLSQL/DefaultMaxCacheAge.
  • =PLSQL.booleanExpr('user=scott cache=1m', '? > ?', parameters.param1, parameters.param2) - compares two numbers defined in parameters param1 and param2. Note that this uses the System_Oracle endpoint (default)

Example: PLSQL.dateExpr()

Example: PLSQL.numberExpr()

Example: PLSQL.stringExpr()

Query

Prefix: Query

Functions for querying the data model.

Function Name Signature Description
getNumber
BigDecimal Query.getNumber(String query [, Object [] bindVariables [, String bindTypes]])

Get the first column of the first row of the query query with optional bind variables bindVariables. Bind variable place holders are specified as ? in the query.

On some databases it may be required to specify the type of the parameter, as the database will not convert to and from all types. If this is required, then for each parameter specify either a "s", for string, or an "n", for number. If a parameter type is not specified, then it will be passed as a string.

getString
String Query.getString(String query [, Object [] bindVariables [, String bindTypes]])

Get the first column of the first row of the query query with optional bind variables bindVariables. Bind variable place holders are specified as ? in the query.

On some databases it may be required to specify the type of the parameter, as the database will not convert to and from all types. If this is required, then for each parameter specify either a "s", for string, or an "n", for number. If a parameter type is not specified, then it will be passed as a string.

getRelativeJob
BigDecimal Query.getRelativeJob(String jobName)

Get the job id of the job named jobName in the current job chain.

Note that job chain job numbers are incremented and never changed. This means that when you create a step, add two jobs to it and then delete the first job, the second job will still remain Step 1, Job 1. Note that this function is 1-based and the job chain editor is zero-based. So Step 1, Job 1 will be displayed as Step 1, Job 0 in the job chain editor.

Example: Query.getNumber()

=Query.getNumber('select Job.JobId from Job where Job.Description=\'My Job\'') Returns 21 on this system. .

=Query.getNumber('select Job.ReturnCode from Job where Job.JobId = ?', [JobChainParameters.getJobId('Step 1,job 1')], 'n') Returns 0 on this system.

Example: Query.getString()

=Query.getString('select Job.Description from Job where Job.Queue in (select q.UniqueId from Queue q where q.Name=?) order by Job.JobId DESC', ['System']) Returns My Job on this system.

=Query.getString('select Job.Description from Job where Job.JobId=?', [parameters.JOBID]) Returns My Job on this system; note that the job has a JOBID parameter of type Number that holds the actual job id.

=Query.getString('select Job.Description from Job where Job.JobId=?', [parameters.JOBID], 'n') Returns My Job on this system; note that the job has a JOBID parameter of type String that holds the actual job id, so in this case casting is required.

=Query.getString('select Job.Description from Job where Job.JobId = ?', [Query.getRelativeJob('Step 1,job 1')], 'n') - First Job on this system.

Example: Query.getRelativeJob()

=Query.getRelativeJob('Step 1, Job 1') - get the job id of the first job of the job chain step named Step 1.

SAP

Prefix: SAP

Ranges are sent as a long string in the form [<sign><option><low><high>]+ where

  • <sign> is a single character I or E
  • <option> a select option, e.g. EQ, BT
  • <low> the low value of the range
  • <high> the high value of the range

All fields are always sent, regardless of the value of the <option>. If the value is shorter than the length of the field, it is padded with blanks.

Such ranges are known to be sent by Closing Cockpit.

Function Name Signature Description
convertJobParameterRangesToExpression
String SAP.convertJobParameterRangesToExpression(String jobName, String parameterName, int fieldLength)

Get the value of the String output parameter parameterName of the job named jobName in the current job chain.

Convert ranges to a selopt expression.

convertRangesToExpression
String SAP.convertRangesToExpression(String rangesString, int fieldLength)

Convert ranges to a selopt expression.

Example: SAP.convertJobParameterRangesToExpression()

=SAP.convertJobParameterRangesToExpression('Step 1, Job 1', 'Parameter', 32) Returns a select option.

Example: SAP.convertRangesToExpression()

=SAP.convertRangesToExpression('IBTAAZZ', 2) Returns AA - ZZ.

Table

Prefix: Table

Functions for querying a table.

You use the $ placeholder to specify the partition of the object you are editing, in job definitions and job chains.

Function Name Signature Description
getRow
String Table.getRow(String table, String key)

Retrieve the row of a table, all values are concatenated.

getColumnString
String Table.getColumnString(String tableName, String key, String column)

Retrieve a String value from a table.

getColumnNumber
BigDecimal Table.getColumnNumber(String table, String key, String column)

Retrieve a Number value from a table.

formatRow
String Table.formatRow(String table, String key, String rowStart, String columnFormat, String columnSeparator, String rowEnd)

Retrieve a row from a table and format it.

columnFormat accepts strings as well as the following substitution parameters to specify the position of the elements:

  • {0} - column header
  • {1} - value
  • {2} - columnSeparator (should always be the first)
l
String Table.l(Object[] parameters/*String partitionName, String tableName, String key, String columnName)

Short hand for lookup.

See lookup

lookup
String Table.lookup(Object[] parameters/*String partitionName, String tableName, String key, String columnName)

Retrieve the value of a column for a specified row in a table. If no partition is specified, the table is looked for in the GLOBAL partition.

Example: Table.getRow()

=Table.getRow('System_Variables', 2) Returns EMEA on this system.

Example: Table.getColumnString()

=Table.getColumnString('System_Variables', '2', 'SystemValue') Returns EMEA on this system.

Example: Table.getColumnNumber()

=Table.getColumnNumber('System_Variables', 'CCOP') Returns 13100 on this system.

Example: Table.formatRow()

=Table.formatRow('System_Variables', 2, '<row><entry>', '{1}', '</entry><entry>', '</entry></row>') Returns <row><entry>EMEA</entry></row> on this system.

=Table.formatRow('$.Countries', 49, '#', '{2}{0}={1}', '|', '#') Returns #Abbreviation=De|Conversion_Rate=1.0|Name=Germany|Translation=Deutschland# .

=Table.formatRow('$.Countries', 31, '<row><entry>', '{2}{1}', '</entry><entry>', '</entry></row>') - returns <row><entry>NL</entry><entry>1.0</entry><entry>The Netherlands</entry><entry>Nederland</entry></row>

Example: Table.l()

Example: Table.lookup()

=Table.lookup('PROD', 'CustomTable', 'Identifier10', 'ColumnA') Returns the value from the table 'CustomTable' (table is in partition 'PROD') from the row with key 'Identifier10', and from that row the value of 'ColumnA'.

=Table.lookup('CustomTable', 'Identifier10', 'ColumnA') Returns the value from the table 'CustomTable' (table is in partition 'GLOBAL', as partitionName is not specified) from the row with key 'Identifier10', and from that row the value of 'ColumnA'.

UserMessage

Prefix: UserMessage

Function Name Signature Description
renderHistoryAsHTML
String UserMessage.renderHistoryAsHTML(String userMessageId, String cssPrefix)

Render an HTML table with the history of a user message.

renderHistoryAsText
String UserMessage.renderHistoryAsText(String userMessageId)

Render a Text table with the history of a user message.

Example: UserMessage.renderHistoryAsHTML()

=UserMessage.renderHistoryAsHTML(parameters.UserMessage_UniqueId, 'aCssPrefix').

Example: UserMessage.renderHistoryAsText()

=UserMessage.renderHistoryAsText(parameters.UserMessage_UniqueId).

Variable

Prefix: Variable

Functions for querying the System_Variables table.

Function Name Signature Description
getString
String Variable.getString(String key)

Retrieve a String value from the System_Variables table.

getNumber
BigDecimal Variable.getNumber(String key)

Retrieve a Number from the System_Variables table.

Example: Variable.getString()

=Variable.getString('2') Returns EMEA on this system.

Example: Variable.getNumber()

=Variable.getNumber('CCOP') Returns 13100 on this system.

RedwoodScript Scripting Contexts and Implicit Objects

Scripting contexts are fields in which scripting with Redwood Expression Language may be used. The implicit objects provided differ between the contexts.

RedwoodExpressionLanguage Implicit Objects

This section lists the implicit objects by category, and what they contain.

Implicit object Description Class
parameters.<name> Value of parameter <name> of current job. Class depends on the type of parameter. Character, String, Number, Date, Time, DateTimeZone, Table, FileParameter
outParameters.<name> Value of Out parameter <name> of current job. Class depends on type of the parameter. Character, String, Number, Date, Time, DateTimeZone, Table, FileParameter
chainParameters.<name> Value of parameter <name> of inner-most job chain. Class depends on the type of parameter. Character, String, Number, Date, Time, DateTimeZone, Table, FileParameter
chainOutParameters.<name> Value of out parameter <name> of inner-most job chain. Class depends on the type of the parameter. Character, String, Number, Date, Time, DateTimeZone, Table, FileParameter
JobChainParameters.getOutValueString(<jobName>, <parameter>) The value of the Out parameter <parameter> of the job in chain (see placeholders below) String
JobChainParameters.getOutValueNumber(<jobName>, <parameter>) The value of the Out parameter <parameter> of the job in chain (see placeholders below) Number
JobChainParameters.getOutValueDate(<jobName>, <parameter>) The value of the Out parameter <parameter> of the job in chain (see placeholders below) Date
chainJobId job id of the inner-most chain (needs to be a runtime parameter) Number
jobId job id of the current job (needs to be a runtime parameter) Number
topLevelJobId job id of highest parent job in hierarchy (needs to be a runtime parameter) Number
returnCode return code of current job Number
stepIterations iteration number of the current step or job Number
waitEvents.<name>.finalPath the path of the file that raised event <name>(after move, if applicable) String
waitEvents.<name>.originalPath the path of the file that raised event <name> (before move, if applicable) String
waitEvents.<name>.raiserComment the comment of the raiser for event <name> String
waitEvents.<name>.raiserJobId the job id of the job that raised event<name> Long
$.name the partition of the object named name. The $ variable will be filled with the partition of the job definition or job chain on which it is specified String

The placeholders for the JobChainParameters.getOutValue methods are as follows:

  • <jobName> - the name of the job, for example:
    • Step 1, Job 2
    • Extract data, Job 4
  • <parameter> - the name of the parameter

Example

The following example returns the Out value of parameter Param1 on Job number 4 of step Extract data in the chain.

=JobChainParameters.getOutValueString('Extract data, Job 4', 'Param1')

Partition Placeholder

The $ placeholder is replaced with the partition of the job definition or job chain it is specified on.

Example

The job definition Partition1.JD_Partition is in the partition Partition1, just like the time window Partition1.TW_DailyWorkShift. A parameter default expression has REL expression that is referring to this time window as $.TW_DailyWorkShift. The job chain Partition2.JC_Partition is in the partition Partition2; if you try to override the parameter with a parameter mapping using the $.TW_DailyWorkShift syntax, the $ will be replaced with Partition2. This means that you must duplicate the time window in the partition Partition2 or specify Partition1.TW_DailyWorkShift for this to work.

The advantage of this syntax is that you can safely promote this job definition to another system without having to change the REL expression even if the partition name in the target system differs, provided you promote the referenced object as well.

You must keep objects that refer to each other using this syntax in the same partition and should, ideally, keep them in the same application so you can simply promote the application tree.

The promotion module will not detect references that are using the $ syntax. This means that Export with related objects and Promote with related objects will not export all referenced objects.

Substitution Parameters and REL Contexts

In fields that support REL expressions you can specify the substitution parameters using either REL variables or Ant syntax, the latter inside string literals. Note that the substitution parameters will be replaced after the REL expression has been evaluated; this means that REL will only see the substitution parameter names, not their values.

Example

In the Subject field of an email sent for a process server alert, the following expression has been specified:

='Process Server ${processServer} went from ${oldStatus} to ${newStatus} at ' + Time.now()

This will first be evaluated as REL:

Process Server ${processServer} went from ${oldStatus} to ${newStatus} at 12:00:00pm Tuesday 22 September 2015

Then the Ant substitutions are applied:

Process Server MSLN_UNIXS3 went from Running to PartiallyRunning at 12:00:00pm Tuesday 22 September 2015

This expression can also be specified using REL syntax only:

='Process Server '+processServer+' went from '+oldStatus+' to '+newStatus+' at ' + Time.now()

Since the Ant substitution is performed after the REL expression has been evaluated, the following example will not return UNIXS3 but cessServer} instead:

=String.substring('${processServer}', 5)

RedwoodExpressionLanguage Contexts

This section lists implicit objects.

AdHocAlertSource

Name Class Description
alertSourceType String Alert Source Type
alertSourceUniqueId String Alert Source Unique Id
chainJobId String The job id of the current job chain
chainQueue String The queue of the current job chain
data String The data associated with the current job or process server check
jobDefinition String The name of the job definition of the current job
jobDescription String The description of the current job
jobId Number The job id of the current job
parentJobId Number The job id of the current job's parent
partition String The partition the object is in
queue String The name of the queue of the current job
topLevelJobId String The job id of the top level job in the chain
topLevelQueue String The queue of the top level job in the chain

CallSchedulingParameter

Name Class Description
$ String The default partition used by the current object
chainJobId String The job id of the current job chain
chainOutParameters OutParametersScriptObject The values of output parameters of inner-most job chain
chainOutParameters.name String, Number, Date, DateTimeZone Value of out parameter .name of inner-most job chain
chainParameters InParametersScriptObject The values of input parameters of inner-most job chain
chainParameters.name String, Number, Date, DateTimeZone Value of parameter name of inner-most job chain
chainQueue String The queue of the current job chain
chainRequestedStartTime DateTimeZone Job chain requested start time
chainRunStartTime DateTimeZone Job chain run start time
jobId Number The job id of the current job
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job
parentJobId Number The job id of the current job's parent
queue String The name of the queue of the current job
stepIterations Number The number of iterations of this step
topLevelJobId String The job id of the top level job in the chain
topLevelQueue String The queue of the top level job in the chain

ConstraintLOV

Name Class Description
$ String The default partition used by the current object
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job
value Object Value of the parameter or process server check result

DefaultParameter

Name Class Description
$ String The default partition used by the current object
jobDefinition String The name of the job definition of the current job
jobId Number The job id of the current job
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job
parentJobId Number The job id of the current job's parent
queue String The name of the queue of the current job
username String The name of the current user
waitEvents JobWaitEventsScriptObject The wait event object
waitEvents.name.finalPath String The path of the file that raised the event (after move, if applicable)
waitEvents.name.originalPath String The path of the file that raised the event (before move, if applicable)
waitEvents.name.raiserComment String The comment of the raiser
waitEvents.name.raiserJobId Long The job id of the job that raised the event

ForecastCallPrecondition

Name Class Description
chainJobId String The job id of the current job chain
chainOutParameters OutParametersScriptObject The values of output parameters of inner-most job chain
chainOutParameters.name String, Number, Date, DateTimeZone Value of out parameter .name of inner-most job chain
chainParameters InParametersScriptObject The values of input parameters of inner-most job chain
chainParameters.name String, Number, Date, DateTimeZone Value of parameter name of inner-most job chain
chainQueue String The queue of the current job chain
jobId Number The job id of the current job
now Long Override for current time in UTC milliseconds
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job
parentJobId Number The job id of the current job's parent
queue String The name of the queue of the current job
stepIterations Number The number of iterations of this step
topLevelJobId String The job id of the top level job in the chain
topLevelQueue String The queue of the top level job in the chain

ForecastStepPrecondition

Name Class Description
chainJobId String The job id of the current job chain
chainOutParameters OutParametersScriptObject The values of output parameters of inner-most job chain
chainOutParameters.name String, Number, Date, DateTimeZone Value of out parameter .name of inner-most job chain
chainParameters InParametersScriptObject The values of input parameters of inner-most job chain
chainParameters.name String, Number, Date, DateTimeZone Value of parameter name of inner-most job chain
chainQueue String The queue of the current job chain
jobId Number The job id of the current job
now Long Override for current time in UTC milliseconds
parentJobId Number The job id of the current job's parent
queue String The name of the queue of the current job
stepIterations Number The number of iterations of this step
topLevelJobId String The job id of the top level job in the chain
topLevelQueue String The queue of the top level job in the chain

GotoStepEvaluation

Name Class Description
jcsJob Job Object representing the current job.
jobId Number The job id of the current job
outParameters OutParametersScriptObject The values of output parameters of current job
outParameters.name String, Number, Date, DateTimeZone Value of out parameter .name of inner-most job chain
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job
parentJobId Number The job id of the current job's parent
userMessage MapScriptObject User message response instance expression values

JobChainCallPrecondition

Name Class Description
$ String The default partition used by the current object
callJobId String The job id of the current job chain call
callUniqueId String The unique id of the current job chain call definition
chainJobId String The job id of the current job chain
chainOutParameters OutParametersScriptObject The values of output parameters of inner-most job chain
chainOutParameters.name String, Number, Date, DateTimeZone Value of out parameter .name of inner-most job chain
chainParameters InParametersScriptObject The values of input parameters of inner-most job chain
chainParameters.name String, Number, Date, DateTimeZone Value of parameter name of inner-most job chain
chainQueue String The queue of the current job chain
jobId Number The job id of the current job
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job
parentJobId Number The job id of the current job's parent
queue String The name of the queue of the current job
stepIterations Number The number of iterations of this step
stepJobId String The job id of the current job chain step
stepUniqueId String The unique id of the current job chain step definition
topLevelJobId String The job id of the top level job in the chain
topLevelQueue String The queue of the top level job in the chain

JobChainInExpression

Name Class Description
$ String The default partition used by the current object
chainJobId String The job id of the current job chain
chainOutParameters OutParametersScriptObject The values of output parameters of inner-most job chain
chainOutParameters.name String, Number, Date, DateTimeZone Value of out parameter .name of inner-most job chain
chainParameters InParametersScriptObject The values of input parameters of inner-most job chain
chainParameters.name String, Number, Date, DateTimeZone Value of parameter name of inner-most job chain
chainQueue String The queue of the current job chain
jobId Number The job id of the current job
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job
parentJobId Number The job id of the current job's parent
queue String The name of the queue of the current job
stepIterations Number The number of iterations of this step
topLevelJobId String The job id of the top level job in the chain
topLevelQueue String The queue of the top level job in the chain

JobChainStepPrecondition

Name Class Description
chainJobId String The job id of the current job chain
chainOutParameters OutParametersScriptObject The values of output parameters of inner-most job chain
chainOutParameters.name String, Number, Date, DateTimeZone Value of out parameter .name of inner-most job chain
chainParameters InParametersScriptObject The values of input parameters of inner-most job chain
chainParameters.name String, Number, Date, DateTimeZone Value of parameter name of inner-most job chain
chainQueue String The queue of the current job chain
jobId Number The job id of the current job
parentJobId Number The job id of the current job's parent
queue String The name of the queue of the current job
stepIterations Number The number of iterations of this step
stepJobId String The job id of the current job chain step
stepUniqueId String The unique id of the current job chain step definition
topLevelJobId String The job id of the top level job in the chain
topLevelQueue String The queue of the top level job in the chain

JobDefinitionAlertSource

Name Class Description
alertSourceType String Alert Source Type
alertSourceUniqueId String Alert Source Unique Id
chainJobId String The job id of the current job chain
chainQueue String The queue of the current job chain
jobDefinition String The name of the job definition of the current job
jobDefinitionOwner String The owner of the job definition of the current job
jobDescription String The description of the current job
jobId Number The job id of the current job
jobOwner String The owner of the current job
newStatus String The new status
oldStatus String The old status
outParameters OutParametersScriptObject The values of output parameters of current job
outParameters.name String, Number, Date, DateTimeZone Value of out parameter .name of inner-most job chain
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job
parentJobId Number The job id of the current job's parent
partition String The partition the object is in
queue String The name of the queue of the current job
remoteStatus String The status of the remote service
returnCode Number The return code of current job
topLevelJobId String The job id of the top level job in the chain
topLevelQueue String The queue of the top level job in the chain

JobDefinitionRuntimeLimit

Name Class Description
averageRuntime Number The average runtime of the current job
jobId Number The job id of the current job
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job
requestedStartTime DateTimeZone The requested starttime of the current job
scheduledStartTime DateTimeZone The scheduled starttime of the current job
standardDeviationRuntime Number The standard deviation of the runtimes of the job definition of the current job
topLevelAgerageRuntime Number The estimated runtime of the top level job in the chain
topLevelJobId String The job id of the top level job in the chain
topLevelRequestedStartTime DateTimeZone The requested starttime of the top level job in the chain
topLevelScheduledStartTime DateTimeZone The scheduled starttime of the top level job in the chain
topLevelStandardDeviationRuntime Number The standard deviation of the runtimes of the job definition of the top level job in the chain

JobEvent

Name Class Description
$ String The default partition used by the current object
callJobId String The job id of the current job chain call
callUniqueId String The unique id of the current job chain call definition
chainJobId String The job id of the current job chain
chainOutParameters OutParametersScriptObject The values of output parameters of inner-most job chain
chainOutParameters.name String, Number, Date, DateTimeZone Value of out parameter .name of inner-most job chain
chainParameters InParametersScriptObject The values of input parameters of inner-most job chain
chainParameters.name String, Number, Date, DateTimeZone Value of parameter name of inner-most job chain
chainQueue String The queue of the current job chain
eventDefinition String The name of the event definition being raised or waited for
jobId Number The job id of the current job
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job
parentJobId Number The job id of the current job's parent
queue String The name of the queue of the current job
stepIterations Number The number of iterations of this step
stepJobId String The job id of the current job chain step
stepUniqueId String The unique id of the current job chain step definition
topLevelJobId String The job id of the top level job in the chain
topLevelQueue String The queue of the top level job in the chain

JobSearch

Name Class Description
$ String The default partition used by the current object
line String The string found by the File Search
partition String The partition the object is in

MailJob

Name Class Description
jcsJob Job Object representing the current job.
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job

MonitorAlertSource

Name Class Description
alertSourceType String Alert Source Type
alertSourceUniqueId String Alert Source Unique Id
data String The data associated with the current job or process server check

MonitorCondition

Name Class Description

OSNativeParameter

Name Class Description
jobId Number The job id of the current job
osFamily String The OS Family of the Process Server
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job
parentJobId Number The job id of the current job's parent
queue String The name of the queue of the current job

ProcessMonitorEvaluation

Name Class Description
chainParameters InParametersScriptObject The values of input parameters of inner-most job chain
chainParameters.name String, Number, Date, DateTimeZone Value of parameter name of inner-most job chain
monitoritem MapScriptObject Process monitor instance expression values
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job

ProcessServerAlertSource

Name Class Description
alertSourceType String Alert Source Type
alertSourceUniqueId String Alert Source Unique Id
newStatus String The new status
oldStatus String The old status
partition String The partition the object is in
processServer String The name of the process server for the current job or process server check

ProcessServerCheckAlertSource

Name Class Description
alertSourceType String Alert Source Type
reactionJobDefinition String The name of the job defition launched in reaction
reactionJobDefinitionUniqueId String The unique Id of the job definition launched in reaction

ReportColumnEvaluation

Name Class Description
\\&amp;lt;Object\\&amp;gt; String The values of current object's fields
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job

ReportPreviewDefaultParameter

Name Class Description
jobId Number The job id of the current job
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job
parentJobId Number The job id of the current job's parent
queue String The name of the queue of the current job

ReportSelectionEvaluation

Name Class Description
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job

ReturnCodeMapping

Name Class Description
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job
returnCode Number The return code of current job

SAPMassActivityParameter

Name Class Description
jobId Number The job id of the current job
parameters InParametersScriptObject The values of input parameters of current job
parameters.name String, Number, Date, DateTimeZone Value of parameter name of current job
parentJobId Number The job id of the current job's parent
queue String The name of the queue of the current job

Simple

Name Class Description
$ String The default partition used by the current object
partition String The partition the object is in