Saturday, September 26, 2015

How to Configure AME To Route Requisitions to the Requester's (Not Preparer's) Next Position In the Default Position Hierarchy

1) This is only possible via Approvals Management Engine (AME)
2) It will only use the Requester from Line 1.   If there are multiple requisition lines with different requester's, it will still only route to the Requester on Line 1 (there is not a way to change this).
3) The Positions in the hierarchy should only belong to one Employee.  Don't assign multiple Employees to the same Position for best results.
4) Fill Employee Hierarchy must be run anytime a change is made to Employee Position data or to Position Hierarchies (because this method pulls data from PO_EMPLOYEE_HIERARCHIES_ALL which is synched with HR Position data when running that report).
5) The Default Hierarchy must be specified in the Document Types page.
6) This Default Hierarchy is the Position Hierarchy that AME will use for document routing.  In this example configuration the Approval Path (Hierarchy) cannot be changed from this Default Hierarchy. 
7) There can only be one hierarchy used by both Preparer and Requester.

Required AME Setups
NOTE:   This is some extra information about how AME and iProcurement naming conventions work regarding Requester and Preparer and associated AME Attributes.    The Preparer on a Requisition is the user that creates the requisition in the system.   It is stored at the Requisition Header Level.  The Requester on a Requisition is on the Requisition Line level.     In AME, there are Header level attributes (it is important to point out that that are not used in this Note for the functionality we are setting up here, this is just for your information as you may see these when you go through this Note and have questions about them) called;  ALLOW_REQUESTOR_APPROVAL, TRANSACTION_REQUESTOR_PERSON_ID, TRANSACTION_REQUESTOR_POSITION_ID, and TRANSACTION_REQUESTOR_USER_ID.   These have REQUESTER in their attribute names, but they refer to the Preparer of the Requisition and not the Requester on the Requisition Line(s).    In other words, these seeded attributes in the Purchase Requisition Approval Transaction Type in AME that refer to Requester select the Preparer of the Requisition from the Requisition Header.  

1) Create New Attribute called IS_REQUESTOR_DIFFERENT_FROM_PREPARER
Attribute Name
Item Class
Data Type
Usage Type
Value
IS_REQUESTOR_DIFFERENT_FROM_PREPARER
Header
Boolean
Dynamic
SELECT DECODE (COUNT (*), 0, 'false', 'true')
  FROM po_requisition_headers_all prh, po_requisition_lines_all prl
 WHERE     prh.requisition_header_id = prl.requisition_header_id
       AND prh.preparer_id <> prl.to_person_id
       AND prh.requisition_header_id = :transactionId

2) Update Attribute = NON_DEFAULT_STARTING_POINT_POSITION_ID with this value
SELECT peh.superior_position_id
  FROM PO_EMPLOYEE_HIERARCHIES_ALL peh
 WHERE     peh.employee_id =
              (SELECT NVL (to_person_ID, 0)
                 FROM po_requisition_headers_all prh,
                      po_requisition_lines_all prl
                WHERE     prh.REQUISITION_HEADER_ID = (:transactionId)
                      AND prh.requisition_header_id = prl.requisition_header_id
                      AND line_Num = 1
              )
       AND peh.superior_level = 1
       AND position_structure_id IN (SELECT default_approval_path_id
                                       FROM po_document_types_all_b pdt,
                                            po_requisition_headers_all prh
                                      WHERE     pdt.org_id = prh.org_id
                                            AND pdt.document_type_code = 'REQUISITION'
                                            AND document_subtype = prh.type_lookup_code
                                            AND prh.requisition_header_id = :transactionId)

3) Create two new Conditions using new attribute "IS_REQUESTOR_DIFFERENT_FROM_PREPARER"
IS_REQUESTOR_DIFFERENT_FROM_PREPARER is False
IS_REQUESTOR_DIFFERENT_FROM_PREPARER is True

AME Rules
When creating the AME Rules, include this Condition on AME Rules where the Approval List is needed based on the Requester on Line 1 of the Requisition
IS_REQUESTOR_DIFFERENT_FROM_PREPARER is True
Then include this Condition on AME Rules where the Approval List should be based on the Preparer
IS_REQUESTOR_DIFFERENT_FROM_PREPARER is False

Example Business Setup
Business Rule:  If Item = DVD-B100 is on the Requisition and Requisition Preparer is different than the requisition requester then the requisition must be routed up one position level in the requester's approval chain and not the preparers.  If Item = DVD-B100 is on the Requisition and the requester and requisition preparer are the same,  route up one position level in the preparer's approval chain. 

Preparer = CBAKER who has position = BUY501.Buyer 1
Requester (who will be on Requisition line 1( = TGREEN who has position = ACC430.Senior Accountant

In Position Hierarchy named Test Position Hierarchy which is defined as the Default Hierarchy in the Purchase Requisition Document Type (along with setting Approval Transaction Type = PURCHASE_REQ to enable AME)

ACC430.Senior Accountant is subordinate to 1.Position (which is top Position in Hierarchy) and
BUY501.Buyer 1is subordinate to 4.Position (lower in hierarchy)

1.Position
     |
     ACC430.Senior Accountant
     |
     2.Position
             |
             3.Position
             |
             4.Position
                     |
                     BUY501.Buyer 1

1) First AME Rule

Name = item = DVD-8100, go one position level up from requester if preparer <> requester

Condition Condition Type Item Class
ITEM_NUMBER in (DVD-B100) Ordinary Line Item
IS_REQUESTOR_DIFFERENT_FROM_PREPARER is True Ordinary Header

Actions
Action Type Action
HR position level Require approval up to first position up.



2) Second AME Rule

Name = item = DVD-8100, go one position level up from preparer if preparer = requester

Condition Condition Type Item Class
ITEM_NUMBER in (DVD-B100) Ordinary Line Item
IS_REQUESTOR_DIFFERENT_FROM_PREPARER is False Ordinary Header

Actions
Action Type Action
HR position level Require approval up to first position up

Tests
Test 1) As user CBAKER created requisition for item DVD-B100 where requisition line 1 has Requester = CBAKER.   Submitted for approval and the approval list has one approver for Position = 4.Position which is correct
Test 2) As user CBAKER created requisition for item DVD-B100 where requisition line 1 has Requester = TGREEN.   Submitted for approval and the approval list has one approver for Position =  1.Position which is correct.   This example, the requisition was routed up one position level above TGREEN the requester and not CBAKER.

No comments:

Post a Comment

Best Blogger TipsGet Flower Effect