Alert Composer Tutorial
Alert Composer Tutorial
Alert Composer
Purpose
This tutorial uses HCM Alert Composer to create, edit and run an alert. The tutorial will configure the alert to
send an email notification to the recipients defined in the alert's template.
Time to Complete
Approximately 90 minutes.
Background
The HCM Alert Composer is a tool that enables you to send informational notifications to Oracle HCM Cloud
user by email or worklist.
Event Alerts: They trigger when a specific event occurs in the application and the calling client provides the
context. You cannot modify the notification's triggering criteria.
For example, Time Exceptions from Compliance Rules is a predefined Event Alert. It triggers on
compliance exceptions and sends notifications to the managers informing them of the exceptions.
Resource Alerts: Based on Oracle HCM Cloud REST API resources available in the environment. You need
the required privileges to access the REST resources.
For example, the resource alert 'Visa Expiration' triggers when a worker's visa nears expiration. A filter is
defined on the visa attribute of the 'emps' resource. The alert sends a notification to the worker and the
manager.
Scenario
https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html 1/14
7/13/2021 Alert Composer
You need access to the employee's REST API.
https://docs.oracle.com/en/cloud/saas/global-human-resources/18c/farws/api-employees.html
(https://docs.oracle.com/en/cloud/saas/global-human-resources/18c/farws/api-employees.html)
To access the Alert Composer and run the alerts, you will need these two Functional Security Privileges:
HRC_ACCESS_ALERTS_COMPOSER_PRIV
HRC_PROCESS_PREDEFINED_ALERT_PRIV
To access the 'emps' REST API resources to create the Probation alert, you will need this Functional Privilege:
Use REST Service - Employees
The first step is to go through the setup and validation of the REST API access. The Oracle HCM REST API
documents are available here:
https://docs.oracle.com/en/cloud/saas/global-human-resources/18b/farws/index.html
(https://docs.oracle.com/en/cloud/saas/global-human-resources/18b/farws/index.html)
You can use Postman to test and validate the REST API access.
You must obtain the account information and sign-in credentials to access Oracle HCM Cloud REST APIs.
Ensure that you have the following information to access the REST APIs.
2. Username and password: Make sure that the user name provided has authorization for the 'emps'
services.
You can get the sign-in credentials and REST server URL from the account creation email that you receive
from Oracle. If you do not have this information, contact you Oracle Cloud Account administrator.
Af b i i f i d l h
https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html i 2/14
7/13/2021 Alert Composer
After you obtain your account information, you can send a sample request to ensure that your connection
works. For example, you can retrieve an employee record by executing a simple GET request on the 'emps'
resource.
Request
GET https://<host>/hcmCoreApi/resources/latest/emps
In the request, <host> must be replaced by your Oracle instance URL. The response will return a number of
records, showing the connection was successful.
In the next section of this exercise, we will create an Alert to check the probation end date of employees. To
validate there is at least one employee with an appropriate probation period, run this request. The response
must show at least one record. Replace <host> and the two dates in the request to cover from today to the
next 30 days.
Note that you must use REST-Framework-Version 3 in the header of the request.
Request
GET https://<host>/hcmCoreApi/resources/latest/emps?q=assignments.ProbationPeriodEndDa
te > '2018-11-30' AND assignments.ProbationPeriodEndDate < '2018-12-30' &fields=Displa
yName;assignments:ProbationPeriodEndDate,LegalEntityId&onlyData=true
Response
If the request is successful, the server responds with a status code 200. The response body should contain at
least one record for the next section in this exercise to be successful.
Note the LegalEntityId. You will use it to create a filter in the tutorial.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html 3/14
7/13/2021 Alert Composer
HTTP/1.1: 200 OK
{
"items": [
{
"DisplayName": "Mick Jones",
"assignments": {
"items": [
{
"ProbationPeriodEndDate": "2019-04-11"
"LegalEntityId": 40017
}
],
"count": 1,
"hasMore": false,
"limit": 25,
"offset": 0,
"links": [
{
"rel": "self",
"href": "https://host/hcmRestApi/resources/11.13.18.05/emps/00
020000000EACED0/child/assignments",
"name": "assignments",
"kind": "collection"
}
]
}
}}
3. Click on Tools.
4. Click on Alert Composer.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html 4/14
7/13/2021 Alert Composer
Set filters
Optionally, you can add a second filter. You will need the legal entity ID you exported in the Make a Test REST
Call section of this document.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html 6/14
7/13/2021 Alert Composer
13 Cli k A l
https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html 7/14
7/13/2021 Alert Composer
13. Click on Apply.
14. Click on Apply.
Set Templates
6. Click on the Edit drop-down and select 'Manage recipients and message'.
7. Click on Add Recipient.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html 8/14
7/13/2021 Alert Composer
${AlertUtils.empManager(emps.PersonId).WorkEmail}
The Probation Period of these workers expire during the next 30 days:
1. Alerts Composer's Templates support Groovy expressions to substitute variables and add conditions
based on the values provided at runtime.
2. For more information on Groovy expressions, please refer to the Groovy documentation.
6. The screen should look like this.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html 9/14
7/13/2021 Alert Composer
7. Click on Apply.
5. Click on Apply.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html 11/14
7/13/2021 Alert Composer
4. Select Run.
5. Enter your User Identifier.
6. Click on Submit.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html 12/14
7/13/2021 Alert Composer
In the next section, you will validate the alert ran correctly.
The previous step configured the alert to run as a simulation. It will not send emails.
4. Click on Apply.
5. Validate you see the Probation Expiration alert ran successfully.
1. You may have to click refresh a few times.
6. Click on 'Probation Expiration' name to see the results of the alert's history.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html 13/14
7/13/2021 Alert Composer
The current setup of the alert will not send emails to the employees and managers. See the Set Run Option
section of this document to change the configuration.
If you configure the alert with the Simulate Run setting to 'No', the alert will send emails. The employee would
receive an email like this one:
https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html 14/14