Previous | Next | Contents | Index | Glossary | Library |
procedure VerifyAuthority ( | itemtype | in varchar2, | |||
itemkey | in varchar2, | ||||
actid | in number, | ||||
funcmode | in varchar2, | ||||
resultout | out varchar2 ) is | ||||
1-> | l_forward_to_username | varchar2(30); | |||
l_requisition_amount | number; | ||||
l_spending_limit | number; | ||||
2-> | begin | ||||
if ( funcmode = 'RUN' ) then | |||||
l_requisition_amount := wf_engine.GetItemAttrNumber ( | |||||
itemtype => itemtype, | |||||
itemkey => itemkey, | |||||
aname => 'REQUISITION_AMOUNT'); | |||||
3-> | l_forward_to_username := wf_engine.GetItemAttrText ( | ||||
itemtype => itemtype, | |||||
itemkey => itemkey, | |||||
aname => 'FORWARD_TO_USERNAME'); | |||||
4-> | if (wf_reqdemo.checkSpendingLimit(l_forward_to_username,l_requisition_amount)) then | ||||
resultout :='COMPLETE:Y'; | |||||
else | |||||
resultout :='COMPLETE:N'; | |||||
end if; | |||||
end if; | |||||
5-> | if (funcmode = 'CANCEL') then | ||||
resultout :='COMPLETE'; | |||||
return; | |||||
end if; | |||||
6-> | if (funcmode = 'TIMEOUT') then | ||||
resultout :='COMPLETE'; | |||||
return; | |||||
end if; | |||||
7-> | exception | ||||
when others then | |||||
wf_core.context('WF_REQDEMO','VerifyAuthority',itemtype, itemkey,actid,funcmode); | |||||
raise; | |||||
8-> | end VerifyAuthority; |
1-> The local arguments l_forward_to_username, l_requisition_amount, and l_spending_limit are declared in this section.
2-> If the value of funcmode is equal to RUN, then assign l_requisition_amount to the value of the REQUISITION_AMOUNT item type attribute, determined by calling the Workflow Engine API GetItemAttrNumber. See: GetItemAttribute.
3-> This section assigns l_forward_to_username to the value of the FORWARD_TO_USERNAME item type attribute, determined by calling the Workflow Engine API GetItemAttrText.
4-> This section calls the function CheckSpendingLimit for the current approver to determine whether the requisition amount is less than or equal to the approver's spending limit. If the requisition amount is less than or equal to the value in l_spending_limit , meaning the approver has authority to approve, then assign resultout to be COMPLETE:Y. Otherwise, assign resultout to be COMPLETE:N.
5-> If the value of funcmode is CANCEL, then assign resultout to be COMPLETE.
6-> If the value of funcmode is TIMEOUT, then assign resultout to be COMPLETE.
7-> This section calls WF_CORE.CONTEXT if an exception occurs.
8-> The VerifyAuthority procedure ends.
Previous | Next | Contents | Index | Glossary | Library |