Configure the Scheduled Task XML File

Developing Scheduled Tasks 6-3 The elements in the XML file reflect the task parameters that you described in Section 6.2, Define the Metadata for the Scheduled Task . Example 6–1 shows a sample XML code for the scheduled task described in the preceding paragraph. Note that all the parameters are declared to be required parameters in this example. Example 6–1 Sample XML for a Scheduled Task scheduledTasks xmlns=http:xmlns.oracle.comoimscheduler task nameTest_scheduled_taskname classoracle.iam.scheduler.TestSchedulerclass descriptionRetrieve Employee Records For Given Departmentdescription retry5retry parameters string-param required=true helpText=Name of the departmentDepartment Namestring-param string-param required=true encrypted=false helpText=Name of the departmentDepartment Namestring-param number-param required=true helpText=Number of Records to Be RetrievedNumber of Recordsnumber-param boolean-param required=false helpText=Retrieve disabled employee records?Get Disabled Employeesboolean-param parameters task scheduledTasks This is basically exporting the task.xml from MDS and then adding the required tags to it and importing it back into MDS. You must export the task.xml file from MDS, add the required tags to the file, and then import it back to MDS. See Chapter 33, MDS Utilities and User Modifiable Metadata Files for information about exporting and importing MDS files.

6.4 Develop the Scheduled Task Class

The next step is to create a Java class to execute the task whose metadata was defined in the XML file. The Java class that implements a scheduled task is known as a scheduled task class. To develop a Java class for the scheduled task: 1. Create a Java class file that extends the oracle.iam.scheduler.vo.TaskSupport class and overrides the execute method with processing logic based on your requirements. Note: The scheduled task XML file can be imported into MDS using an Oracle WebLogic Server import utility. In a clustered environment, having the file in MDS avoids the need to copy the file on each node of the cluster. For details about importing files into MDS, see Chapter 33, MDS Utilities and User Modifiable Metadata Files . See Also: Appendix A, Scheduled Task Configuration File for details about the elements in the scheduled task configuration file. 6-4 Oracle Fusion Middleware Developers Guide for Oracle Identity Manager 2. Create a JAR file for the Java class that you created. Name the JAR such that you can readily associate this JAR with your custom scheduled task. The JAR file can contain the dependent classes of the Java class. You can also create a separate JAR file for the dependent classes and place it in the libdirectory. 3. Copy the JAR file into the lib directory. 4. Repeat Steps 1 through 3 for every Java class that you want to create.

6.5 Configure the Plug-in XML File

You must configure the plugin.xml file in order to declare the scheduled task as a plug-in. See Chapter 7, Developing Plug-ins for more information about plug-ins. To configure the plugin.xml file: 1. Create the plugin.xml file by using any text editor. 2. Specify the plug-in point for the scheduled task by changing the value of the pluginpoint attribute of the plugins element to oracle.iam.scheduler.vo.TaskSupport. The following XML code block from the plugin.xml file shows the value entered within the plugins element: plugins pluginpoint=oracle.iam.scheduler.vo.TaskSupport

3. Add a plugin element for each scheduled task that you are adding.

To specify the class that implements the plug-in in this case, the scheduled task, change the value of the pluginclass attribute of the plugin element to the name of the Java class that implements the scheduled task. The following XML code block from the plugin.xml file shows sample values entered within the plugin element: plugin pluginclass= oracle.iam.scheduler.TestScheduler version=1.0.1 name=scheduler element After modification, the plugin.xml file looks similar to the following: ?xml version=1.0 encoding=UTF-8? oimplugins xmlns:xsi=http:www.w3.org2001XMLSchema-instance plugins pluginpoint=oracle.iam.scheduler.vo.TaskSupport Note: Oracle recommends creating one plugin.xml file for one scheduled task. This is because when the plugin is unregistered, the corresponding package is deleted. Note: Create the plugin.xml file only if no such file exists. If there are existing plugins, then add a new plugin element for the new plugin. Note: For scheduled tasks, the plugins elment remains the same for all scheduled tasks.