Lab 05 Customize Notifications
Lab 05 Customize Notifications
Enterprise Events
Contents
Lab 5: Configuring Custom Notifications for Significant Enterprise Events ................................................... 1
1. Introduction ............................................................................................................................................. 1
2. Content ..................................................................................................................................................... 2
1. Introduction
ACME Capital want to implement some business processes around email notification at following stages:
Send username and password along with some Administrators details at the time of user creation
OIM 11g Workshop - Lab 5
Requirement is to send Email Notifications to specific target users for the communication of username and password generated during
user creation. OIM OOTB pre-seeds the Notification template that defines the format/content of this notification, but ACME wants to
change the same. This is one of the use cases covered in the current lab.
The solution would focus on changing the e-mail notification text content by using the OIM Advanced Console to suit the business need.
OIM out-of-box does not provide the details for Administrator i.e. Contact Phone or E-Mail address when an e-mail notification is
generated. One such e-mail notification use case is when a User is created without providing User Login and Password details. In this
scenario, an e-mail notification is sent to the newly created user with OIM auto-generated User Login and Password along with the
Administrator’s contact details.
Send notification to the user whenever he/she is added into a Role
For this use case, OIM OOTB does not have the provision of sending email notifications. Therefore the solution would be to digest into the
relevant functional flow and at the relevant spot, inject a point of notification which should follow specific format/content (as per an OIM
Notification template) and can be sent to desired list of (OIM) users. In this lab, the solution focuses on OIM SPI that can be used to write a
custom post-process handler on a User operation. In particular this sample demonstrates sending of a Notification on Role assignment to a
User. The User who has been assigned the Role will receive a E-mail notification of the Role being assigned.
2. Content
2.1.Description of Package
Collect the package from /odrive/dummydata/Lab 5/Notification - Role_Grant - PS1.zip
2
Folder Structure Description
PROJECT-CONTEXT]/config Contains the event handler definitions file
Includes all .xml files including plugin.xml file. Except plugin.xml all
other files will be chosen to be imported in Oracle MDS.
[PROJECT-CONTEXT]/resources Includes all the required resources files. e.g.; text files, properties files,
images, etc.
[PROJECT-CONTEXT]/lib Includes all the required jar files. The project JAR file is as well created
in this same folder.
[PROJECT-CONTEXT]/src This includes the source files for
oracle.iam.sample.notification.RoleGrantNotificationEvent.java
What for this class Is used?
oracle.iam.sample.notification.RoleGrantNotificationEventResolver.java
What for this class Is used?
[PROJECT-CONTEXT]/importfiles The files which are required to be imported in OIM to make this event
handler execute properly should be placed in this folder.
[PROJECT-CONTEXT]/ Project Package which can be open in JDeveloper.
Notification - Role_Grant -
PS1.jpr
Minimum required JAR files: Once the project package is opened in the JDeveloper it is required that the minimum required JAR
files be added in the project classpath. Not doing so will cause the compilation process to fail and hence the plugin won’t be
deployed to OIM. So please make sure you have these JAR files (and any other required JAR files) added to the project classpath.
OIM 11g Workshop - Lab 5
The following are the files which are required for this project along with the location where they can be found on the OIM server.
oimclient.jar (/odrive/oracle/oim11g_MWH/Oracle_IDM1/server/client/oimclient.jar)
OIMServer.jar (/odrive/oracle/oim11g_MWH/Oracle_IDM1/server/apps/oim.ear/APP-INF/lib/OIMServer.jar)
2.2.Deployment Procedure
2.2.1. Deploy Event Handlers
4
Before trying to deploy any project, please make sure you have added the
dependent JAR files in the project classpath.
To perform single click deployment of implemented plug-in in JDeveloper,
“Tools” -> “OIM customization installer”-> “Deploy”
6
Let’s check Plugin table in OIM DB:
There should be 2 entries highlighted in RED.
Let’s check the relationship between plugin.xml definition and Plugin table in OIM DB.
OIM 11g Workshop - Lab 5
8
OIM 11g Workshop - Lab 5
Purpose
This step describes the procedure to create following OIM Metadata
Steps
2.4.1. Configure Email Server IT Resource
Note : If this training content is being used by people who do not work for Oracle and therefore do not have Oracle email ids,
should go for using a JES (Java Email Server) based mail server installed and configured in the Training VM environment. Lab 1
contains the details about running this particular Email Server and using it with OIM.
10
Make sure the e-mail notifications can be sent successfully.
2.4.2. Modify OOB Generate Password Notification Email Template
Modify and Save notification template associated with auto-generated password so as to receive custom message as seen in the
image below:
OIM 11g Workshop - Lab 5
12
Note: The example above uses [email protected] as sample and should be replaced with a valid Administrator e-mail address.
2.4.3. Create RoleGrantedNotificationTemplate and Associate it with RoleGrantedNotificationEvent
Create Notification template, containing content to be sent in notification for this event, using the Notification UI. The Template
would be created in default locale. In this sample, it is English.
* Encoding : UTF-8
* Message subject:
* Type : HTML
* Long Message :
<html>
<head></head>
<body>
OIM 11g Workshop - Lab 5
<p>
</p><p>
</p><p>
</p>
</body></html>
- Click "Save"
14
OIM 11g Workshop - Lab 5
Fig: Screenshot showing how to select available data and use it inside template.
[NOTES:
16
1. Keep template Name as ‘RoleGrantedNotificationTemplate’ as it is getting used inside sample. In case you want to use a
different name, please modify following line inside RoleGrantNotificationEvent.java:
2. ‘UGP_ROLENAME’ attribute used in the template is not available in available data drop-down but is used explicitly in the
notification resolver class for role name. To change it, please modify following line inside
RoleGrantNotificationEventResolver.java:
resolvedData.put("UGP_ROLENAME", role.getName());
3. Add a locale in the above created template if you want the notification to be sent in some other locale other than the default
one.
18
OIM 11g Workshop - Lab 5
1. Log into OIM Administrative console and navigate to “Create User” page.
20
OIM 11g Workshop - Lab 5
4. Check email account that was provided in Step 2 for the email notification as seen below.
22
OIM 11g Workshop - Lab 5
Note: For testing purpose provide your valid E-Mail ID to receive e-mail.
24
OIM 11g Workshop - Lab 5
26
OIM 11g Workshop - Lab 5
5. Check the E-mail notification being sent to the E-Mail ID that was provided on User creation.
28