- The process of any Oracle Identity Manager operation that goes through a predefined set of stages and executes some business logic in each stage is called an orchestration.
- An event handler is a piece of code that is registered with an orchestration on various stages. These event handlers are invoked when the relevant orchestration stage is performed.
- The supported orchestration stages in which a custom event handler can be registered are validation, preprocess, and postprocess.
- Code will extend PostProcessHandler, PreprocessHandler or ValidationHandler based on the kind of Event Handler desired.
Code Snippet:-
public
EventResult execute(long processId, long eventId,
Orchestration
orchestration) {
HashMap<String,
Serializable> parameters = orchestration
.getParameters();
String
company = getParamaterValue(parameters, "Company");
if
((company == null) || company.equals("")) {
company
= “ABC”
orchestration.addParameter("Company",
company);
}
return
new EventResult();
}
private
String getParamaterValue(HashMap<String, Serializable> parameters,
String
key) {
if(parameters.containsKey(key)){
String
value = (parameters.get(key) instanceof ContextAware) ? (String) ((ContextAware)
parameters
.get(key)).getObjectValue()
: (String) parameters.get(key);
return
value;
}
else{
return
null;
}
}
After code is developed Event Handler package is created.
Folder Structure:-
Plugin.xml :- Format of Plugin.xml would be as below:
<?xml version="1.0" encoding="UTF-8" ?>
<oimplugins>
<plugins pluginpoint="oracle.iam.platform.kernel.spi.EventHandler">
<plugin pluginclass="com.oracle.oim.utility.eventhandler.PostEventHandler" version="1.0" name="PostEventHandler"/>
</plugins>
</oimplugins>
EventHandler.xml :- Format of Event Handler.xml would be as below:
<?xml version="1.0" encoding="UTF-8"?>
<eventhandlers xsi:schemaLocation="http://www.oracle.com/schema/oim/platform/kernel orchestration-handlers.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.oracle.com/schema/oim/platform/kernel">
<action-handler sync="FALSE" order="1000" name="PostProcessExtensionCreate" operation="CREATE" entity-type="User" class="com.oracle.oim.utility.eventhandler.PostEventHandler" stage="postprocess"/>
<action-handler sync="FALSE" order="1000" name="PostProcessExtensionModify" operation="MODIFY" entity-type="User" class="com.oracle.oim.utility.eventhandler.PostEventHandler" stage="postprocess"/>
</eventhandlers>
After code and xmls are developed and packaged it is registered with Oracle Identity Manager and can be tested.
Such a nice thing you had provided here. While hiring with the people for certain position, these are the things to keep in mind. Thank you very much for providing this here. And i am expecting much more information from you
ReplyDeleteStaffing Companies in Bangalore