Functions and Groovy Expressions
This topic describes various functions and Groovy expressions that you can use when configuring alerts using the Alerts Composer.
The return attributes for the person can be one of these:
-
PersonId
-
WorkEmail
-
DisplayName
-
FirstName
-
LastName
-
UserName
Functions
This table describes the functions that are supported for alerts. A maximum of 25 results are retrieved. If the results exceed 25, warning messages will be displayed in the log.
Function |
Description |
Usage |
Example |
---|---|---|---|
|
Returns HR Representative person attributes for the |
Recipient Section
Body or Subject Section
Loop Example
|
Recipient Section
Body or Subject Section
Loop Example
|
|
Returns Payroll Representative person attributes
for the |
Recipient Section
Body or Subject Section
Loop Example
|
Recipient Section
Body or Subject Section
Loop Example
|
|
Returns Benefits Representative person attributes
for the |
Recipient Section
Body or Subject Section
Loop Example
|
Recipient Section
Body or Subject Section
Loop Example
|
|
Returns Union Representative person attributes for
the |
Recipient Section
Body or Subject Section
Loop Example
|
Recipient Section
Body or Subject Section
Loop Example
|
|
Returns employee's manager person attributes for
the |
Recipient Section
Body or Subject Section
|
Recipient Section
Body or Subject Section
|
|
Returns all the active users who are assigned to a particular role for the role code provided. |
Recipient Section Returns the users with person details who have been assigned the provided Role_Name or Role_Code
Body or Subject Section
|
Recipient Section
Body or Subject Section
|
|
Converts an array of objects into comma separated strings. |
|
|
|
Returns person attributes for the |
|
|
|
Returns the system date. |
|
|
|
Returns the system date and time. |
|
|
|
Formats the number to the specified Java number format. Supported formats are available at https://docs.oracle.com/javase/7/docs/api/java/text/NumberFormat.html. |
|
|
|
Formats the date to the specified Java date format. Supported formats are available at https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html Note:
Date provided must be in the [yyyy-MM-dd] format, which is the default date format for Application Developer Framework (ADF) REST response. |
|
|
Name: |
Returns the Lookup meaning based on the user's preference language. |
|
Yes |
Name: |
Returns the Lookup meaning based on the user's preference language for the legislation stripe |
|
Male |
|
Loops through a collection. This function can be used to construct tables in the message content as follows:
The resource names are separated by commas and the contents that follow are used to append data in the given order. For each Resource Name1 record, the respective content for Resource Name2 is appended. This happens in a nested manner. Rules
|
Sample 1
Sample 2
|
Sample 1 Hello John, Visas of these employees expire in the next 30 days:
Thank you. Sample 2 Hello John, Visas of these employees expire in the next 30 days:
Thank you. |
Groovy Expressions
Alerts Composer supports Groovy expressions to substitute variables and add conditions based on the values provided at runtime. The following table shows some examples.
Groovy Expression |
Example |
---|---|
|
Hi John Your visa issued in GB, US expires on 2022-03-10, 2022-01-11. |
|
Hi John Multiple visas are issued for employee: GB Regards, Administrator |