Wednesday, March 13, 2013

How To Write Custom Scheduled Task in OIM11g


1.       Export task.xml to local machine using  weblogicExportMetadata.sh utility.
2. Modify task.xml. Add the following selection  inside  < scheduledTasks > &  </scheduledTasks>

<scheduledTasks>

<task>
<name>DeleteSSLVPNReconTask</name>
<class>com.hssa.oim.scheduledTask.utility.NotificationDemoScheduledTask</class>
<description>Demo Schwedular to run delete recon</description>
<retry>5</retry>
<parameters>
<string-param required="true" encrypted="false" helpText="Provide Group Name">Template Name</string-param>

<string-param required="true" encrypted="false" helpText="Provide userId">User Login</string-param>

</parameters>

</task>

</scheduledTasks>

3.        Import  task.xml  using  weblogicImportMetadata.sh utility
4.       Write a java class extending TaskSupport interface.
5.       Override the execute method.
6.       Cerate the jar of the class.
7.       Keep the class in lib directory
8.      Create plugging .xml as below. The plug-in point should  oracle.iam.scheduler.vo.TaskSupport . And plug-in class should be fully qualified name of the class.

<?xml version="1.0" encoding="UTF-8"?>
<oimplugins xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<plugins pluginpoint="oracle.iam.scheduler.vo.TaskSupport">
<plugin pluginclass= "com.hssa.oim.scheduledTask.utility.DeleteSSLVPNReconTask" version="1.0.1" name="DeleteSSLVPNReconTask">
</plugin>
</plugins>
</oimplugins>

9.     Create a zip file of lib directory and plugging.xml
10. Upload the zip using upload plugging utility.
11.  Go to OIM admin console advance tab. And click on search scheduled job
12.  Click on create to create new schedule task template.
 13.       Provide the job name (any meaning full name) . and  click on the look up for the task

14.        Select the  java task from the lookup .

 15.       Fill other mandatory details and  click on save and run now.





1 comment:

  1. Hi Nirupam,

    Your posts are really very helpful.

    Waiting for some more posts. :)

    -Aparna

    ReplyDelete