Usage of MDS Utility in OIM 11g

To write additional event handlers for any kernel operations, we need to define this event handler in an XML file and seed it into MDS.

For example, if we  need to write a pre-process event handler on the user create operation to generate the user ID. A sample event handler definition would be like this:

<eventhandlers>
<preprocess-handler
entity-type="User"
operation="CREATE"
name="Compute User ID"
order="1001"
stage="preprocess"
sync="TRUE">
</preprocess-handler>  
</eventhandlers>

Wevwould put this content in an XML file called EventHandlers.xml and place it in a directory, such as /scratch/data with a path such as /metadata/user/custom/.

Note:

Only Oracle Identity Manager looks into MDS with file paths starting with /metadata or /db. So, make sure that starting path/folder name for any XML document is either one of these

To import the file into MDS, modify the following values in the weblogic.properties file and run the weblogicImportMetadata.sh/weblogicImportMetadata.bat file:

wls_servername=oim server name, for example oim_server1
application_name=oim
metadata_from_loc=/scratch/data

The above metadata/XML file is imported into MDS with the full path /metadata/user/custom/EventHandlers.xml.Lets say you want to update the document and change the order in which this event handler is executed. First, export the document by modifying the following values in the weblogic.properties file and running theweblogicExportMetadata.sh/weblogicExportMetadata.bat file:

wls_servername=oim server name, for example oim_server1
application_name=oim
metadata_to_loc=/scratch/data
metadata_files=/metadata/user/custom/EventHandlers.xml

The document will be exported to the /scratch/data/metadata/user/custom folder. Under /scratch/data, if the folder structure /metadata/user/custom does not exist, MDS will create it.

You can now edit the file to change the order and run the import command as describe above.

Finally, suppose you decide that instead of being computed, the user ID should be specified during user creation. In that case, this document/XML needs to be deleted. To delete the document, modify the following values in the weblogic.properties file and run the weblogicDeleteMetadata.sh/weblogicDeleteMetadata.bat file:

wls_servername=oim server name, for example oim_server1
application_name=oim
metadata_files=/metadata/user/custom/EventHandlers.xml

Leave a Reply

Your email address will not be published. Required fields are marked *