1 2 Previous Next 26 Replies Latest reply on May 15, 2013 2:06 PM by 965440

    Post Process event handler not executed.

      I have written a post process event handler on Create operation. but it is not getting executed. OIM Version:
      My objective is to fetch company code field from user form after creation, check for company name field in lookup and set company name field for the newly created user.

      below is my code in execute method:
      HashMap<String, Object> atrrMap= new HashMap<String, Object>();
                try {
                     String CompanyNamefromLookup =null;
                     String userKey = getUserKey(processId, bulkOrch);
                     Hashtable<String, Object> mhSearchCriteria2 = new Hashtable<String, Object>();
                     mhSearchCriteria2.put("Users.Key", userKey);
                     tcUserOperationsIntf userOperationsintf = (tcUserOperationsIntf)Platform.getService(tcUserOperationsIntf.class);
                     tcResultSet result = userOperationsintf.findUsers(mhSearchCriteria2);
                     String userType = result.getStringValue("Role");
                     String operation = bulkOrch.getOperation();
                     String companyCode = result.getStringValue("USR_UDF_COMPANY_CODE");
                     if (operation.equals(Operations.CREATE.toString())){
                          if (!(companyCode.isEmpty())) {
                                    CompanyNamefromLookup = getDecodeValueFromLookup(companyCode,"Lookup.ExternalUser.Company");
                                         atrrMap.put("Company Name", CompanyNamefromLookup);
                                         userOperationsintf.updateUser(result, atrrMap);
                catch(Exception e)


                return new EventResult();

      here is EventHandler.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <eventhandlers xmlns="http://www.oracle.com/schema/oim/platform/kernel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.oracle.com/schema/oim/platform/kernel orchestration-handlers.xsd">
      <!-- Custom pOSTprocess event handlers -->

      It is not working at all..Also added logger to check whether this method is executed or not but no success.
      Please help me out.
        • 1. Re: Post Process event handler not executed.
          Do you have any other post process event handler running at the same order? If yes try changing the order of execution.
          • 2. Re: Post Process event handler not executed.
            Hi Deepika,

            No we do not have any other post process event handler running with this order.
            • 3. Re: Post Process event handler not executed.
              1. How about the plugin registration? Did it register successfully? Check the PLUGINS table and verify that your event handler is listed there.
              2. Paste the plugin.xml contents.
              3. How are you testing? If you implemented the execute method then test by creating through UI and if you have implemented the bulk execute method then check by trusted recon.

              • 4. Re: Post Process event handler not executed.
                Hi Bikash, Thanks for your reply.

                1. The plugin is registered successfully. It is listed in PLUGINS table.
                Also I hv written few SOP in initialize method. They are executed when oim server starts.

                2. Here is plugin.xml

                <?xml version="1.0" encoding="UTF-8"?>
                <oimplugins xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <plugins pluginpoint="oracle.iam.platform.kernel.spi.EventHandler">
                <plugin pluginclass= "com.oim.eventhandler.ExternalUserPostProcessEventHandler"

                3. I have implemented EventResult execute() method. I tested through UI. After user creattion, event handler doesnt execute. There is no single entry in log.

                • 5. Re: Post Process event handler not executed.
                  Please help.
                  • 6. Re: Post Process event handler not executed.
                    Kevin Pinsky
                    You aren't outputting any error message in your catch statement. Try some debug statements right below the execute method or even in the constructor to say something like 'STARTING EVENTHANDLER...."

                    At this this will tell you if it's running and you can watch the oim_server1.out log file to see the System.out.println messages.


                    You really need to be using the 11g apis, and i couldn't stand seeing how you were doing it. Use this code and tell me how it works:

                    private final static Logger LOGGER = Logger.getLogger(Test.class.getName().toUpperCase());
                    public EventResult execute(long l, long l2, Orchestration orchestration) {
                    String operation = orchestration.getOperation().trim().toString();
                    HashMap<String, Serializable> parameters = orchestration.getParameters();
                    String entityId = orchestration.getTarget().getEntityId();
                    HashMap eventDataHashMap = orchestration.getInterEventData();
                    Identity currentUserState = (Identity) eventDataHashMap.get("CURRENT_USER");

                    LOGGER.log(Level.INFO,"Starting Operation[" + operation + "] Entity[" + orchestration.getTarget().getEntityId() + "] Paramters[" + parameters.toString() + "] EventResult");

                    UserManager userMgr = Platform.getService(UserManager.class);
                    Thor.API.Operations.tcLookupOperationsIntf lookupIntf = Platform.getService(Thor.API.Operations.tcLookupOperationsIntf.class);

                    User user = userMgr.getDetails(entityId, null, false);
                    String userType = currentUserState.getAttributes().get(UserManagerConstants.AttributeName.EMPTYPE.getId()).toString();
                    String companyCode = currentUserState.getAttributes().get("Company Code").toString();

                    if (operation.equals("CREATE")){
                    if (!(companyCode.isEmpty())) {
                    String companyNamefromLookup = lookupIntf.getDecodedValueForEncodedValue(companyCode,"Lookup.ExternalUser.Company");
                    User updateUser = new User(entityId);
                    updateUser.setAttribute("Company Name", companyNamefromLookup);

                    }catch(Exception e){
                    LOGGER.log(Level.WARNING,"ERROR Processing Post Create| ------> " + e.getMessage(), e);

                    LOGGER.log(Level.INFO, "Ending Operation[" + operation + "] EventResult");

                    return new EventResult();

                    1 person found this helpful
                    • 7. Re: Post Process event handler not executed.
                      A Dhiman
                      Please check if the plugin is properly registered in MDS.
                      note OIM accepts the following folders for the event handlers in MDS
                      /metadata and few more.

                      register the eventhandler into one of these folders in MDS
                      • 8. Re: Post Process event handler not executed.
                        Hi Kevin,

                        Thanks for your reply.
                        Actually I am new to OIM, so I am facing such issues.

                        I entered few SOPs in constructor of class. They are not displayed in log file when we create a user.

                        And about the code that u hv given, it can only be checked if this method get executed.

                        Thanks & Regards,
                        • 9. Re: Post Process event handler not executed.
                          Hi Dhiman,

                          Following happens
                          Plugin registration is successful.I can see the initialize() being called during OIM start. SOP in initialize gets printed

                          Following fails
                          The event handler doesn't get triggered as the SOP messages during the execute() are not getting printed.
                          "" <Warning> <oracle.iam.callbacks.common> <IAM-2030146> <[CALLBACKMSG] Are applicable policies present for this async eventhandler ? : false>
                          "" This is all what I see in logs.

                          Is there any problem in EvenetHandler xml file or plugin xml??

                          Thanks & Regards,
                          • 10. Re: Post Process event handler not executed.
                            Hi Kevin,

                            I was just checking out the entry of event handlers in database.. came across a table evt which defines event handlers by providing a process and class name. In addition the scheduling time of when the event handler can execute is set to pre (insert, update, delete) or post (insert, update, delete) is also mentioned.

                            When i run that command it doesn't show this event handler. Instead, all other event handlers are listed there.
                            I think the problem lies with Eventhandler xml file. Checked its namespace also but didn't find anything..

                            Please help.
                            Thanks & Regards,
                            • 11. Re: Post Process event handler not executed.
                              Kevin Pinsky
                              You can put a SOP in the Constructor and if the plugin is registered, it will output there.

                              public UserPostProcessor() {
                              System.out.println("PLUGIN IS RUNNING");

                              • 12. Re: Post Process event handler not executed.
                                A Dhiman
                                The files look good
                                also, can you please let us know to which location have you imported this metadata.xml using the weblogicImportMetadata.sh

                                i have encountered the issue when i imported the xml into /custom/xml.xml location

                                after putting this in /metadata.xml.xml or /db/xml.xml it started working

                                Edited by: A Dhiman on May 3, 2013 7:50 AM
                                • 13. Re: Post Process event handler not executed.
                                  Kevin Pinsky
                                  To add to Alok's with the custom folder, i agree. Don't create a new top level folder. I like to do something liek this:


                                  I create a custom folder within DB with the client name and then have my own structure of files. This way i never have to mess with the existing for any of my custom work.

                                  • 14. Re: Post Process event handler not executed.
                                    Hi Kevin/Alok,

                                    The plugin is registered successfully, I can see SOPs of constructor displayed as output. but no SOPs from execute() method.

                                    I have placed EventHandler xml in db/ folder.

                                    Complete path : /iam/ml_home/OIM/MDS/postprocess/ExternalUserPostProcessEventHandler/eventhandler/db/ExternalUserPostProcessEventHandler.xml

                                    Following is weblogic.properties:






                                    Also, I want to ask one thing: Is it mandatory to keep post process event handler asynchronous??

                                    Thanks & Regards,
                                    1 2 Previous Next