Calling next approver from AME

Oracle Approvals Manager(AME) can be used to define approvers for Oracle Workflow.

The following procedure could be used for getting the Next Approver from AME:

declare

l_next_approver AME_UTIL.approverRecord;
Begin
Ame_Api.Getnextapprover ( 20003, —applicationId
   1325, — transactionId
   ‘ASSET’,—transactionType
   L_Next_Approver —Out Parameter
   ) ;
dbms_output.put_line(L_Next_Approver.person_id);
End;

After the 1st level of hierarchy is got we need to call the following code to delete the present Approver:

Note  : without calling this we will not be able to get the  next level of approver even when we call the getnext approver again

  Declare
  L_Next_Approver Ame_Util.Approverrecord;
  Begin
  L_Next_Approver.person_id :=23907; 
  Ame_Api.Deleteapprover(20003, –applicationIdIn
                           1325, –transactionIdIn
                           L_Next_Approver,
                           ‘ASSET’ —transactionTypeIn
                           );
                          
  —   Dbms_Output.Put_Line(L_Next_Approver.Person_Id);
  End;

 Process Flow :

call getnextapproverto get 1st  level of approver–> call deleteapprover —> call getnextapprover to get 2nd level of approver

The following code could be used to get all approvers

  declare 
  L_Next_Approver Ame_Util.Approverrecord;    
    approversOut ame_util.approversTable;
  Begin
  Ame_Api.Getallapprovers(20003, — application_id
                            1324,–  transactionId,
                             ‘ASSET’,– Transactiontype
                              approversOut );
                             
  for i in approversOut.first..approversOut.last
  Loop
    Dbms_Output.Put_Line(I||’-‘||Approversout(I).Person_Id);
    Dbms_Output.Put_Line(I||’-‘||Approversout(I).authority);
  end loop;
 
End ;

Note: Set the default Attrtibute in AME for delete present approver.This delete approver only works for the present transaction.

ALLOW_DELETING_RULE_GENERATED_APPROVERS to true

Advertisements

7 thoughts on “Calling next approver from AME

  1. Could you please advice about these fields mentioned in the document.

    1325, — transactionId
    ‘ASSET’,—transactionType

    where are they mapped in the tables.
    i tried with transaction id, itemkey, itemtype, transaction type fields in the table. But no record found was coming.

  2. From which field i can get AME transaction type from, Could you please guide me.
    FOR Hrms, Passport approval. I have issue in implementing the HR approval.
    We are doing a mobile apps integration with Oracle HRMS.
    I would like to map with the fileds from tables. I tried to take the trasnaction type and transaction id from hr_api_transaction table but it was not working.

  3. Could you please advice following:
    1. by approval through AME, we could be able to send notifications.
    2. What are the steps to send notifications through AME.

  4. Currently for Leave approval, i am using the existing work flow. I am able to initiate the work flow successfully.
    The following are the steps followed in the application –
    1. Get Next Approver from the AME parallel process API
    2. Call AME Parallel Process – Update approval process API.
    I am not getting any exceptions during the call. I can see the records in the AME history tables. But the record is not getting deleted from hr_api_transaction tables nor the records are not available in the wf_notifications table.
    Not able to figure out what went wrong.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s