29 July 2014

Concurrent Business Events

Follow below steps to enable Business Events for concurrent jobs.

Step 1) Set the Profile Option 'Concurrent: Business Intelligence Integration Enable' to Yes.

Step 2) Enable Required business events in Concurrent Programs Definitions.

Step 3) Add the subscription to the business event

Step 4) Sample Subscription

        FUNCTION process
        (
                p_sub_guid in RAW,
                p_event in out WF_EVENT_T
        )RETURN VARCHAR2
        IS
                l_event_data            CLOB;
                l_request_id            NUMBER;
                l_sub_request_id        NUMBER;
               
                l_event_name            VARCHAR2(100);
                l_status                VARCHAR2(100)   := 'SUCCESS';
                l_err_msg               VARCHAR2(1000);
        BEGIN
                l_event_data    := p_event.GETEVENTDATA();
               
                l_event_name    := p_event.GETEVENTNAME();
               
                IF (p_event.GETEVENTNAME() = 'oracle.apps.fnd.concurrent.request.completed')
                THEN
                        l_request_id := TO_NUMBER(p_event.getvalueforparameter('REQUEST_ID'));
                END IF;
               
                IF l_request_id IS NOT NULL
                THEN
                    /* Start Custom Business Validation */   
                   
                    /* End Custom Business Validation */   
                END IF;
               
               
                COMMIT;
                RETURN (l_status);
        EXCEPTION
                WHEN OTHERS THEN
               
                        l_err_msg := SQLERRM;
                       
                        l_status := 'ERROR';
               
                        RAISE_APPLICATION_ERROR(-20003, l_err_msg);    
                       
                        COMMIT;
                       
                        RETURN (l_status);
        END process;









No comments: