Professional Documents
Culture Documents
Approvals Document - Compressed
Approvals Document - Compressed
1. Create Table
XXWINFO_INVOICE_AME_HEADERS
XXWINFO_INVOICE_AME_LINES
2. AME SETUPS
1. Providing AME Application Access to USER
AME is Approval Management Engine. AME uses the Role Based Access Model (RBAC) to
provide users access to AME functions.
The User needs to have the following roles and responsibilities to access AME functions.
Roles:
Responsibilities:
Provide the values for the mandatory attributes (seeded) and click on Next.
Review the details and click on Next.
4. Create Attributes
Navigate to Approvals Management Business Analyst
Select The transaction Type and click on Attributes
Click on Create
Create the attributes required
Invoice Amount
Invoice Type
Profit_loss_account(balance_sheet Y/N)
Create Conditions
Click on Conditions Tab
Click on Create
Create the required Conditions (need to create the conditions for attributes)
Select required Action Type and click on continue and then click on Finish
7. Create Rules
Click on Rules Tab and click on create.
Provide the Details and click on Next
Click on Next
Click on Next.
Review the details and click on Finish.
2. Create Workflow
Create Item Type
Click File -> New
Lwgth
Type
Value
OK Cancel
Typee Invoice ID
Length
Defau\
Type
Value
OK Cancel
Create Lookups, Lookup Codes
Right click on Lookup Types and click on NEW
, Oracle Workflow Builder 2.Fx3.0.1
' fii\e d’ft j’iew window }]efp
. Hdden ype
Provide the details and click on “OK”
Similarly right click on the lookup create and create lookup codes.
N av'ig ato r Ca ntroI Propertie s
OK Cancelt
Navigator Control Properties
completed
! LookupCoda
Pending
OF CBnceI Help
Create Message Type
Right click on Message and click on New Message
Create Notification
Right click on Notification and click on New Notification.
Attach the lookup type and Message Type.
Create Process
Click on browse
Select WFSTD Workflow
Click on open
Drag and drop Start and End Functions from the Standard Package.
As we attached the Lookup type to the Notification, while dragging from Notification
Function we need to select the option.(Response from the notification)
Build the workflow according to the requirement.
========================================================================
create or replace PACKAGE XX_WIN_PKG_BG_LOGIC_INVOKE IS
PROCEDURE PR_APPROVED_WF_STATUS(
p_item_type in varchar2,
p_item_key in varchar2,
p_act_id in varchar2,
p_funcmode in varchar2,
RESULT OUT NOCOPY VARCHAR2);
PROCEDURE PR_REJECTED_WF_STATUS(
p_item_type in varchar2,
p_item_key in varchar2,
p_act_id in varchar2,
p_funcmode in varchar2,
RESULT OUT NOCOPY VARCHAR2);
END;
p_invoice_id number;
p_user varchar2(200);
cursor app_list(p_invoice_id number) is select aprrover_id, invoice_id , status ,
no_of_approvers,
response_count, concatenated_app_list from (select aprrover_id, invoice_id , status ,
no_of_approvers,
response_count, concatenated_app_list from XX_WIN_APPROV_STATUS
where invoice_id = p_invoice_id and status = 'Pending' order by aprrover_id) where
rownum = 1;
c1 app_list%rowtype;
BEGIN
IF (p_funcmode <> 'RUN') THEN RETURN;
END IF;
select wf_engine.GetItemAttrText(itemtype => p_item_type,
itemkey => p_item_key,
aname => 'INVOICEID'
),
wf_engine.GetItemAttrText(itemtype => p_item_type,
itemkey => p_item_key,
aname => 'XXAPR'
)into p_invoice_id, p_user from dual;
--RESULT := 'COMPLETE';
update XX_WIN_APPROV_STATUS set status = 'Approved' where invoice_id = p_invoice_id
and concatenated_app_list = p_user;
open app_list(p_invoice_id);
fetch app_list into c1;
if app_list%notfound then
update XXWINFO_INVOICE_AME_HEADERS set approval_status = 'Approved' where
UNIT_INVOICE_HEADER_ID = p_invoice_id;
commit;
RESULT := 'COMPLETED';
else
t_HEADERS t_inv_headers_type;
L_Next_Approver Ame_Util.Approverrecord;
approversOut ame_util.approversTable;
p_user varchar2(200);
p_item_type varchar2(200) := 'XXARINV';
p_item_key number;
p_s varchar2(20);
AFTER EACH ROW IS
BEGIN
t_HEADERS (t_HEADERS.COUNT + 1).UNIT_INVOICE_HEADER_ID :=
:NEW.UNIT_INVOICE_HEADER_ID;
t_HEADERS (t_HEADERS.COUNT).APPROVAL_STATUS :=
:NEW.APPROVAL_STATUS;
END AFTER EACH ROW;
AFTER STATEMENT IS
BEGIN
FOR indx IN 1 .. t_HEADERS.COUNT
LOOP
select approval_seq.nextval into p_item_key from dual;
Ame_Api.Getallapprovers(222, t_HEADERS
(indx).UNIT_INVOICE_HEADER_ID
,
'CUSTOM_AR_INVOICE_AME',
approversOut );
pr_call_start_wf(p_item_type , p_item_key, t_HEADERS
(indx).UNIT_INVOICE_HEADER_ID, approversOut );
END LOOP;
===========================================================
IF ( i = 1 ) THEN
wf_engine.setitemattrtext(itemtype => p_item_type, itemkey
=> p_item_key, aname => 'XXAPR', avalue => p_user);
);
END IF;
END LOOP;
wf_engine.startprocess(p_item_type, p_item_key);
dbms_output.put_line('Process started');
COMMIT;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error in set owner process:' || sqlerrm);
END;
=======================================================