1: PACKAGE BODY OE_STANDARD_WF AS
2: /* $Header: OEXWSTDB.pls 120.3.12010000.2 2008/08/04 15:09:44 amallik ship $ */
3:
4: -- This procedure sets the global g_upgrade_mode to TRUE
5: Procedure UPGRADE_MODE_ON
7: --
8: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
9: --
10: Begin
11: OE_STANDARD_WF.G_UPGRADE_MODE := TRUE;
12: End UPGRADE_MODE_ON;
13:
14: -- This procedure sets the global g_save_messages to TRUE
15: Procedure SAVE_MESSAGES_ON
17: --
18: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
19: --
20: Begin
21: OE_STANDARD_WF.G_SAVE_MESSAGES := TRUE;
22: End SAVE_MESSAGES_ON;
23:
24: -- This procedure sets the global g_save_messages to FALSE
25: Procedure SAVE_MESSAGES_OFF
27: --
28: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
29: --
30: Begin
31: OE_STANDARD_WF.G_SAVE_MESSAGES := FALSE;
32: End SAVE_MESSAGES_OFF;
33:
34: -- This procedure sets the global G_RESET_APPS_CONTEXT to TRUE
35: Procedure RESET_APPS_CONTEXT_ON
37: --
38: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
39: --
40: Begin
41: OE_STANDARD_WF.G_RESET_APPS_CONTEXT := TRUE;
42: End RESET_APPS_CONTEXT_ON;
43:
44: -- This procedure sets the global G_RESET_APPS_CONTEXT to FALSE
45: Procedure RESET_APPS_CONTEXT_OFF
47: --
48: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
49: --
50: Begin
51: OE_STANDARD_WF.G_RESET_APPS_CONTEXT := FALSE;
52: End RESET_APPS_CONTEXT_OFF;
53:
54: -- Callers should pass in the instance_id. This is used to set Workflow
55: -- context for messages.
93:
94:
95: exception
96: when others then
97: Wf_Core.Context('OE_STANDARD_WF', 'SAVE_MESSAGES');
98: raise;
99: end SAVE_MESSAGES;
100:
101:
102:
103: /*--------------------------------------------------------------------
104: New BLOCK activity defined so that the activity cannot be
105: completed by the end-user through 'Progress Order'. This
106: block function should be used instead of the wf_engine standard
107: block function if the activity should be blocked for completion
108: from the Progress Order form
109: ----------------------------------------------------------------------*/
110: procedure STANDARD_BLOCK(itemtype in varchar2,
106: block function should be used instead of the wf_engine standard
107: block function if the activity should be blocked for completion
108: from the Progress Order form
109: ----------------------------------------------------------------------*/
110: procedure STANDARD_BLOCK(itemtype in varchar2,
111: itemkey in varchar2,
112: actid in number,
113: funcmode in varchar2,
114: resultout in out nocopy varchar2 /* file.sql.39 change */
118: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
119: --
120: begin
121: -- start data fix project
122: OE_STANDARD_WF.Set_Msg_Context(actid);
123: -- end data fix project
124:
125: -- Do nothing in cancel or timeout mode
126: if (funcmode <> wf_engine.eng_run) then
131: resultout := wf_engine.eng_notified||':'||wf_engine.eng_null||
132: ':'||wf_engine.eng_null;
133: exception
134: when others then
135: Wf_Core.Context('OE_STANDARD_WF', 'STANDARD_BLOCK', itemtype,
136: itemkey, to_char(actid), funcmode);
137: -- start data fix project
138: OE_STANDARD_WF.Add_Error_Activity_Msg(p_actid => actid,
139: p_itemtype => itemtype,
134: when others then
135: Wf_Core.Context('OE_STANDARD_WF', 'STANDARD_BLOCK', itemtype,
136: itemkey, to_char(actid), funcmode);
137: -- start data fix project
138: OE_STANDARD_WF.Add_Error_Activity_Msg(p_actid => actid,
139: p_itemtype => itemtype,
140: p_itemkey => itemkey);
141: OE_STANDARD_WF.Save_Messages;
142: OE_STANDARD_WF.Clear_Msg_Context;
137: -- start data fix project
138: OE_STANDARD_WF.Add_Error_Activity_Msg(p_actid => actid,
139: p_itemtype => itemtype,
140: p_itemkey => itemkey);
141: OE_STANDARD_WF.Save_Messages;
142: OE_STANDARD_WF.Clear_Msg_Context;
143: -- end data fix project
144: raise;
145: end STANDARD_BLOCK;
138: OE_STANDARD_WF.Add_Error_Activity_Msg(p_actid => actid,
139: p_itemtype => itemtype,
140: p_itemkey => itemkey);
141: OE_STANDARD_WF.Save_Messages;
142: OE_STANDARD_WF.Clear_Msg_Context;
143: -- end data fix project
144: raise;
145: end STANDARD_BLOCK;
146:
141: OE_STANDARD_WF.Save_Messages;
142: OE_STANDARD_WF.Clear_Msg_Context;
143: -- end data fix project
144: raise;
145: end STANDARD_BLOCK;
146:
147: /* --------------------------------------------------------
148: This procedure is used to set the database session context
149: correctly before executing a function activity. The selector
269: END IF;
270: --End Bug 6884804
271: EXCEPTION
272: WHEN OTHERS THEN NULL;
273: WF_CORE.Context('OE_STANDARD_WF', 'OEOH_SELECTOR',
274: p_itemtype, p_itemkey, p_actid, p_funcmode);
275: RAISE;
276:
277:
405: END IF;
406:
407: EXCEPTION
408: WHEN OTHERS THEN NULL;
409: WF_CORE.Context('OE_STANDARD_WF', 'OEOL_SELECTOR',
410: p_itemtype, p_itemkey, p_actid, p_funcmode);
411: RAISE;
412:
413:
556: END IF;
557: --End Bug 6884804
558: EXCEPTION
559: WHEN OTHERS THEN NULL;
560: WF_CORE.Context('OE_STANDARD_WF', 'OENH_SELECTOR',
561: p_itemtype, p_itemkey, p_actid, p_funcmode);
562: RAISE;
563:
564:
679: END IF;
680: --End Bug 6884804
681: EXCEPTION
682: WHEN OTHERS THEN NULL;
683: WF_CORE.Context('OE_STANDARD_WF', 'OEBH_SELECTOR',
684: p_itemtype, p_itemkey, p_actid, p_funcmode);
685: RAISE;
686:
687:
704: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
705: --
706: BEGIN
707: -- start data fix project
708: OE_STANDARD_WF.Set_Msg_Context(p_actid);
709: -- end data fix project
710:
711: if (p_funcmode = 'RUN') THEN
712: SELECT source_type_code
725: EXCEPTION
726: WHEN OTHERS THEN NULL;
727: oe_msg_pub.set_msg_context ( p_entity_code => 'LINE'
728: ,p_line_id => p_itemkey);
729: WF_CORE.Context('OE_STANDARD_WF', 'Get_Supply_Source_Type',
730: p_itemtype, p_itemkey, p_actid, p_funcmode);
731: -- start data fix project
732: OE_STANDARD_WF.Add_Error_Activity_Msg(p_actid => p_actid,
733: p_itemtype => p_itemtype,
728: ,p_line_id => p_itemkey);
729: WF_CORE.Context('OE_STANDARD_WF', 'Get_Supply_Source_Type',
730: p_itemtype, p_itemkey, p_actid, p_funcmode);
731: -- start data fix project
732: OE_STANDARD_WF.Add_Error_Activity_Msg(p_actid => p_actid,
733: p_itemtype => p_itemtype,
734: p_itemkey => p_itemkey);
735: OE_STANDARD_WF.Save_Messages;
736: OE_STANDARD_WF.Clear_Msg_Context;
731: -- start data fix project
732: OE_STANDARD_WF.Add_Error_Activity_Msg(p_actid => p_actid,
733: p_itemtype => p_itemtype,
734: p_itemkey => p_itemkey);
735: OE_STANDARD_WF.Save_Messages;
736: OE_STANDARD_WF.Clear_Msg_Context;
737: -- end data fix project
738: RAISE;
739:
732: OE_STANDARD_WF.Add_Error_Activity_Msg(p_actid => p_actid,
733: p_itemtype => p_itemtype,
734: p_itemkey => p_itemkey);
735: OE_STANDARD_WF.Save_Messages;
736: OE_STANDARD_WF.Clear_Msg_Context;
737: -- end data fix project
738: RAISE;
739:
740:
757: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
758: --
759: BEGIN
760: -- start data fix project
761: OE_STANDARD_WF.Set_Msg_Context(p_actid);
762: -- end data fix project
763: IF (p_funcmode = 'RUN') THEN
764: IF p_itemtype = OE_GLOBALS.G_WFI_LIN THEN
765: l_category_code := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'LINE_CATEGORY');
777: EXCEPTION
778: WHEN OTHERS THEN NULL;
779: oe_msg_pub.set_msg_context ( p_entity_code => 'LINE'
780: ,p_line_id => p_itemkey);
781: WF_CORE.Context('OE_STANDARD_WF', 'Get_Line_Category',
782: p_itemtype, p_itemkey, p_actid, p_funcmode);
783: -- start data fix project
784: OE_STANDARD_WF.Add_Error_Activity_Msg(p_actid => p_actid,
785: p_itemtype => p_itemtype,
780: ,p_line_id => p_itemkey);
781: WF_CORE.Context('OE_STANDARD_WF', 'Get_Line_Category',
782: p_itemtype, p_itemkey, p_actid, p_funcmode);
783: -- start data fix project
784: OE_STANDARD_WF.Add_Error_Activity_Msg(p_actid => p_actid,
785: p_itemtype => p_itemtype,
786: p_itemkey => p_itemkey);
787: OE_STANDARD_WF.Save_Messages;
788: OE_STANDARD_WF.Clear_Msg_Context;
783: -- start data fix project
784: OE_STANDARD_WF.Add_Error_Activity_Msg(p_actid => p_actid,
785: p_itemtype => p_itemtype,
786: p_itemkey => p_itemkey);
787: OE_STANDARD_WF.Save_Messages;
788: OE_STANDARD_WF.Clear_Msg_Context;
789: -- end data fix project
790: RAISE;
791:
784: OE_STANDARD_WF.Add_Error_Activity_Msg(p_actid => p_actid,
785: p_itemtype => p_itemtype,
786: p_itemkey => p_itemkey);
787: OE_STANDARD_WF.Save_Messages;
788: OE_STANDARD_WF.Clear_Msg_Context;
789: -- end data fix project
790: RAISE;
791:
792:
850: EXCEPTION
851: WHEN OTHERS THEN NULL;
852: END Add_Error_Activity_Msg;
853:
854: end OE_STANDARD_WF;