Friday 18 October 2013

AME Configuration In Oracle apps

AME  Configuration

Following are the steps to implement AME in R12 instance.
1. Login with SYSADMIN User.
2. Go to User Management Responsibility.
3. Click on Users and query for the username to which you want to assign AMEResponsibilities.
4. One you query the User, Update the User from search results region and then click on Assign Roles.
5. Assign following Roles to the User 
a) Approval Management Administrator
b) Approval Management System Administrator
c) Approval Management Process Owner
d) Approval Management System Viewer
e) Approval Management Business Analyst

Once finished with the Roles we will grant a permission set to the user from Functional Administrator Responsibility. Following are the steps for that

6. Go to Functional Administrator Responsibility => Security => Grants => Create Grant.
7. Enter Name of the "Grant" and effective start date. In Security Context select Grantee Type as Specific User and enter the User name whom you want to assign AMEResponsibilities (Same user to which we assigned AME Roles).
8. Select Object as AME Transaction Types and Press Next.
9. Select Data Context as All Rows and assign "AME Calling Applications" permission set and Save the Information.

We need to set the AME: Installed Profile option as well to make it work. Set this profile option to Yes at application level (Human Resources).

Try to login with the user and you can see the following responsibilities listed there
Approvals Management Administrator
Approvals Management Business Analyst

IRecruitement Interview status Update API

/***API to update the interview status  from PLANNED to CONFIRMED*****/

CREATE OR REPLACE PACKAGE BODY APPS.xx_irc_interview_update_pkg
IS
   PROCEDURE xx_irc_int_update_proc (Ntf_id VARCHAR2)
   IS
      l_inteerview_id           NUMBER;
      l_feedback                VARCHAR2 (300);
      l_notes                   VARCHAR2 (300);
      l_notes_to_candidate      VARCHAR2 (300);
      l_category                VARCHAR2 (100);
      l_result                  VARCHAR2 (100);
      l_event_id                NUMBER;
      l_start_date              DATE;
      l_end_date                DATE;
      l_object_version_number   irc_interview_details.object_version_number%TYPE;
      l_int_date                DATE;
      l_appl_name               VARCHAR2(100);
      l_applicant               VARCHAR2(100);
      l_assignment_id           NUMBER;
      l_int_type                VARCHAR2(30);

      CURSOR c1(p_event_id varchar2)
      IS
         SELECT *
           FROM irc_interview_details
          WHERE event_id = p_event_id AND status = 'PLANNED'
          and sysdate between start_date and end_date ;
   BEGIN
       BEGIN
        select text_value INTO l_event_id from wf_notification_attributes
        where name ='XX_INT_EVENT_ID' and notification_id =Ntf_id;
        EXCEPTION
         WHEN OTHERS
         THEN
            DBMS_OUTPUT.put_line ('Event Does not Exists');
           END;
             
       BEGIN
       l_object_version_number := '';

         SELECT object_version_number
           INTO l_object_version_number
           FROM irc_interview_details
          WHERE event_id = l_event_id AND status = 'PLANNED';
         EXCEPTION
         WHEN OTHERS
         THEN
            DBMS_OUTPUT.put_line ('Object version number Does not Exists');
           END;
       
      FOR c2 IN c1(l_event_id)
      LOOP
       

         irc_interview_details_api.update_irc_interview_details
                   (p_validate                      => FALSE,
                    p_interview_details_id          => c2.interview_details_id,
                    p_status                        => 'CONFIRMED',
                    p_feedback                      => c2.feedback,
                    p_notes                         => c2.notes,
                    p_notes_to_candidate            => c2.notes_to_candidate,
                    p_category                      => c2.CATEGORY,
                    p_result                        => c2.RESULT,
                    p_iid_information_category      => c2.iid_information_category,
                    p_iid_information1              => c2.iid_information1,
                    p_iid_information2              => c2.iid_information2,
                    p_iid_information3              => c2.iid_information3,
                    p_iid_information4              => c2.iid_information4,
                    p_iid_information5              => c2.iid_information5,
                    p_iid_information6              => c2.iid_information6,
                    p_iid_information7              => c2.iid_information7,
                    p_iid_information8              => c2.iid_information8,
                    p_iid_information9              => c2.iid_information9,
                    p_iid_information10             => c2.iid_information10,
                    p_iid_information11             => c2.iid_information11,
                    p_iid_information12             => c2.iid_information12,
                    p_iid_information13             => c2.iid_information13,
                    p_iid_information14             => c2.iid_information14,
                    p_iid_information15             => c2.iid_information15,
                    p_iid_information16             => c2.iid_information16,
                    p_iid_information17             => c2.iid_information17,
                    p_iid_information18             => c2.iid_information18,
                    p_iid_information19             => c2.iid_information19,
                    p_iid_information20             => c2.iid_information20,
                    p_event_id                      => c2.event_id,
                    p_object_version_number         => l_object_version_number,
                    p_start_date                    => l_start_date,
                    p_end_date                      => l_end_date
                   );
         DBMS_OUTPUT.put_line ('objectversion' || l_object_version_number);
      END LOOP;
   END xx_irc_int_update_proc;

   FUNCTION xx_get_message_type (ntf_id NUMBER)
      RETURN VARCHAR2
   IS
      l_message_type   VARCHAR2 (50);
   BEGIN
      BEGIN
         SELECT message_type
           INTO l_message_type
           FROM wf_notifications
          WHERE notification_id = ntf_id;
      EXCEPTION
         WHEN OTHERS
         THEN
            DBMS_OUTPUT.put_line ('Notification Does not Exists');
      END;

      RETURN l_message_type;
   END xx_get_message_type;
END xx_irc_interview_update_pkg;
/