195: vl_approver_username,
196: vl_approver_dispname);
197:
198: -- Call to the Create Process
199: Wf_Engine.CreateProcess(ItemType => vg_itemtype,
200: ItemKey => vg_itemkey,
201: Process => 'FV_BEAP');
202:
203: -- Set the ItemUserKey
200: ItemKey => vg_itemkey,
201: Process => 'FV_BEAP');
202:
203: -- Set the ItemUserKey
204: Wf_Engine.SetItemUserKey(ItemType => vg_itemtype,
205: ItemKey => vg_itemkey,
206: UserKey => vl_doc_number);
207:
208: -- Set all the attributes
205: ItemKey => vg_itemkey,
206: UserKey => vl_doc_number);
207:
208: -- Set all the attributes
209: Wf_Engine.SetItemAttrNumber(ItemType => vg_itemtype,
210: ItemKey => vg_itemkey,
211: AName => 'SOB',
212: AValue => p_sob_id );
213:
210: ItemKey => vg_itemkey,
211: AName => 'SOB',
212: AValue => p_sob_id );
213:
214: Wf_Engine.SetItemAttrNumber(ItemType => vg_itemtype,
215: ItemKey => vg_itemkey,
216: AName => 'DOC_ID',
217: AValue => p_doc_id );
218:
215: ItemKey => vg_itemkey,
216: AName => 'DOC_ID',
217: AValue => p_doc_id );
218:
219: Wf_Engine.SetItemAttrNumber(ItemType => vg_itemtype,
220: ItemKey => vg_itemkey,
221: AName => 'SUBMITTER_ID',
222: AValue => p_submitter_id );
223:
220: ItemKey => vg_itemkey,
221: AName => 'SUBMITTER_ID',
222: AValue => p_submitter_id );
223:
224: Wf_Engine.SetItemAttrNumber(ItemType => vg_itemtype,
225: ItemKey => vg_itemkey,
226: AName => 'APPROVER_ID',
227: AValue => p_approver_id );
228:
225: ItemKey => vg_itemkey,
226: AName => 'APPROVER_ID',
227: AValue => p_approver_id );
228:
229: Wf_Engine.SetItemAttrNumber(ItemType => vg_itemtype,
230: ItemKey => vg_itemkey,
231: AName => 'TO_RPR_DOC_ID',
232: AValue => p_to_rpr_doc_id );
233:
230: ItemKey => vg_itemkey,
231: AName => 'TO_RPR_DOC_ID',
232: AValue => p_to_rpr_doc_id );
233:
234: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
235: ItemKey => vg_itemkey,
236: AName => 'NOTE',
237: AValue => p_note );
238:
235: ItemKey => vg_itemkey,
236: AName => 'NOTE',
237: AValue => p_note );
238:
239: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
240: ItemKey => vg_itemkey,
241: AName => 'SUBMITTER_NAME',
242: AValue => vl_submitter_username );
243:
240: ItemKey => vg_itemkey,
241: AName => 'SUBMITTER_NAME',
242: AValue => vl_submitter_username );
243:
244: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
245: ItemKey => vg_itemkey,
246: AName => 'SUBMITTER_DISP_NAME',
247: AValue => vl_submitter_dispname );
248:
245: ItemKey => vg_itemkey,
246: AName => 'SUBMITTER_DISP_NAME',
247: AValue => vl_submitter_dispname );
248:
249: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
250: ItemKey => vg_itemkey,
251: AName => 'APPROVER_NAME',
252: AValue => vl_approver_username );
253:
250: ItemKey => vg_itemkey,
251: AName => 'APPROVER_NAME',
252: AValue => vl_approver_username );
253:
254: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
255: ItemKey => vg_itemkey,
256: AName => 'APPROVER_DISP_NAME',
257: AValue => vl_approver_dispname );
258:
255: ItemKey => vg_itemkey,
256: AName => 'APPROVER_DISP_NAME',
257: AValue => vl_approver_dispname );
258:
259: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
260: ItemKey => vg_itemkey,
261: AName => 'DOC_NUMBER',
262: AValue => vl_doc_number );
263:
260: ItemKey => vg_itemkey,
261: AName => 'DOC_NUMBER',
262: AValue => vl_doc_number );
263:
264: Wf_Engine.SetItemAttrNumber(ItemType => vg_itemtype,
265: ItemKey => vg_itemkey,
266: AName => 'REVISION_NUM',
267: AValue => vl_revision_num );
268:
265: ItemKey => vg_itemkey,
266: AName => 'REVISION_NUM',
267: AValue => vl_revision_num );
268:
269: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
270: ItemKey => vg_itemkey,
271: AName => 'TREASURY_SYMBOL',
272: AValue => vl_treasury_symbol );
273:
270: ItemKey => vg_itemkey,
271: AName => 'TREASURY_SYMBOL',
272: AValue => vl_treasury_symbol );
273:
274: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
275: ItemKey => vg_itemkey,
276: AName => 'FUND_VALUE',
277: AValue => vl_fund_value );
278:
275: ItemKey => vg_itemkey,
276: AName => 'FUND_VALUE',
277: AValue => vl_fund_value );
278:
279: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
280: ItemKey => vg_itemkey,
281: AName => 'FROM_DISTRIBUTION',
282: AValue => vl_fund_dist );
283:
280: ItemKey => vg_itemkey,
281: AName => 'FROM_DISTRIBUTION',
282: AValue => vl_fund_dist );
283:
284: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
285: ItemKey => vg_itemkey,
286: AName => 'BUDGET_LEVEL_DESC',
287: AValue => vl_budget_desc );
288:
285: ItemKey => vg_itemkey,
286: AName => 'BUDGET_LEVEL_DESC',
287: AValue => vl_budget_desc );
288:
289: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
290: ItemKey => vg_itemkey,
291: AName => 'RESPONSE_NOTE',
292: AValue => vg_response_note );
293:
290: ItemKey => vg_itemkey,
291: AName => 'RESPONSE_NOTE',
292: AValue => vg_response_note );
293:
294: Wf_Engine.SetItemAttrNumber(ItemType => vg_itemtype,
295: ItemKey => vg_itemkey,
296: AName => 'REVISION_TOTAL',
297: AValue => vl_rev_total );
298:
295: ItemKey => vg_itemkey,
296: AName => 'REVISION_TOTAL',
297: AValue => vl_rev_total );
298:
299: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
300: ItemKey => vg_itemkey,
301: AName => 'REVISION_TOTAL_DISP',
302: AValue => TO_CHAR(vl_rev_total)||' '||
303: vl_curr_code);
301: AName => 'REVISION_TOTAL_DISP',
302: AValue => TO_CHAR(vl_rev_total)||' '||
303: vl_curr_code);
304:
305: Wf_Engine.SetItemAttrText(itemtype => vg_itemtype,
306: itemkey => vg_itemkey,
307: aname => 'TRANSACTION_DETAILS',
308: avalue => 'PLSQL:FV_WF_BE_APPROVAL.GET_TRX_DOC_DETAILS/'|| vg_itemtype ||':'||vg_itemkey );
309:
309:
310: -- Populate #HDR_1(revision total amount), only if header attributes
311: -- are supported.
312: IF (Wf_Core.Translate('WF_HEADER_ATTR') = 'Y') then
313: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
314: ItemKey => vg_itemkey,
315: AName => '#HDR_1',
316: AValue => TO_CHAR(vl_rev_total)||' '||
317: vl_curr_code);
320: -- Disable the relevant attribute that should not be displayed on the
321: -- notifications, based on the budget level id
322: IF (vl_budlevel_id = 1) THEN
323: -- If it is Appropriation Document, then disable the distribution form.
324: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
325: ItemKey => vg_itemkey,
326: AName => 'DIST_FORM_DETAILS',
327: AValue => '' );
328:
328:
329: vl_form_name := 'Appropriation';
330: ELSE
331: -- If it is Distribution Document, then disable the appropriation form.
332: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
333: ItemKey => vg_itemkey,
334: AName => 'TRX_FORM_DETAILS',
335: AValue => '' );
336:
337: vl_form_name := 'Distribution';
338: END IF;
339:
340: -- Set the Budget Level Form Name
341: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
342: ItemKey => vg_itemkey,
343: AName => 'BUDGET_LEVEL_FORM_NAME',
344: AValue => vl_form_name );
345:
343: AName => 'BUDGET_LEVEL_FORM_NAME',
344: AValue => vl_form_name );
345:
346: -- Set the User Id and Responsibility Id
347: Wf_Engine.SetItemAttrNumber(ItemType => vg_itemtype,
348: ItemKey => vg_itemkey,
349: AName => 'USER_ID',
350: AValue => p_user_id );
351:
348: ItemKey => vg_itemkey,
349: AName => 'USER_ID',
350: AValue => p_user_id );
351:
352: Wf_Engine.SetItemAttrNumber(ItemType => vg_itemtype,
353: ItemKey => vg_itemkey,
354: AName => 'RESP_ID',
355: AValue => p_resp_id );
356:
353: ItemKey => vg_itemkey,
354: AName => 'RESP_ID',
355: AValue => p_resp_id );
356:
357: Wf_Engine.SetItemAttrText(ItemType => vg_itemtype,
358: ItemKey => vg_itemkey,
359: AName => '#FROM_ROLE',
360: AValue => vl_submitter_username );
361:
359: AName => '#FROM_ROLE',
360: AValue => vl_submitter_username );
361:
362: -- Call to set the ProcessOwner
363: Wf_Engine.SetItemOwner(itemtype => vg_itemtype,
364: itemkey => vg_itemkey,
365: owner => vl_submitter_username);
366:
367: -- Call to the Start Process
364: itemkey => vg_itemkey,
365: owner => vl_submitter_username);
366:
367: -- Call to the Start Process
368: Wf_Engine.StartProcess(ItemType => vg_itemtype,
369: ItemKey => vg_itemkey);
370:
371: COMMIT;
372:
420: BEGIN
421:
422: IF (funcmode = 'RUN') THEN
423: -- Call to get the sob and doc id item attributes
424: vg_sob_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
425: itemkey => itemkey,
426: aname => 'SOB');
427:
428: vg_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
424: vg_sob_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
425: itemkey => itemkey,
426: aname => 'SOB');
427:
428: vg_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
429: itemkey => itemkey,
430: aname => 'DOC_ID');
431:
432: OPEN get_transtat_cur;
440: FETCH get_desc_cur INTO vl_doc_status_desc;
441: CLOSE get_desc_cur;
442:
443: -- Set the Doc Status Desctiption Attribute
444: Wf_Engine.SetItemAttrText(ItemType => itemtype,
445: ItemKey => itemkey,
446: AName => 'DOC_STATUS',
447: AValue => vl_doc_status_desc );
448: resultout := 'COMPLETE:FAILURE';
473: BEGIN
474:
475: IF (funcmode = 'RUN') THEN
476: -- Call to get the to_rpr_doc_id item attributes
477: vg_to_rpr_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
478: itemkey => itemkey,
479: aname => 'TO_RPR_DOC_ID');
480:
481: IF (vg_to_rpr_doc_id IS NOT NULL) THEN
509: BEGIN
510:
511: IF (funcmode = 'RUN') THEN
512: -- Call to get the to_rpr_doc_id item attributes
513: vg_to_rpr_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
514: itemkey => itemkey,
515: aname => 'TO_RPR_DOC_ID');
516:
517: -- Set the attribute RPR_Trx_Details
514: itemkey => itemkey,
515: aname => 'TO_RPR_DOC_ID');
516:
517: -- Set the attribute RPR_Trx_Details
518: Wf_Engine.SetItemAttrText(itemtype => itemtype,
519: itemkey => itemkey,
520: aname => 'RPR_TRX_DETAILS',
521: avalue => 'PLSQL:FV_WF_BE_APPROVAL.GET_RPR_DOC_DETAILS/'||itemtype||':'||itemkey );
522:
553: BEGIN
554:
555: IF (funcmode = 'RESPOND') THEN
556: -- Call to get the notification_id
557: vl_nid := Wf_Engine.Context_Nid;
558:
559: -- Call to get the sob_id, doc_id,to_rpr_doc_id item attributes
560: vg_sob_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
561: itemkey => itemkey,
556: -- Call to get the notification_id
557: vl_nid := Wf_Engine.Context_Nid;
558:
559: -- Call to get the sob_id, doc_id,to_rpr_doc_id item attributes
560: vg_sob_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
561: itemkey => itemkey,
562: aname => 'SOB');
563:
564: vg_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
560: vg_sob_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
561: itemkey => itemkey,
562: aname => 'SOB');
563:
564: vg_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
565: itemkey => itemkey,
566: aname => 'DOC_ID');
567:
568: vg_to_rpr_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
564: vg_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
565: itemkey => itemkey,
566: aname => 'DOC_ID');
567:
568: vg_to_rpr_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
569: itemkey => itemkey,
570: aname => 'TO_RPR_DOC_ID');
571:
572: vg_response_note := Wf_Engine.GetItemAttrText(itemtype => itemtype,
568: vg_to_rpr_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
569: itemkey => itemkey,
570: aname => 'TO_RPR_DOC_ID');
571:
572: vg_response_note := Wf_Engine.GetItemAttrText(itemtype => itemtype,
573: itemkey => itemkey,
574: aname => 'RESPONSE_NOTE');
575:
576: -- Get the notification result
596: END IF; /* To RPR Doc Id */
597:
598: END IF; /* Reject */
599:
600: resultout := Wf_Engine.Eng_Completed||':'||vl_ntf_result;
601: RETURN;
602:
603: ELSIF (funcmode = 'TRANSFER') THEN
604: resultout := Wf_Engine.Eng_Null;
600: resultout := Wf_Engine.Eng_Completed||':'||vl_ntf_result;
601: RETURN;
602:
603: ELSIF (funcmode = 'TRANSFER') THEN
604: resultout := Wf_Engine.Eng_Null;
605: RETURN;
606:
607: ELSIF (funcmode = 'FORWARD') THEN
608: resultout := Wf_Engine.Eng_Null;
604: resultout := Wf_Engine.Eng_Null;
605: RETURN;
606:
607: ELSIF (funcmode = 'FORWARD') THEN
608: resultout := Wf_Engine.Eng_Null;
609: RETURN;
610:
611: ELSIF (funcmode = 'RUN') THEN
612: resultout := Wf_Engine.Eng_Null;
608: resultout := Wf_Engine.Eng_Null;
609: RETURN;
610:
611: ELSIF (funcmode = 'RUN') THEN
612: resultout := Wf_Engine.Eng_Null;
613: RETURN;
614:
615: ELSIF (funcmode = 'CANCEL') THEN
616: resultout := Wf_Engine.Eng_Null;
612: resultout := Wf_Engine.Eng_Null;
613: RETURN;
614:
615: ELSIF (funcmode = 'CANCEL') THEN
616: resultout := Wf_Engine.Eng_Null;
617: RETURN;
618:
619: END IF;
620:
690: BEGIN
691:
692: IF (funcmode = 'RUN') THEN
693: -- Call to get the sob_id, doc_id,to_rpr_doc_id item attributes
694: vg_sob_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
695: itemkey => itemkey,
696: aname => 'SOB');
697:
698: vg_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
694: vg_sob_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
695: itemkey => itemkey,
696: aname => 'SOB');
697:
698: vg_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
699: itemkey => itemkey,
700: aname => 'DOC_ID');
701:
702: vl_approver_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
698: vg_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
699: itemkey => itemkey,
700: aname => 'DOC_ID');
701:
702: vl_approver_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
703: itemkey => itemkey,
704: aname => 'APPROVER_ID');
705:
706: vg_to_rpr_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
702: vl_approver_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
703: itemkey => itemkey,
704: aname => 'APPROVER_ID');
705:
706: vg_to_rpr_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
707: itemkey => itemkey,
708: aname => 'TO_RPR_DOC_ID');
709:
710: vg_user_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
706: vg_to_rpr_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
707: itemkey => itemkey,
708: aname => 'TO_RPR_DOC_ID');
709:
710: vg_user_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
711: itemkey => itemkey,
712: aname => 'USER_ID');
713:
714: vg_resp_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
710: vg_user_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
711: itemkey => itemkey,
712: aname => 'USER_ID');
713:
714: vg_resp_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
715: itemkey => itemkey,
716: aname => 'RESP_ID');
717:
718:
804: IF (x_return_status = 'S') THEN
805: resultout := 'COMPLETE:SUCCESS';
806: ELSE
807: -- Set the attribute for the packet id
808: Wf_Engine.SetItemAttrNumber(itemtype => itemtype,
809: itemkey => itemkey,
810: aname => 'PACKET_ID',
811: avalue => vl_packet_id );
812:
838:
839: BEGIN
840:
841: IF (funcmode = 'RESPOND') THEN
842: resultout := Wf_Engine.Eng_Null;
843: RETURN;
844:
845: ELSIF (funcmode = 'TRANSFER') THEN
846: resultout := Wf_Engine.Eng_Null;
842: resultout := Wf_Engine.Eng_Null;
843: RETURN;
844:
845: ELSIF (funcmode = 'TRANSFER') THEN
846: resultout := Wf_Engine.Eng_Null;
847: RETURN;
848:
849: ELSIF (funcmode = 'FORWARD') THEN
850: resultout := Wf_Engine.Eng_Null;
846: resultout := Wf_Engine.Eng_Null;
847: RETURN;
848:
849: ELSIF (funcmode = 'FORWARD') THEN
850: resultout := Wf_Engine.Eng_Null;
851: RETURN;
852:
853: ELSIF (funcmode = 'RUN') THEN
854:
852:
853: ELSIF (funcmode = 'RUN') THEN
854:
855: -- Call to get the sob_id, doc_id,to_rpr_doc_id item attributes
856: vg_sob_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
857: itemkey => itemkey,
858: aname => 'SOB');
859:
860: vg_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
856: vg_sob_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
857: itemkey => itemkey,
858: aname => 'SOB');
859:
860: vg_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
861: itemkey => itemkey,
862: aname => 'DOC_ID');
863:
864: vg_to_rpr_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
860: vg_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
861: itemkey => itemkey,
862: aname => 'DOC_ID');
863:
864: vg_to_rpr_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => itemtype,
865: itemkey => itemkey,
866: aname => 'TO_RPR_DOC_ID');
867:
868: -- Get Revision Number for doc_id
881: RAISE e_invalid;
882: END IF;
883: END IF;
884:
885: resultout := Wf_Engine.Eng_Completed || ':' || Wf_Engine.Eng_Null;
886: RETURN;
887:
888: ELSIF (funcmode = 'CANCEL') THEN
889: resultout := Wf_Engine.Eng_Null;
885: resultout := Wf_Engine.Eng_Completed || ':' || Wf_Engine.Eng_Null;
886: RETURN;
887:
888: ELSIF (funcmode = 'CANCEL') THEN
889: resultout := Wf_Engine.Eng_Null;
890: RETURN;
891:
892: END IF;
893:
1006: -- Derive the itemkey
1007: vg_itemkey := SUBSTR(document_id, INSTR(document_id, ':') + 1);
1008:
1009: -- Call to get the sob and doc id item attributes
1010: vg_sob_id := Wf_Engine.GetItemAttrNumber(itemtype => vg_itemtype,
1011: itemkey => vg_itemkey,
1012: aname => 'SOB');
1013:
1014: vg_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => vg_itemtype,
1010: vg_sob_id := Wf_Engine.GetItemAttrNumber(itemtype => vg_itemtype,
1011: itemkey => vg_itemkey,
1012: aname => 'SOB');
1013:
1014: vg_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => vg_itemtype,
1015: itemkey => vg_itemkey,
1016: aname => 'DOC_ID');
1017:
1018: -- Call to build the document
1052:
1053: vg_itemkey := SUBSTR(document_id, INSTR(document_id, ':') + 1);
1054:
1055: -- Call to get the sob and doc id(in this case,it is the rpr doc id)item attributes
1056: vg_sob_id := Wf_Engine.GetItemAttrNumber(itemtype => vg_itemtype,
1057: itemkey => vg_itemkey,
1058: aname => 'SOB');
1059:
1060: vg_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => vg_itemtype,
1056: vg_sob_id := Wf_Engine.GetItemAttrNumber(itemtype => vg_itemtype,
1057: itemkey => vg_itemkey,
1058: aname => 'SOB');
1059:
1060: vg_doc_id := Wf_Engine.GetItemAttrNumber(itemtype => vg_itemtype,
1061: itemkey => vg_itemkey,
1062: aname => 'TO_RPR_DOC_ID');
1063:
1064: -- Call to build the document