By Shashidhar Malyala on May 13, 2016
After deprecation of entity adapters, everyone know that Oracle has introduced event handlers to perform operations on pre and post of insert, update and delete activities.
By now, almost all OIM developers might have worked on writing Event Handlers pre and post of creating and updating a user/identity profile. This is a very frequent requirement.
There is a chance one might want to write event handler that triggers on account provisioning activities. The blog post is intended to provide an example of how to trigger an event handler on successful provisioning of a resource.
Before getting to the details one must understand there are various operations supported by OIM like Create User, Update User, Provision Account, Disable Account, Create Role, Delete Role, Update Role, Provision Account by Access Policy, Revoke Account etc... and each operation is considered to be a different orchestration.
1. Entry to EventHandler XML file for AP based provisioning:<action-handler
Notice the values for entity-type and operation. The values indicate that the event handler should trigger upon provisioning a resource. The operation value especially indicate that the event handler should trigger only if a resource is provisioned using Access Policy.
2. Entry to EventHandlers XML file for direct provisioning:<action-handler
In this case the value of operation is 'PROVISION'. One can similarly use REVOKE for triggering event handler upon revoking an account.
OTN documentation provides right value for 'operation' and 'entity-type' for certain frequently used operations. In order to find all possible values, use the following and perform the operation:<action-handler
The handler code can print the values for operation and entity-type:
The input parameter to the execute method of event handler differ based on the operations. In case of 'Resource' type use conditional event handler and identify the resource being provisioned in the context. Based on the resource decide whether the actual handler logic is required or not.
Important Note: Using Any/Any is for the properties is not supported. This is for internal purposes only. Using this may have high impact of product performance.