9 Replies Latest reply: Mar 27, 2013 3:20 AM by Jani Rautiainen-Oracle RSS

    How to create custom events in OIM

    Greedy Panda
      Hi

      We have a requirement to create new notification templates with custom events to send email notifications.

      How should I create a custom event, any pointers are highly appreciated.

      Thanks
      Nagendra
        • 1. Re: How to create custom events in OIM
          Jani Rautiainen-Oracle
          Can you elaborate on the "custom event" requirement ? I.e. what should trigger the event, what would subscribe to the event and what kind of processing would be done based on the event ?
          The [url http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/toc.htm]Fusion Middleware Developers Guide for Oracle Identity Manager contains information on various ways to integrate e.g.:

          * [url http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/notevents.htm#BEIBDIAA]Developing Notification Events which is described as "You can create new notification templates and link them to the existing events. In addition, you can define new notification events by using notification APIs"
          * [url http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/callbacks.htm#CIHCGAGA]Using the Callback Service which is described as "The callback service triggers notifications and callbacks that allow external applications to perform some action as a part of Oracle Identity Manager event processing."
          * [url http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/plugins.htm#CHDFHIGE]Developing Plug-ins which is described as "The plug-in framework enables you to define, register, and configure plug-ins, which extend the functionality provided by features. For example, user creation is a business operation in Oracle Identity Manager. But this operation exposes a plug-in point for user name generation. If you want to model your custom logic of user name generation, then you must identify the plug-in point specifications and develop a plug-in accordingly."
          * [url http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/oper.htm#CCHFBGAA]Developing Event Handlers which is described as "This chapter describes the concepts related to orchestration and how to write custom event handlers to extend the functionalities of Oracle Identity Manager."
          * [url http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/creadp.htm#BABBCFFB]Using the Adapter Factory which is described as "Adapters are Java programs that enable you to integrate Oracle Identity Manager with other software solutions. "

          --
          Jani Rautiainen
          Fusion Applications Developer Relations
          https://blogs.oracle.com/fadevrel/
          • 2. Re: How to create custom events in OIM
            Greedy Panda
            Hi Jani

            Thanks for the pointers.

            Please see a brief on the requirement.

            1. There is a seeded Manager Status report provided by Fusion Apps. When a report is generated for a particular manager status there should be a button provided on the report to notify the managers in the report.
            2. Each manager status requires a different notification template and hence the different custom events need to be created.

            Thanks
            Nagendra
            • 3. Re: How to create custom events in OIM
              Jani Rautiainen-Oracle
              The OIM guide contains information on [url http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/understanding.htm#LLBFHHPQ]reporting which is based on BI publisher. [url docs.oracle.com/cd/E28271_01/fusionapps.1111/e16691/ext_bip.htm]Extensibility guide contains details on customizing reports.
              However I am not quite sure if its possible to customize the report as you describe. I am not familiar with the report in question, is it scheduled by ESS or? What is the criteria when the notifications would be sent; is it always manually invoked by the user viewing the report or can it be automated i.e. based on a parameter ?

              --
              Jani Rautiainen
              Fusion Applications Developer Relations
              https://blogs.oracle.com/fadevrel/
              • 4. Re: How to create custom events in OIM
                Greedy Panda
                Hi Jani

                I am not quite sure if the seeded report is BI report. How do we find the kind of report in Fusion.

                Anyways, please find below the navigation for this report

                Navigator -> Compensation -> View Administrator Reports -> Select a compensation plan

                You will see a list of reports available. Select Manager Status report under Status and Monitoring.

                This will show report in two tabs Summary and Details.

                In Details tab, a button needs to be provided.

                The report is not scheduled by ESS. Its a page where user manually selects a status and the report is generated and viewed on the page.
                User should be provided with a button to trigger the notifications.

                Thanks
                Nagendra
                • 5. Re: How to create custom events in OIM
                  Jani Rautiainen-Oracle
                  Sorry for the confusion, based on the original question I thought you wanted to integrate directly to OIM, however the navigation path provided points to HCM logic. I.e. based on the blog post
                  [url https://blogs.oracle.com/fadevrel/entry/finding_code_artifacts_for_customization]Finding Code Artifacts for Customization (Part 1) you can find the region to customized ("/oracle/apps/hcm/compensation/workbench/ui/adminReports/page/ManagerStatus.jsff"). Adding a custom button to the region invoking custom logic should be straightforward.
                  That said I am now unclear what the "custom events in OIM" means in this context; i.e. the report is HCM logic and content comes from a VO. Assuming the button was added to the detail tab, exactly what should happen when the button is pressed ?

                  --
                  Jani Rautiainen
                  Fusion Applications Developer Relations
                  https://blogs.oracle.com/fadevrel/
                  • 6. Re: How to create custom events in OIM
                    Greedy Panda
                    Hi Jani

                    Thanks for confirming its hcm logic based on ADF.
                    Coming to the other part, When the button is clicked it should open a dialog/popup asking the user to confirm notifying the managers. Once the user confirms it should pick the managers on the report for a selected manager status and notify them.

                    We need to define the custom notification templates in OIM for each manager status and use the notification template for sending the emails.

                    Thanks
                    Nagendra
                    • 7. Re: How to create custom events in OIM
                      Jani Rautiainen-Oracle
                      I am still unclear about the relationship between this report and OIM; as stated OIM allows you to create [url http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/notevents.htm#BEIBDIAA]Custom Notification Events however generally the invocation of them is tied to the [url http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/oper.htm#CCHFBGAA]custom event handler which in turn are tied to OIM operations. In this case AFAIK there is no OIM operation rather the HCM application is querying user data combined with data from HCM. Is the requirement to use the OIM notification feature or can you use other alternatives e.g. [url http://fmwdocs.us.oracle.com/doclibs/fmw/E10285_01/dev.1111/e10224/ns_ws_api.htm#SOASE87208]UMS ?
                      I think you could invoke a custom OIM event using the [url http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/apis.htm]OIM APIs specifically using the [url http://docs.oracle.com/cd/E21764_01/apirefs.1111/e17334/oracle/iam/notification/api/NotificationService.html]notification service (for details of related classes refer to the [url http://docs.oracle.com/cd/E21764_01/apirefs.1111/e17334/toc.htm]javadoc).
                      However I have not tested this and was unable to find a concrete example from the documentation. Pseudo logic should be something like this:
                        Hashtable env = new Hashtable();
                        env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL, "weblogic.jndi.WLInitialContextFactory");
                        env.put(OIMClient.JAVA_NAMING_PROVIDER_URL, http://OIM_HOSTNAME:OIM_PORT);
                        OIMClient oimClient = new OIMClient(env);
                        oimClient.login(OIM_USERNAME, OIM_PASSWORD);
                      
                        NotificationEvent event = new NotificationEvent();
                        event.setUserIds(new String[]{"receiverUserId"});
                        event.setTemplateName("Template Name");
                        event.setSender(null);
                      
                        NotificationService notificationService = oimClient.getService(NotificationService.class);
                        notificationService.notify(event);
                      Do note that this is provided as illustration and if adopted you will need to implement proper exception handling, store credentials in [url http://docs.oracle.com/cd/E29505_01/core.1111/e10043/devcsf.htm]CSF etc.
                      --
                      Jani Rautiainen
                      Fusion Applications Developer Relations
                      https://blogs.oracle.com/fadevrel/
                      • 8. Re: How to create custom events in OIM
                        Greedy Panda
                        Hi Jani

                        Thanks a lot for the details.

                        Can you please let me know the alternative approaches available in fusion for notifications?

                        Thanks
                        Nagendra
                        • 9. Re: How to create custom events in OIM
                          Jani Rautiainen-Oracle
                          Depends a bit on the requirements; a common pattern is the [url http://docs.oracle.com/cd/E14571_01/integration.1111/e10224/bp_introhwf.htm]Human Workflow when human interaction is required. What is the purpose of the notification sent; is the recipient expected to take action based on it ?
                          --
                          Jani Rautiainen
                          Fusion Applications Developer Relations
                          https://blogs.oracle.com/fadevrel/