Oracle Identity Manager Developing Custom Scheduled Tasks

Oracle Identity Manager contains a set of predefined tasks that can be scheduled as job runs. OIM also provides the capability of creating your own scheduled tasks. You can create scheduled tasks according to your requirements if none of the predefined scheduled tasks fit your needs.You can develop various scheduled task such as reconciliation, user expire date check and etc.

In this post, I will explain create a custom scheduled task for check user's expire date. This jobs send notification to user's manager two weeks before end date.

Steps for create new schedule tasks;

  1. Create schedule task java class.

This class extends from OIM API's oracle.iam.scheduler.vo.TaskSupport. And override execute method for processing logic based on your requirements.

public class ExpireCheckJob extends TaskSupport {

    public ExpireCheckJob() {



    public void execute(HashMap hashMap) throws Exception{


             List<HashMap<String, String>> usrlist = new ArrayList<HashMap<String, String>>();

             usrlist = getusersExpireToday();

             for (int i = 0; i < usrlist.size(); i++) {

                     User userDetails = usrlist.get(i);



        }catch(Exception e){




    public HashMap getAttributes() {

        return null;


    public void setAttributes() {


2.Create the plugin.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<oimplugins xmlns:xsi="">
    <plugins pluginpoint="oracle.iam.scheduler.vo.TaskSupport">
            <plugin pluginclass="" version="1.0" name="ExpireCheckJob"/>

For example, you can configure a reconciliation run using a scheduled task that checks for new information on target systems periodically and replicates the data in Oracle Identity Manager.

 3.  Create a file which contains jar and plugin.xml



4. Copy this zip file to OIM_HOME/server/plugins

5.  Copy jar file to OIM_HOME/server/ScheduleTask

6.  Configuring the schedule task xml file

This xml defines schedule task information.

<?xml version="1.0" encoding="UTF-8"?>
<xl-ddm-data version="" user="XELSYSADM" database="jdbc:oracle:thin:@trkist01-odb-01:1521/MIDM" exported-date="1342018530943" description="ExpireCheckJob">
     <scheduledTask repo-type="MDS" name="ExpireCheckJob" mds-path="/db" mds-file="ExpireCheckJob.xml">
               <scheduledTasks xmlns="">

Import the schedule task xml file via OIM Sysadmin console.

7.Create a new schedule task from OIM Sysadmin console.

First log in to Oracle Identity System Administration with the appropriate credentials.

1.In the left pane, under System Management, click Scheduler. The Advanced Administration is displayed with the Scheduler section in the System Management tab active. 

2. On the left pane, from the Actions menu, select Create. Alternatively, you can click the icon with the plus (+) sign beside the View list.

Job Name: Enter a name for the job.For our example : Expire Date Check

Task: Specify the name of the scheduled task that runs the job. For our example : ExpireDateCheckJob

* To search and specify a scheduled task:

1. Click the magnifying glass icon next to this field.

3. In the Search and Select : Scheduled Task dialog box, specify a search criterion for the scheduled task and click the icon next to Search field.A list of all scheduled tasks that meet the search criterion is displayed.

1. From this list, select the scheduled task that runs the job being created, and then click Confirm.

Start Date: Specify the date and time on which you want the job to run. To do this, select the date and time along with timezone from the date editor and click Ok. By default, the timezone is "(UTC-08:00) US Pacific Time".

Retries: Retry count is used to manage the job in case of failure. A job cannot execute more than its retry count if it fails consecutively. The job is disabled if it fails consecutively till its retry count is exhausted. The job must be enabled from the UI for further execution.

Schedule Type: Depending on the frequency at which you want the job to run, select one of the following schedule types:

Periodic: Select this option if you want the job to be run at a time that you specify, on a repeating basis. If you select this option, then you must enter an integer value in the Run every field under the Job Periodic Settings section and select one of the following values:

 - mins
                         - hrs
                         - days

Cron: Select this option if you want the job to be run at a particular interval on a recurring basis. For example, you can create a job that must run at 8:00 A.M. every Monday through Friday or at 1:30 A.M. every last Friday of the month.

* The recurrence of the job must be specified in the Cron Settings section. In the Recurring Interval field, you can select any of the following values:
- Daily
- Weekly
- Monthly on given dates
- Monthly on given weekdays
- Yearly
After selecting a value, you can enter an integer value in the Days between runs field.

Single: Select this option if the job is to be run only once at the specified start date and time.

  No pre-defined schedule: This option specifies that no schedule is attached to the job you are creating, and therefore, it is not triggered automatically. As a result, the only option to trigger the job is by clicking Save and Run Now.

About me:

Mustafa Kaya is a Senior Consultant in Oracle Fusion Middleware Team, living in Istanbul. Before coming to Oracle, he worked in teams developing web applications and backend services at a telco company. He is a Java technology enthusiast, software engineer and addicted to learn new technologies,develop new ideas.

Follow Mustafa on Twitter,Connect on LinkedIn, and visit his site for Oracle Fusion Middleware related tips.


I came across your blog while searching for an example on sending a notification when a schedule task occurs. In my case, password expire warning, but needing to pass extra information to the notification template.

While looking at your example, you mentioned sendNotificationToUserManager(user), but never included that section of code, nor how it calls the email notification. Do you have the complete code?


Posted by Scott on September 17, 2014 at 04:38 PM EDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Get the latest on all things Oracle PaaS and Fusion Middleware. Join Oracle's PaaS/Middleware Community today.

Find Us on facebook Follow us on twitter Catch Us on YouTube 


« July 2016