0% found this document useful (0 votes)
31 views

Alert Composer Tutorial

Uploaded by

ersatya1986
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Alert Composer Tutorial

Uploaded by

ersatya1986
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

7/13/2021 Alert Composer

Alert Composer

Before You Begin

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.

There are two types of alerts. They are:

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

In this exercise, you will:

Make a REST call to an Oracle HCM resource.


Setup a Resource Alert.
You will create a Probation Expiration alert.
Run the Alert.
Validate the Alert.

What Do You Need?

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

To test the scenario, you will need this setup:


Have one or more employee(s) with a probation end date less than 30 days away.
The employee(s) should have a manager assigned to test the manager alert.

Make REST calls to a Resource

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.

Obtain Your Account Information

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.

1. REST server URL

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.

Make a Test REST Call

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"
}
]
}
}}

Create a Resource Alert

1. Sign in to Oracle Fusion Application.


1. See the What You Need section if you have not done so yet.
2. Click on the Navigator to the left of the Oracle logo.

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

5. Click on the down arrow next to Add.


6. Click on Resource Alert.

7. Validate the Access Level is User.


8. Select Yes from the Enable drop-down.
9. Enter 'Probation Expiration' in the Name field.
10. Enter 'Notification to workers and managers that worker probation is approaching expiration.' in the
description field.
11. Select 'emps' in the resource drop-down.

Set filters

You will create two filters for the Probation Alert.

This is for the first filter.

1. Go to the Filters tab to add a criterion for triggering the notification.


2. Click on the Add Filter button.
3. Select emps in the Resource drop-down.
4 U d h R l M h All h l li ll h fil i
https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html h ifi i 5/14
7/13/2021 Alert Composer
4. Under the Resource, select Match All to ensure the alert applies all the filters to trigger the notification.
5. Click on Add Expression. A line item is added.

6. Click on the Edit icon of the new line.


7. In the Edit Expression window, type 'Emps Probation Filter' in the Name field.
8. Copy this line in the Expression box:

exists ( Select 'x' from per_all_assignments_m p where p.person_id =${PersonId} an


d date_probation_end between sysdate and sysdate+30)

9. The screen should look like this:

10. Click the Apply button.


11. Click the Apply button.

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

1. Go to the Filters tab to add a criterion for triggering the notification.

2. Click on the Add Filter button.


3. Select emps/assignments in the Resource drop-down.
4. Under the Resource, select Match All to ensure the alert applies all the filters to trigger the notification.
5. Click on Add Expression. A line item is added.
6. Click on the Edit icon of the new line.
7. In the Edit Expression window, type 'Legal Entity Filter' in the Name field.
8. Select emps/assignments from the Attribute drop-down.
9. Select LegalEntityId from the drop-down to the right.
10. Select Equals from the Operator drop-down.
11. In the Value field, enter the legal entity ID.
1. You obtained it from the REST call.

12. Click on Insert into Expression.

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

Creating the first template with a recipient.

1. Click on the Templates tab.


2. Click on Add Template. A line item is added.
3. Click on the name field and enter 'Manager Notification of Worker Probation Expiration'.
4. Validate that American English is the Default Language.
5. Validate that the Enable field is Yes.

6. Click on the Edit drop-down and select 'Manage recipients and message'.
7. Click on Add Recipient.

8. Validate the Communication Method is Mail.


1. You can use Worklist to contact internal employees through the Fusion App.
9. Click on the XYZ button.

10. Click on the Function radio button.


11. In the Function drop-down, select 'Employee manager'.
12. In the using drop-down, select 'emps'.
13. In the next drop-down, select 'PersonId'.

https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html 8/14
7/13/2021 Alert Composer

14. Click on apply.

Edit the message for the first template.

1. In the Message section, click on the subject field.


2. Enter 'Worker probation approaching expiration'.
3. Click on the Group by field.
1. The Group By option will group the employee notifications in a single email for the manager. Do not use
Group By if you want the manager to receive individual emails.
4. Enter this string:

${AlertUtils.empManager(emps.PersonId).WorkEmail}

5. In the body of the message, insert this message:

The Probation Period of these workers expire during the next 30 days:

${AlertUtils.write("<table border=\"1\">Name Expiration Date")}


${AlertUtils.loop('emps,assignments','','${emps.DisplayName}${AlertUtils.formatDate
(ProbationPeriodEndDate,\'dd-MMM-yyyy\')}')}
${AlertUtils.write("")}

If you have questions, contact your human resources representative.


Thank you.

Note: This is an auto-generated message. Do not reply to this message.

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.

Creating the second Template.

1. Click on the Templates tab.


2. Click on Add Template. A line item is added.
3. Click on the name field and enter 'Worker Notification of Probation Expiration'.
4. Validate that American English is the Default Language.

5. Validate that the Enable field is Yes.


6. Click on the Edit drop-down and select 'Manage recipients and message'.
7. Click on Add Recipient.
8. Validate the Communication Method is Mail.

9. Click on the XYZ button.


10. Click on the Attribute radio button.
11 In the first drop down select 'emps'
https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html 10/14
7/13/2021 Alert Composer
11. In the first drop-down, select emps .
12. In the drop-down next to Using, select 'WorkEmail'.

13. Click on Apply.

Edit the message for the second template.

1. In the Message section, click on the subject field.


2. Enter 'Your probation expires soon'.
3. In the body of the message, insert this message:

Your probation expires on ${emps.assignments.ProbationPeriodEndDate}

If you have questions, contact your human resources representative.


Thank you.

Note: This is an auto-generated message. Do not reply to this message.

4. The screen should look like this.

5. Click on Apply.

https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html 11/14
7/13/2021 Alert Composer

Set Run Options


1. Click on the Run Options tab.
2. In the Automatically Run drop-down, select On demand.
3. In the Log Activity History drop-down, select 'Yes'.

4. In the Simulate run drop-down, select 'Yes'.


1. The alert will not send emails.
2. Set it to 'No' to have the emails sent.

5. Click on Save and Close.


6. Click on the search field.
7. Type 'Probation Expiration' and click on the magnifying glass icon.
8. The Alert will show in the Alerts window.

Run the Alert

1. In the search box, type 'Probation Expiration'.


2. Click on the search icon.
3. Click on the Action drop-down.

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

7. Click OK on the confirmation screen.

In the next section, you will validate the alert ran correctly.

Validate the Alert

The previous step configured the alert to run as a simulation. It will not send emails.

1. On the left bar, click on the Alerts History icon.


2. Click on the Filter icon.
3. In the Name field, type 'Probation Expiration'.

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

Note that the alert sent no emails.

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:

The manager would receive an email like this one:

About Oracle (http://www.oracle.com/corporate/index.html)


Contact Us (http://www.oracle.com/us/corporate/contact/index.html)
Legal Notices (http://www.oracle.com/us/legal/index.html)
Terms of Use (http://www.oracle.com/us/legal/terms/index.html)
Your Privacy Rights (http://www.oracle.com/us/legal/privacy/index.html)
Copyright © 2015, 2017, Oracle and/or its affiliates. All rights reserved. (http://www.oracle.com/pls/topic/lookup?
ctx=cpyr&id=en)

https://www.oracle.com/webfolder/technetwork/tutorials/obe/alertcomposer/alertcomposer_createalert/alertcomposer.html 14/14

You might also like