Functions

Functions

Overview

Variables and functions can be used in free-text fields within tasks and workflows. When a variable or function is specified in a free-text field, the Controller inserts its value into the field when the task or workflow is run.

Also, triggers can pass variables and functions into the tasks and workflows they launch.

Universal Controller supports a number of functions that can be specified in free-text fields. They are resolved when a task instance runs or when a Set Variable action containing a function is executed.

Functions are entered using the following formats:
 

${_function} ${_function(arg1, ..., argN)}

Formatting Rules

  • Functions must be written either:

    • In all lower-case characters.

    • Exactly as shown in the tables on this page.

  • Functions have zero, one, or multiple parameters.

  • Each function parameter is one of three specific types:

    • String

    • Integer

    • Boolean

  • String parameters must be enclosed in single or double quotation marks.

  • Integer and Boolean parameters can be enclosed in single or double quotation marks.

  • Optional parameters are identified on this page by being enclosed in [square brackets]. When copying a function from the documentation, be sure to remove the square brackets; otherwise, the function will not resolve.

  • If a function has more than one optional parameter, any optional parameters preceding a specified optional parameter must be included in the function's parameter list. For example:

    • For function ${_responseJsonPath('pathExpression'[,'defaultValue','delimiter',prettyPrint])}, usage ${_responseJsonPath('.outputData','','',true)} would be valid, whereas ${_responseJsonPath('.outputData',,,true)} would not be valid.

    • For function ${_formatDate(['date_time', 'format', day_offset, use_business_days, hour_offset, minute_offset, timezone])}, usage ${_formatDate('2018-09-01','',0,true)} would be valid, whereas ${_formatDate('2018-09-01','',,true)} would not be valid.

  • All functions allow nesting to two levels. That is, a function can be an argument to another function, which itself can be an argument to another function.

    • You must use a double underscore preceding the name of a first-level nested function.

    • You must use a triple underscore preceding the name of a second-level nested function.


    For example, for 2nd day of next month less one Business Day:

${_formatDate('${__dayOfMonth(2,'${___dateadv('yyyy-MM-dd',0,1)}')}','',-1,true)}

Function Categories

Functions are listed alphabetically within the following categories on this page:

  • Conditional functions

  • Credential functions

  • Date functions

  • Mathematical functions

  • Output functions

  • Other Task functions

  • SAP Connection functions

  • Script functions

  • SQL/Stored Procedure functions

  • String functions

  • System functions

  • Universal Task functions

  • Web Service Functions

Conditional Functions

Return Conditional Value Depending on Equality of String Parameters

Description

Returns a conditional value depending on the equality of two string parameters.
 
(Returns if_value if string value1 is equal to string value2; otherwise, else_value is returned.)

Syntax

${_ifEqual('value1', 'value2', 'if_value', 'else_value'[, ignore_case])}

Parameters

  • value1
    Required; First string.

  • value2
    Required; Second string.

  • if_value
    Required; Return value if value1 equals value2.

  • else_value
    Required; Return value if value1 does not equal value2.

  • ignore_case
    Optional; Specification (true or false) whether or not to ignore case when comparing value1 and value2. Default is false.

Examples

${_ifEqual('abc','def','YES','NO')} ${_ifEqual('abc','ABC','YES','NO',true)} ${_ifEqual('2015-08-15','${__date()}','17:00','18:00')}

Return Conditional Value Depending on Value of Boolean Parameter

Description

Returns a conditional value depending on the value of a boolean parameter.
 
Returns if_value if value is true; otherwise, else_value is returned.

Syntax

${_ifTrue(value, 'if_value', 'else_value')}

Parameters

  • value
    Required; Boolean value (true or false).

  • if_value
    Required; Return value if value is true.

  • else_value
    Required; Return value if value is false.

Example

${_ifTrue(${__isToday('Mon', 'E')},'20:00','22:00')}

Credential Functions

Return Key Location of a Credential

Description

Returns a token representing the Resolvable Credential Key Location that you want to embed.

Syntax

${_credentialKeyLoc('<credential_name>')}

Parameters

  • credential_name
    Required; Name of the Credential.

Example

${_credentialKeyLoc('RCredentialXYZ')} → $(ops_unv_cred_key_loc_c89e7b2caf4247909bc46041df8a2643)

Return Passphrase of a Credential

Description

Returns a token representing the Resolvable Credential Passphrase that you want to embed.

Syntax

${_credentialPassphrase('<credential_name>')}

Parameters

  • credential_name
    Required; Name of the Credential.

Example

${_credentialPassphrase('RCredentialXYZ')} → $(ops_unv_cred_passphrase_c89e7b2caf4247909bc46041df8a2643)

Return Token of a Credential

Description

Returns a token representing the Resolvable Credential Token that you want to embed.

Syntax

${_credentialToken('<credential_name>')}

Parameters

  • credential_name
    Required; Name of the Credential.

Example

${_credentialToken('RCredentialXYZ')} → $(ops_unv_cred_token_c89e7b2caf4247909bc46041df8a264

 

Return User Name of a Credential

Description

Returns a token representing the Resolvable Credential Runtime User that you want to embed.

Syntax

${_credentialUser('<credential_name>')}

Parameters

  • credential_name
    Required; Name of the Credential.

Example

${_credentialUser('RCredentialXYZ')} → $(ops_unv_cred_user_c89e7b2caf4247909bc46041df8a2643)

Return User Password of a Credential

Description

Returns a token representing the Resolvable Credential Runtime Password that you want to embed.

Syntax

${_credentialPwd('<credential_name>')}

Parameters

  • credential_name
    Required; Name of the Credential.

Example

${_credentialPwd('RCredentialXYZ')} → $(ops_unv_cred_pwd_c89e7b2caf4247909bc46041df8a2643)

Date Functions

Checks if Date Argument Equals Today's Date

Description

Checks if a date argument is equal to today's date in the specified format.
 
Returns true if date is equal to today's date in the specified format; otherwise, false is returned.

Syntax

${_isToday('date'[, 'format', is_relative])}

Parameters

  • date
    Required; Date to compare to today's date.

  • format
    Optional; Format of today's date. Default is yyyy-MM-dd.

  • is_relative
    Optional; Specification (true or false) for whether today's date is relative to the trigger/launch time of the task instance. Default is false.

Examples

${_isToday('Wed', 'E')} ${_isToday('${__dayOfMonth(1,'','',true)}')}

Resolve to Current Date and Time

Description

Resolves to the current date and time.

Syntax

${_date(['format', day_offset, hour_offset, minute_offset])}

Parameters

Examples

${_date} --> 2012-07-14 12:43:06 -0400 ${_date()} --> 2012-07-14 12:43:06 -0400 ${_date('yyyy-MM-dd', 5)} --> 2012-07-19 ${_date('yyyy-MM-dd HH:mm:ss', -2, -1)} --> 2012-07-12 11:43:06 ${_date('', 0, 0, 10)} --> 2012-07-14 12:53:06 -0400

Resolve to Current Date and Time (Advanced)

Description

Resolves to the current date and time.

Syntax

${_dateadv(['format', year_offset, month_offset, day_offset, hour_offset, minute_offset])}

Parameters

  • format
    Date format. Default format is yyyy-MM-dd HH:mm:ss Z. For details on the format parameter, see https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html

  • year_offset
    Optional; +/- number of years to offset.

  • month_offset
    Optional; +/- number of months to offset.

  • day_offset
    Optional; +/- number of days to offset.

  • hour_offset
    Optional; +/- number of hours to offset.

  • minute_offset
    Optional; +/- number of minutes to offset.

Examples

${_dateadv} --> 2012-07-29 09:31:42 -0700 ${_dateadv('yyyy-MMM', -1)} --> 2011-Jul ${_dateadv('yyyy-MMM', 0, -1)} --> 2012-Jun

Resolve to Current Unix Epoch Time

Description

Resolves to the current time in milliseconds since Wed Dec 31 1969 19:00:00 GMT-0500 (EST) – the start of Unix epoch time.

Syntax

${_currentTimeMillis}

Parameters

n/a

Return Date with Offsets

Description

Returns the date after applying offsets. Optionally, can specify the output format.
 

Whether a holiday is treated as a business day or a non-business day is specified by the Exclude Holidays for Business Days Universal Controller system property.

Syntax

${_formatDate(['date_time', 'format', day_offset, use_business_days, hour_offset, minute_offset, timezone])}

Parameters

  • date_time
    Date and time in any of the following formats:

    • yyyy-MM-dd

    • yyyy-MM-dd HH:mm

    • yyyy-MM-dd HH:mm:ss

    • yyyy-MM-dd HH:mm Z

    • yyyy-MM-dd HH:mm:ss Z.

    • yyyy-MM-dd HH:mm:ss.SSS

    • yyyy-MM-dd HH:mm:ss.SSS Z.

    Default is the current date and time.

  • format
    Format of returned date. If date_time specifies a time, the default format is yyyy-MM-dd HH:mm; otherwise, the default format is yyyy-MM-dd. For details on the format parameter, see https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html

  • day_offset
    +/- number of days to offset.

  • use_business_days
    Specification (true or false) for whether day_offset is for business days. Default is false.

  • hour_offset
    +/- number of hours to offset.

  • minute_offset
    +/- number of minutes to offset.

  • timezone
    Time Zone that the date is formatted in.

Example

${_formatDate} --> 2018-08-24 15:37 ${_formatDate()} --> 2018-08-24 15:37 ${_formatDate('','MMddyyyy',5)} --> 08292018 ${_formatDate('2018-09-01','',5)} --> 2018-09-06 ${_formatDate('2018-09-01','',-5)} --> 2018-08-27 ${_formatDate('2018-10-13 12:13:14 -0400','',5,true,0,0,'Australia/Sydney')} --> 2018-10-14 03:13:14 +1100

Return Date with Offsets (Advanced)

Description

Returns the date after applying offsets. Optionally, can specify the output format.
 

Whether a holiday is treated as a business day or a non-business day is specified by the Exclude Holidays for Business Days Universal Controller system property.

Syntax

${_formatDateAdv(['date_time', 'format', year_offset, month_offset, day_offset, use_business_days, hour_offset, minute_offset, timezone])}

Parameters

  • date_time
    Date and time in any of the following formats:

    • yyyy-MM-dd

    • yyyy-MM-dd HH:mm

    • yyyy-MM-dd HH:mm:ss

    • yyyy-MM-dd HH:mm Z

    • yyyy-MM-dd HH:mm:ss Z.

    • yyyy-MM-dd HH:mm:ss.SSS

    • yyyy-MM-dd HH:mm:ss.SSS Z.

    Default is the current date and time.

  • format
    Format of returned date. If date_time specifies a time, the default format is yyyy-MM-dd HH:mm; otherwise, the default format is yyyy-MM-dd. For details on the format parameter, see https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html

  • year_offset
    Optional; +/- number of years to offset.

  • month_offset
    Optional; +/- number of months to offset.

  • day_offset
    Optional; +/- number of days to offset.

  • use_business_days
    Optional; Specification (true or false) for whether day_offset is for business days. Default is false.

  • hour_offset
    +/- number of hours to offset.

  • minute_offset
    +/- number of minutes to offset.

  • timezone
    Time Zone that the date is formatted in.

Examples