[Home] [Help]
PACKAGE BODY: APPS.HXC_SEEDED_APPROVAL_WF
Source
1 PACKAGE BODY hxc_seeded_approval_wf AS
2 /* $Header: hxcseedaw.pkb 120.2 2005/09/23 06:27:25 nissharm noship $ */
3
4 g_pkg constant varchar2(30) := 'hxc_seeded_approval_wf';
5
6 g_debug boolean := hr_utility.debug_enabled;
7
8 procedure do_approval_logic(
9 p_itemtype in varchar2,
10 p_itemkey in varchar2,
11 p_actid in number,
12 p_funcmode in varchar2,
13 p_result in out nocopy varchar2)
14 is
15 l_proc varchar2(61);
16 begin
17 g_debug := hr_utility.debug_enabled;
18
19 if g_debug then
20 l_proc := g_pkg || '.' || 'do_approval_logic';
21 hr_utility.set_location(l_proc, 10);
22 hr_utility.trace('p_funcmode is >' || p_funcmode || '<');
23 hr_utility.trace('p_itemtype is >' || p_itemtype || '<');
24 hr_utility.trace('p_itemkey is >' || p_itemkey || '<');
25 end if;
26 --
27 -- p_result := 'APPROVED';
28 --
29 p_result := 'REJECTED';
30 --
31 if g_debug then
32 hr_utility.set_location(l_proc, 90);
33 end if;
34 exception
35 when others then
36 if g_debug then
37 hr_utility.trace('sqlcode>' || sqlcode || '<');
38 hr_utility.trace('sqlerrm>' || sqlerrm || '<');
39 end if;
40 --
41 -- record this function call in the error system in case of an exception
42 --
43 wf_core.context(g_pkg, substr(l_proc, instr(l_proc, '.') + 1),
44 p_itemtype, p_itemkey, to_char(p_actid), p_funcmode);
45 raise;
46 end do_approval_logic;
47
48
49 procedure approved(
50 p_itemtype in varchar2,
51 p_itemkey in varchar2,
52 p_actid in number,
53 p_funcmode in varchar2,
54 p_result in out nocopy varchar2)
55 is
56 l_proc varchar2(61);
57 l_item_type hxc_approval_comps.wf_item_type%type;
58 l_item_key number;
59 begin
60 g_debug := hr_utility.debug_enabled;
61
62 if g_debug then
63 l_proc := g_pkg || '.' || 'approved';
64 hr_utility.set_location(l_proc, 10);
65 hr_utility.trace('p_funcmode is >' || p_funcmode || '<');
66 end if;
67
68 l_item_type := wf_engine.GetItemAttrText(itemtype => p_itemtype,
69 itemkey => p_itemkey,
70 aname => 'PARENT_ITEM_TYPE');
71
72 l_item_key := wf_engine.GetItemAttrText( itemtype => p_itemtype,
73 itemkey => p_itemkey,
74 aname => 'PARENT_ITEM_KEY');
75
76 wf_engine.SetItemAttrText(itemtype => l_item_type,
77 itemkey => l_item_key,
78 aname => 'WF_APPROVAL_RESULT',
79 avalue => 'APPROVED');
80
81 wf_engine.SetItemAttrText(itemtype => l_item_type,
82 itemkey => l_item_key,
83 aname => 'APR_REJ_REASON',
84 avalue => 'Approved by Seeded Workflow');
85
86 p_result := 'COMPLETE';
87
88 if g_debug then
89 hr_utility.set_location(l_proc, 90);
90 end if;
91 exception
92 when others then
93 if g_debug then
94 hr_utility.trace('sqlcode>' || sqlcode || '<');
95 hr_utility.trace('sqlerrm>' || sqlerrm || '<');
96 end if;
97 --
98 -- record this function call in the error system in case of an exception
99 --
100 wf_core.context(g_pkg, substr(l_proc, instr(l_proc, '.') + 1),
101 p_itemtype, p_itemkey, to_char(p_actid), p_funcmode);
102 raise;
103 end approved;
104
105 procedure rejected(
106 p_itemtype in varchar2,
107 p_itemkey in varchar2,
108 p_actid in number,
109 p_funcmode in varchar2,
110 p_result in out nocopy varchar2)
111 is
112 l_proc varchar2(61);
113 l_item_type hxc_approval_comps.wf_item_type%type;
114 l_item_key number;
115 begin
116 g_debug := hr_utility.debug_enabled;
117
118 if g_debug then
119 l_proc := g_pkg || '.' || 'rejected';
120 hr_utility.set_location(l_proc, 10);
121 hr_utility.trace('p_funcmode is >' || p_funcmode || '<');
122 end if;
123
124 l_item_type := wf_engine.GetItemAttrText(itemtype => p_itemtype,
125 itemkey => p_itemkey,
126 aname => 'PARENT_ITEM_TYPE');
127
128 l_item_key := wf_engine.GetItemAttrText(itemtype => p_itemtype,
129 itemkey => p_itemkey,
130 aname => 'PARENT_ITEM_KEY');
131
132 wf_engine.SetItemAttrText(itemtype => l_item_type,
133 itemkey => l_item_key,
134 aname => 'WF_APPROVAL_RESULT',
135 avalue => 'REJECTED');
136
137 wf_engine.SetItemAttrText(itemtype => l_item_type,
138 itemkey => l_item_key,
139 aname => 'APR_REJ_REASON',
140 avalue => 'Rejected by Seeded Workflow');
141
142 p_result := 'COMPLETE';
143 --
144 if g_debug then
145 hr_utility.set_location(l_proc, 90);
146 end if;
147 exception
148 when others then
149 if g_debug then
150 hr_utility.trace('sqlcode>' || sqlcode || '<');
151 hr_utility.trace('sqlerrm>' || sqlerrm || '<');
152 end if;
153 --
154 -- record this function call in the error system in case of an exception
155 --
156 wf_core.context(g_pkg, substr(l_proc, instr(l_proc, '.') + 1),
157 p_itemtype, p_itemkey, to_char(p_actid), p_funcmode);
158 raise;
159 end rejected;
160
161 end hxc_seeded_approval_wf;