[Home] [Help]
PACKAGE BODY: APPS.PQH_DE_OPERATION_GROUPS_SWI
Source
1 Package Body pqh_de_operation_groups_swi As
2 /* $Header: pqopgswi.pkb 115.1 2002/12/03 00:09:18 rpasapul noship $ */
3 --
4 -- Package variables
5 --
6 g_package varchar2(33) := 'pqh_de_operation_groups_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< delete_operation_groups >-----------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE delete_operation_groups
12 (p_validate in number default hr_api.g_false_num
13 ,p_operation_group_id in number
14 ,p_object_version_number in number
15 ,p_return_status out nocopy varchar2
16 ) is
17 --
18 -- Variables for API Boolean parameters
19 l_validate boolean;
20 --
21 -- Variables for IN/OUT parameters
22 --
23 -- Other variables
24 l_proc varchar2(72) := g_package ||'delete_operation_groups';
25 Begin
26 hr_utility.set_location(' Entering:' || l_proc,10);
27 --
28 -- Issue a savepoint
29 --
30 savepoint delete_operation_groups_swi;
31 --
32 -- Initialise Multiple Message Detection
33 --
34 hr_multi_message.enable_message_list;
35 --
36 -- Remember IN OUT parameter IN values
37 --
38 --
39 -- Convert constant values to their corresponding boolean value
40 --
41 l_validate :=
42 hr_api.constant_to_boolean
43 (p_constant_value => p_validate);
44 --
45 -- Register Surrogate ID or user key values
46 --
47 --
48 -- Call API
49 --
50 pqh_de_operation_groups_api.delete_operation_groups
51 (p_validate => l_validate
52 ,p_operation_group_id => p_operation_group_id
53 ,p_object_version_number => p_object_version_number
54 );
55 --
56 -- Convert API warning boolean parameter values to specific
57 -- messages and add them to Multiple Message List
58 --
59 --
60 -- Convert API non-warning boolean parameter values
61 --
62 --
63 -- Derive the API return status value based on whether
64 -- messages of any type exist in the Multiple Message List.
65 -- Also disable Multiple Message Detection.
66 --
67 p_return_status := hr_multi_message.get_return_status_disable;
68 hr_utility.set_location(' Leaving:' || l_proc,20);
69 --
70 exception
71 when hr_multi_message.error_message_exist then
72 --
73 -- Catch the Multiple Message List exception which
74 -- indicates API processing has been aborted because
75 -- at least one message exists in the list.
76 --
77 rollback to delete_operation_groups_swi;
78 --
79 -- Reset IN OUT parameters and set OUT parameters
80 --
81 p_return_status := hr_multi_message.get_return_status_disable;
82 hr_utility.set_location(' Leaving:' || l_proc, 30);
83 when others then
84 --
85 -- When Multiple Message Detection is enabled catch
86 -- any Application specific or other unexpected
87 -- exceptions. Adding appropriate details to the
88 -- Multiple Message List. Otherwise re-raise the
89 -- error.
90 --
91 rollback to delete_operation_groups_swi;
92 if hr_multi_message.unexpected_error_add(l_proc) then
93 hr_utility.set_location(' Leaving:' || l_proc,40);
94 raise;
95 end if;
96 --
97 -- Reset IN OUT and set OUT parameters
98 --
99 p_return_status := hr_multi_message.get_return_status_disable;
100 hr_utility.set_location(' Leaving:' || l_proc,50);
101 end delete_operation_groups;
102 -- ----------------------------------------------------------------------------
103 -- |------------------------< insert_operation_groups >-----------------------|
104 -- ----------------------------------------------------------------------------
105 PROCEDURE insert_operation_groups
106 (p_validate in number default hr_api.g_false_num
107 ,p_effective_date in date
108 ,p_operation_group_code in varchar2
109 ,p_description in varchar2
110 ,p_business_group_id in number
111 ,p_operation_group_id out nocopy number
112 ,p_object_version_number out nocopy number
113 ,p_return_status out nocopy varchar2
114 ) is
115 --
116 -- Variables for API Boolean parameters
117 l_validate boolean;
118 --
119 -- Variables for IN/OUT parameters
120 --
121 -- Other variables
122 l_proc varchar2(72) := g_package ||'insert_operation_groups';
123 Begin
124 hr_utility.set_location(' Entering:' || l_proc,10);
125 --
126 -- Issue a savepoint
127 --
128 savepoint insert_operation_groups_swi;
129 --
130 -- Initialise Multiple Message Detection
131 --
132 hr_multi_message.enable_message_list;
133 --
134 -- Remember IN OUT parameter IN values
135 --
136 --
137 -- Convert constant values to their corresponding boolean value
138 --
139 l_validate :=
140 hr_api.constant_to_boolean
141 (p_constant_value => p_validate);
142 --
143 -- Register Surrogate ID or user key values
144 --
145 --
146 -- Call API
147 --
148 pqh_de_operation_groups_api.insert_operation_groups
149 (p_validate => l_validate
150 ,p_effective_date => p_effective_date
151 ,p_operation_group_code => p_operation_group_code
152 ,p_description => p_description
153 ,p_business_group_id => p_business_group_id
154 ,p_operation_group_id => p_operation_group_id
155 ,p_object_version_number => p_object_version_number
156 );
157 --
158 -- Convert API warning boolean parameter values to specific
159 -- messages and add them to Multiple Message List
160 --
161 --
162 -- Convert API non-warning boolean parameter values
163 --
164 --
165 -- Derive the API return status value based on whether
166 -- messages of any type exist in the Multiple Message List.
167 -- Also disable Multiple Message Detection.
168 --
169 p_return_status := hr_multi_message.get_return_status_disable;
170 hr_utility.set_location(' Leaving:' || l_proc,20);
171 --
172 exception
173 when hr_multi_message.error_message_exist then
174 --
175 -- Catch the Multiple Message List exception which
176 -- indicates API processing has been aborted because
177 -- at least one message exists in the list.
178 --
179 rollback to insert_operation_groups_swi;
180 --
181 -- Reset IN OUT parameters and set OUT parameters
182 --
183 p_operation_group_id := null;
184 p_object_version_number := null;
185 p_return_status := hr_multi_message.get_return_status_disable;
186 hr_utility.set_location(' Leaving:' || l_proc, 30);
187 when others then
188 --
189 -- When Multiple Message Detection is enabled catch
190 -- any Application specific or other unexpected
191 -- exceptions. Adding appropriate details to the
192 -- Multiple Message List. Otherwise re-raise the
193 -- error.
194 --
195 rollback to insert_operation_groups_swi;
196 if hr_multi_message.unexpected_error_add(l_proc) then
197 hr_utility.set_location(' Leaving:' || l_proc,40);
198 raise;
199 end if;
200 --
201 -- Reset IN OUT and set OUT parameters
202 --
203 p_operation_group_id := null;
204 p_object_version_number := null;
205 p_return_status := hr_multi_message.get_return_status_disable;
206 hr_utility.set_location(' Leaving:' || l_proc,50);
207 end insert_operation_groups;
208 -- ----------------------------------------------------------------------------
209 -- |------------------------< update_operation_groups >-----------------------|
210 -- ----------------------------------------------------------------------------
211 PROCEDURE update_operation_groups
212 (p_validate in number default hr_api.g_false_num
213 ,p_effective_date in date
214 ,p_operation_group_id in number
215 ,p_object_version_number in out nocopy number
216 ,p_operation_group_code in varchar2 default hr_api.g_varchar2
217 ,p_description in varchar2 default hr_api.g_varchar2
218 ,p_business_group_id in number default hr_api.g_number
219 ,p_return_status out nocopy varchar2
220 ) is
221 --
222 -- Variables for API Boolean parameters
223 l_validate boolean;
224 --
225 -- Variables for IN/OUT parameters
226 l_object_version_number number;
227 --
228 -- Other variables
229 l_proc varchar2(72) := g_package ||'update_operation_groups';
230 Begin
231
232
233 hr_utility.set_location(' Entering:' || l_proc,10);
234
235 --
236 -- Issue a savepoint
237 --
238
239 savepoint update_operation_groups_swi;
240
241 --
242 -- Initialise Multiple Message Detection
243 --
244 hr_multi_message.enable_message_list;
245 --
246 -- Remember IN OUT parameter IN values
247 --
248 l_object_version_number := p_object_version_number;
249 --
250 -- Convert constant values to their corresponding boolean value
251 --
252 l_validate :=
253 hr_api.constant_to_boolean
254 (p_constant_value => p_validate);
255 --
256 -- Register Surrogate ID or user key values
257 --
258 --
259 -- Call API
260 --
261
262 pqh_de_operation_groups_api.update_operation_groups
263 (p_validate => l_validate
264 ,p_effective_date => p_effective_date
265 ,p_operation_group_id => p_operation_group_id
266 ,p_object_version_number => p_object_version_number
267 ,p_operation_group_code => p_operation_group_code
268 ,p_description => p_description
269 ,p_business_group_id => p_business_group_id
270 );
271 --
272 -- Convert API warning boolean parameter values to specific
273 -- messages and add them to Multiple Message List
274 --
275 --
276 -- Convert API non-warning boolean parameter values
277 --
278 --
279 -- Derive the API return status value based on whether
280 -- messages of any type exist in the Multiple Message List.
281 -- Also disable Multiple Message Detection.
282 --
283 p_return_status := hr_multi_message.get_return_status_disable;
284 hr_utility.set_location(' Leaving:' || l_proc,20);
285 --
286 exception
287 when hr_multi_message.error_message_exist then
288 --
289 -- Catch the Multiple Message List exception which
290 -- indicates API processing has been aborted because
291 -- at least one message exists in the list.
292 --
293 rollback to update_operation_groups_swi;
294 --
295 -- Reset IN OUT parameters and set OUT parameters
296 --
297 p_object_version_number := l_object_version_number;
298 p_return_status := hr_multi_message.get_return_status_disable;
299 hr_utility.set_location(' Leaving:' || l_proc, 30);
300 when others then
301 --
302 -- When Multiple Message Detection is enabled catch
303 -- any Application specific or other unexpected
304 -- exceptions. Adding appropriate details to the
305 -- Multiple Message List. Otherwise re-raise the
306 -- error.
307 --
308 rollback to update_operation_groups_swi;
309 if hr_multi_message.unexpected_error_add(l_proc) then
310 hr_utility.set_location(' Leaving:' || l_proc,40);
311 raise;
312 end if;
313 --
314 -- Reset IN OUT and set OUT parameters
315 --
316 p_object_version_number := l_object_version_number;
317 p_return_status := hr_multi_message.get_return_status_disable;
318 hr_utility.set_location(' Leaving:' || l_proc,50);
319 end update_operation_groups;
320 end pqh_de_operation_groups_swi;