Redwood Function Library 
Built in functions
BaseString - Prefix: None.
BaseCast - Prefix: None.
BaseMath - Prefix: Math
BaseCast - Prefix: Casts
ModuleScriptingJobChainParameters - Prefix: JobChainParameters
ModuleScriptingQuery - Prefix: Query
ModuleScriptingVariable - Prefix: Variable
ModuleScriptingTable - Prefix: Table
ModuleScriptingConstraint - Prefix: Constraint
ExtendedTime - Prefix: Time
ExtendedRange - Prefix: Range
ModuleScriptingSap - Prefix: SAP
BaseTime - Prefix: Time
BaseRange - Prefix: Range
Prefix: BaseCast
Availability: Always.
Signature: Object BaseCast.ToBoolean(Object arg)
Availability: Always.
Convert arg to a boolean (true/false) if possible.
Signature: Object BaseCast.ToNumber(Object arg)
Availability: Always.
Convert arg to a number if possible.
Signature: Object BaseCast.ToInteger(Object arg)
Availability: Always.
Convert arg to an integer if possible.
Signature: Object BaseCast.ToString(Object arg)
Availability: Always.
Convert arg to a string.
Signature: Object BaseCast.ToYN(Object arg)
Availability: Always.
Convert arg to Y for true and N for any other value.
Prefix: BaseMath
Availability: Always.
Signature: BigDecimal BaseMath.abs(BigDecimal x)
Availability: Always.
Calculate the absolute value of x.
Signature: BigDecimal BaseMath.floor(BigDecimal x)
Availability: Always.
Calculate the floor (greatest integer less than) of x.
Signature: BigDecimal BaseMath.ceil(BigDecimal x)
Availability: Always.
Calculate the ceiling (least integer greater than) of x.
Signature: BigDecimal BaseMath.round(BigDecimal x)
Availability: Always.
Round x. If x ends in .5, it will be rounded up.
Prefix: BaseRange
Availability: Always.
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: 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.
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 |
Signature: boolean BaseRange.inRange(int candidate, String trueRange)
Availability: Always.
Return true if candidate is in the range specified by trueRange.
Signature: boolean BaseRange.inSet(int candidate, String trueSet)
Availability: Always.
Return true if candidate is in the set specified by trueRange.
Prefix: BaseString
Availability: Always.
Functions for working with Strings.
Signature: String BaseString.currentObject.concat(String s1, ...)
Availability: Always.
Concatenate strings to currentObject. Any number of other objects may be passed as arguments.
Signature: String BaseString.currentObject.toString()
Availability: Always.
Convert currentObject to a string.
Signature: String BaseString.currentString.charAt(int pos)
Availability: Always.
Get character at pos in currentString.
Signature: int BaseString.currentString.indexOf(String searchFor, [int startIndex])
Availability: Always.
Get the first index of the string searchFor in currentString, optionally starting at startIndex (default=0).
Signature: int BaseString.currentString.lastIndexOf(String searchFor, [int startIndex])
Availability: Always.
Get the last index of the string searchFor in the currentString, optionally starting at startIndex (default=0).
Signature: String[] BaseString.currentString.split(String separator, int limit)
Availability: Always.
Split currentString into an array using the specified separator. Limit the length of the array to limit elements.
Signature: String BaseString.currentString.substring([int startIndex] [, int endIndex])
Availability: Always.
Get a substring of currentString, starting at startIndex (defaults to zero) and ending at endIndex (defaults to the end of the string).
Signature: String BaseString.currentString.toLowerCase()
Availability: Always.
Convert currentString to lower case.
Signature: String BaseString.currentString.toUpperCase()
Availability: Always.
Convert currentString to upper case
Prefix: BaseTime
Availability: Always.
Time expressions are a sequence of operations, applied in order to a time (generally now, but may be a specified date). They may be: The <value> is always a number: The <specifier> is one of: Plurals with an additional 's' are accepted (eg. days, weeks, ...). The day is always the day of the month, and dow is the day of the week. Example time expressions:
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 <specifier> and everything below it).
The days of the week start at 1 for Sunday.
The days of the year start at 1 for 1 January.
add/subtract: second, minute, hour, day, week, month, year
truncate: second, minute, hour, day, week, month
set: second, minute, hour, day, dow, day_of_year, week, week_of_month, month
add 1 minute
add 3 seconds
set hour 1
truncate day
subtract 2 days
Signature: DateTimeZone BaseTime.now([String timeZoneName])
Availability: Always.
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.
Signature: DateTimeZone BaseTime.expression(Object date, String expression)
Availability: Always.
Apply expression to the date specified.
Signature: DateTimeZone BaseTime.expressionNow(String expression)
Availability: Always.
Apply expression to the current time.
Signature: boolean BaseTime.isTimeWindowOpenNow(String timeWindow)
Availability: Always.
Return true if the time window timeWindow is open now, false otherwise.
Signature: boolean BaseTime.isTimeWindowOpen(Object date, String timeWindow)
Availability: Always.
Return true if the time window timeWindow is open on the specified date, false otherwise.
Prefix: ExtendedRange
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Signature: boolean ExtendedRange.inRangeWarning(int candidate, String trueRange, String warningRange, int severity, String message)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Return true if candidate is in the range specified by trueRange. Return true, but log a warning operator message ifcandidate is in warningRange. The operator message is specified by the message and severity parameters.
Prefix:
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Signature: int .queryHTMLTable(String query [, Object [] bindVariables])
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Produce HTML output on stdout for the query query with optional bind variables bindVariables. Bind variable place holders are specified as ? in the query.
Signature: int .queryCSV(String query [, Object [] bindVariables])
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Produce CSV output on stdout for the query query with optional bind variables bindVariables. Bind variable place holders are specified as ? in the query.
Signature: boolean .exists(VisitorContext context, String statement, Object [] bindVariables)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Signature: DateTimeZone .queryDateTimeZone(VisitorContext context, String statement, Object [] bindVariables)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Signature: Date .queryDate(VisitorContext context, String statement, Object [] bindVariables)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Prefix: ExtendedTime
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Signature: boolean ExtendedTime.isDayOfWeekInSetNow(String weekSet)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Is the current day of the week in weekSet.
Signature: boolean ExtendedTime.isDayOfWeekInSet(Object date, String weekSet)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Is the day of the week of date in weekSet.
Signature: boolean ExtendedTime.isDayInRangeNow(String dayRange)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Is the current day of the month in the range dayRangeSet.
Signature: boolean ExtendedTime.isDayInRange(Object date, String dayRange)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Is the day of the month of date in the range dayRangeSet.
Signature: boolean ExtendedTime.isLastDayInMonthNow(ScriptEvaluationContext context)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Is it currently the last day of the month?
Signature: boolean ExtendedTime.isLastDayInMonth(Object date)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Is the date specified the last day of that month?
Signature: boolean ExtendedTime.isMonthInSetNow(String monthRange)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Is the month of the current date in the range monthRange?
Signature: boolean ExtendedTime.isMonthInSet(Object date, String monthRange)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Is the month of the specified date in the range monthRange?
Signature: String ExtendedTime.format(Object date, String format)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Format the date according to the specified .
Signature: String ExtendedTime.formatDuration(BigDecimal duration)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Format a duration using the standard format: |1 week, |# weeks, |1 day, |# days, |#|:#|:#|.#
Signature: String ExtendedTime.formatDurationEx(BigDecimal duration, String format)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
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 and days may be greater than 7. If the third element is empty, days are not printed and and hours may be greater than 24.
Signature: BigDecimal ExtendedTime.getUTCMillisecondsNow()
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Get the number of milliseconds since midnight on January 1 1970 for the current time.
Signature: BigDecimal ExtendedTime.getUTCMilliseconds(Object date)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Get the number of milliseconds since midnight on January 1 1970 for the specified time.
Signature: String ExtendedTime.formatNow(String format)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Format the current date according to the specified .
Signature: DateTimeZone ExtendedTime.parse(Object string, String format)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Parse the string into a date according to the specified .
Signature: DateTimeZone ExtendedTime.nextTimeWindowOpeningNow(String timeWindow)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Next opening of timeWindow after now.
Signature: DateTimeZone ExtendedTime.nextTimeWindowOpening(Object date, String timeWindow)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Next opening of timeWindow after the specified date.
Signature: DateTimeZone ExtendedTime.nextTimeWindowClosingNow(String timeWindow)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Next opening of timeWindow after now.
Signature: DateTimeZone ExtendedTime.nextTimeWindowClosing(Object date, String timeWindow)
Availability: RedwoodScript only. Requires 'Module.AdvancedScripting' key.
Next opening of timeWindow after the specified date.
Prefix: ModuleScriptingConstraint
Availability: Requires 'Module.Scripting' key.
Signature: boolean ModuleScriptingConstraint.listConstraint(String titles, String list, boolean valid)
Availability: Requires 'Module.Scripting' key.
Signature: boolean ModuleScriptingConstraint.pairListConstraint(String titles, String list, boolean valid)
Availability: Requires 'Module.Scripting' key.
Prefix: ModuleScriptingJobChainParameters
Availability: Requires 'Module.Scripting' key.
Job chain job names take the form Step name, job job number. For example: "Step 2, job 3" or "Data load, job 2".
Signature: String ModuleScriptingJobChainParameters.getOutValueString(String jobName, String parameterName)
Availability: Requires 'Module.Scripting' key.
Get the value of the String output parameter parameterName of the job named jobName in the current job chain.
Signature: BigDecimal ModuleScriptingJobChainParameters.getOutValueNumber(String jobName, String parameterName)
Availability: Requires 'Module.Scripting' key.
Get the value of the Number output parameter parameterName of the job named jobName in the current job chain.
Signature: DateTimeZone ModuleScriptingJobChainParameters.getOutValueDate(String jobName, String parameterName)
Availability: Requires 'Module.Scripting' key.
Get the value of the Date output parameter parameterName of the job named jobName in the current job chain.
Signature: String ModuleScriptingJobChainParameters.getInValueString(String jobName, String parameterName)
Availability: Requires 'Module.Scripting' key.
Get the value of the String input parameter parameterName of the job named jobName in the current job chain.
Signature: BigDecimal ModuleScriptingJobChainParameters.getInValueNumber(String jobName, String parameterName)
Availability: Requires 'Module.Scripting' key.
Get the value of the Number input parameter parameterName of the job named jobName in the current job chain.
Signature: DateTimeZone ModuleScriptingJobChainParameters.getInValueDate(String jobName, String parameterName)
Availability: Requires 'Module.Scripting' key.
Get the value of the Date input parameter parameterName of the job named jobName in the current job chain.
Signature: Long ModuleScriptingJobChainParameters.getJobId(String jobName)
Availability: Requires 'Module.Scripting' key.
Get the job id of the job named jobName in the current job chain.
Signature: String ModuleScriptingJobChainParameters.getJobStatus(String jobName)
Availability: Requires 'Module.Scripting' key.
Get the job status of the job named jobName in the current job chain.
Prefix: ModuleScriptingQuery
Availability: Requires 'Module.Scripting' key.
Signature: BigDecimal ModuleScriptingQuery.getNumber(String query [, Object [] bindVariables])
Availability: Requires 'Module.Scripting' key.
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.
Signature: String ModuleScriptingQuery.getString(String query [, Object [] bindVariables])
Availability: Requires 'Module.Scripting' key.
Get the first column of the first row of the query query with with optional bind variables bindVariables. Bind variable place holders are specified as ? in the query.
Signature: BigDecimal ModuleScriptingQuery.getRelativeJob(String jobName)
Availability: Requires 'Module.Scripting' key.
Get the job id of the job named jobName in the current job chain.
Prefix: ModuleScriptingSap
Availability: Requires 'Module.Scripting' key.
Signature: String ModuleScriptingSap.convertJobParameterRangesToExpression(String jobName, String parameterName, int fieldLength)
Availability: Requires 'Module.Scripting' key.
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. 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.
Signature: String ModuleScriptingSap.convertRangesToExpression(String rangesString, int fieldLength)
Availability: Requires 'Module.Scripting' key.
Convert ranges to a selopt expression. 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.
Prefix: ModuleScriptingTable
Availability: Requires 'Module.Scripting' key.
Signature: String ModuleScriptingTable.getRow(String table, String key)
Availability: Requires 'Module.Scripting' key.
Signature: String ModuleScriptingTable.getColumnString(String tableName, String key, String column)
Availability: Requires 'Module.Scripting' key.
Signature: BigDecimal ModuleScriptingTable.getColumnNumber(String table, String key, String column)
Availability: Requires 'Module.Scripting' key.
Signature: String ModuleScriptingTable.formatRow(String table, String key, String rowStart, String columnFormat, String columnSeparator, String rowEnd)
Availability: Requires 'Module.Scripting' key.
Prefix: ModuleScriptingVariable
Availability: Requires 'Module.Scripting' key.
Signature: String ModuleScriptingVariable.getString(String key)
Availability: Requires 'Module.Scripting' key.
Signature: BigDecimal ModuleScriptingVariable.getNumber(String key)
Availability: Requires 'Module.Scripting' key.