1 Package Body ben_pil_assignment_swi As
2 /* $Header: bepsgswi.pkb 120.0 2006/03/23 10:04 mmillmor noship $ */
3 --
4 -- Package variables
5 --
6 g_package varchar2(33) := 'ben_pil_assignment_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-------------------------< create_pil_assignment >------------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_pil_assignment
12 (p_validate in number default hr_api.g_false_num
13 ,p_pil_assignment_id out nocopy number
14 ,p_per_in_ler_id in number default null
15 ,p_applicant_assignment_id in number default null
16 ,p_offer_assignment_id in number default null
17 ,p_object_version_number out nocopy number
18 ,p_return_status out nocopy varchar2
19 ) is
20 --
21 -- Variables for API Boolean parameters
22 l_validate boolean;
23 --
24 -- Variables for IN/OUT parameters
25 --
26 -- Other variables
27 l_proc varchar2(72) := g_package ||'create_pil_assignment';
28 Begin
29 hr_utility.set_location(' Entering:' || l_proc,10);
30 --
31 -- Issue a savepoint
32 --
33 savepoint create_pil_assignment_swi;
34 --
35 -- Initialise Multiple Message Detection
36 --
37 hr_multi_message.enable_message_list;
38 --
39 -- Remember IN OUT parameter IN values
40 --
41 --
42 -- Convert constant values to their corresponding boolean value
43 --
44 l_validate :=
45 hr_api.constant_to_boolean
46 (p_constant_value => p_validate);
47 --
48 -- Register Surrogate ID or user key values
49 --
50 --
51 -- Call API
52 --
53 ben_pil_assignment_api.create_pil_assignment
54 (p_validate => l_validate
55 ,p_pil_assignment_id => p_pil_assignment_id
56 ,p_per_in_ler_id => p_per_in_ler_id
57 ,p_applicant_assignment_id => p_applicant_assignment_id
58 ,p_offer_assignment_id => p_offer_assignment_id
59 ,p_object_version_number => p_object_version_number
60 );
61 --
62 -- Convert API warning boolean parameter values to specific
63 -- messages and add them to Multiple Message List
64 --
65 --
66 -- Convert API non-warning boolean parameter values
67 --
68 --
69 -- Derive the API return status value based on whether
70 -- messages of any type exist in the Multiple Message List.
71 -- Also disable Multiple Message Detection.
72 --
73 p_return_status := hr_multi_message.get_return_status_disable;
74 hr_utility.set_location(' Leaving:' || l_proc,20);
75 --
76 exception
77 when hr_multi_message.error_message_exist then
78 --
79 -- Catch the Multiple Message List exception which
80 -- indicates API processing has been aborted because
81 -- at least one message exists in the list.
82 --
83 rollback to create_pil_assignment_swi;
84 --
85 -- Reset IN OUT parameters and set OUT parameters
86 --
87 p_pil_assignment_id := null;
88 p_object_version_number := null;
89 p_return_status := hr_multi_message.get_return_status_disable;
90 hr_utility.set_location(' Leaving:' || l_proc, 30);
91 when others then
92 --
93 -- When Multiple Message Detection is enabled catch
94 -- any Application specific or other unexpected
95 -- exceptions. Adding appropriate details to the
96 -- Multiple Message List. Otherwise re-raise the
97 -- error.
98 --
99 rollback to create_pil_assignment_swi;
100 if hr_multi_message.unexpected_error_add(l_proc) then
101 hr_utility.set_location(' Leaving:' || l_proc,40);
102 raise;
103 end if;
104 --
105 -- Reset IN OUT and set OUT parameters
106 --
107 p_pil_assignment_id := null;
108 p_object_version_number := null;
109 p_return_status := hr_multi_message.get_return_status_disable;
110 hr_utility.set_location(' Leaving:' || l_proc,50);
111 end create_pil_assignment;
112 -- ----------------------------------------------------------------------------
113 -- |-------------------------< delete_pil_assignment >------------------------|
114 -- ----------------------------------------------------------------------------
115 PROCEDURE delete_pil_assignment
116 (p_validate in number default hr_api.g_false_num
117 ,p_pil_assignment_id in number
118 ,p_object_version_number in out nocopy number
119 ,p_return_status out nocopy varchar2
120 ) is
121 --
122 -- Variables for API Boolean parameters
123 l_validate boolean;
124 --
125 -- Variables for IN/OUT parameters
126 l_object_version_number number;
127 --
128 -- Other variables
129 l_proc varchar2(72) := g_package ||'delete_pil_assignment';
130 Begin
131 hr_utility.set_location(' Entering:' || l_proc,10);
132 --
133 -- Issue a savepoint
134 --
135 savepoint delete_pil_assignment_swi;
136 --
137 -- Initialise Multiple Message Detection
138 --
139 hr_multi_message.enable_message_list;
140 --
141 -- Remember IN OUT parameter IN values
142 --
143 l_object_version_number := p_object_version_number;
144 --
145 -- Convert constant values to their corresponding boolean value
146 --
147 l_validate :=
148 hr_api.constant_to_boolean
149 (p_constant_value => p_validate);
150 --
151 -- Register Surrogate ID or user key values
152 --
153 --
154 -- Call API
155 --
156 ben_pil_assignment_api.delete_pil_assignment
157 (p_validate => l_validate
158 ,p_pil_assignment_id => p_pil_assignment_id
159 ,p_object_version_number => p_object_version_number
160 );
161 --
162 -- Convert API warning boolean parameter values to specific
163 -- messages and add them to Multiple Message List
164 --
165 --
166 -- Convert API non-warning boolean parameter values
167 --
168 --
169 -- Derive the API return status value based on whether
170 -- messages of any type exist in the Multiple Message List.
171 -- Also disable Multiple Message Detection.
172 --
173 p_return_status := hr_multi_message.get_return_status_disable;
174 hr_utility.set_location(' Leaving:' || l_proc,20);
175 --
176 exception
177 when hr_multi_message.error_message_exist then
178 --
179 -- Catch the Multiple Message List exception which
180 -- indicates API processing has been aborted because
181 -- at least one message exists in the list.
182 --
183 rollback to delete_pil_assignment_swi;
184 --
185 -- Reset IN OUT parameters and set OUT parameters
186 --
187 p_object_version_number := l_object_version_number;
188 p_return_status := hr_multi_message.get_return_status_disable;
189 hr_utility.set_location(' Leaving:' || l_proc, 30);
190 when others then
191 --
192 -- When Multiple Message Detection is enabled catch
193 -- any Application specific or other unexpected
194 -- exceptions. Adding appropriate details to the
195 -- Multiple Message List. Otherwise re-raise the
196 -- error.
197 --
198 rollback to delete_pil_assignment_swi;
199 if hr_multi_message.unexpected_error_add(l_proc) then
200 hr_utility.set_location(' Leaving:' || l_proc,40);
201 raise;
202 end if;
203 --
204 -- Reset IN OUT and set OUT parameters
205 --
206 p_object_version_number := l_object_version_number;
207 p_return_status := hr_multi_message.get_return_status_disable;
208 hr_utility.set_location(' Leaving:' || l_proc,50);
209 end delete_pil_assignment;
210 -- ----------------------------------------------------------------------------
211 -- |----------------------------------< lck >---------------------------------|
212 -- ----------------------------------------------------------------------------
213 PROCEDURE lck
214 (p_pil_assignment_id in number
215 ,p_object_version_number in number
216 ,p_return_status out nocopy varchar2
217 ) is
218 --
219 -- Variables for API Boolean parameters
220 --
221 -- Variables for IN/OUT parameters
222 --
223 -- Other variables
224 l_proc varchar2(72) := g_package ||'lck';
225 Begin
226 hr_utility.set_location(' Entering:' || l_proc,10);
227 --
228 -- Issue a savepoint
229 --
230 savepoint lck_swi;
231 --
232 -- Initialise Multiple Message Detection
233 --
234 hr_multi_message.enable_message_list;
235 --
236 -- Remember IN OUT parameter IN values
237 --
238 --
239 -- Convert constant values to their corresponding boolean value
240 --
241 --
242 -- Register Surrogate ID or user key values
243 --
244 --
245 -- Call API
246 --
247 ben_pil_assignment_api.lck
248 (p_pil_assignment_id => p_pil_assignment_id
249 ,p_object_version_number => p_object_version_number
250 );
251 --
252 -- Convert API warning boolean parameter values to specific
253 -- messages and add them to Multiple Message List
254 --
255 --
256 -- Convert API non-warning boolean parameter values
257 --
258 --
259 -- Derive the API return status value based on whether
260 -- messages of any type exist in the Multiple Message List.
261 -- Also disable Multiple Message Detection.
262 --
263 p_return_status := hr_multi_message.get_return_status_disable;
264 hr_utility.set_location(' Leaving:' || l_proc,20);
265 --
266 exception
267 when hr_multi_message.error_message_exist then
268 --
269 -- Catch the Multiple Message List exception which
270 -- indicates API processing has been aborted because
271 -- at least one message exists in the list.
272 --
273 rollback to lck_swi;
274 --
275 -- Reset IN OUT parameters and set OUT parameters
276 --
277 p_return_status := hr_multi_message.get_return_status_disable;
278 hr_utility.set_location(' Leaving:' || l_proc, 30);
279 when others then
280 --
281 -- When Multiple Message Detection is enabled catch
282 -- any Application specific or other unexpected
283 -- exceptions. Adding appropriate details to the
284 -- Multiple Message List. Otherwise re-raise the
285 -- error.
286 --
287 rollback to lck_swi;
288 if hr_multi_message.unexpected_error_add(l_proc) then
289 hr_utility.set_location(' Leaving:' || l_proc,40);
290 raise;
291 end if;
292 --
293 -- Reset IN OUT and set OUT parameters
294 --
295 p_return_status := hr_multi_message.get_return_status_disable;
296 hr_utility.set_location(' Leaving:' || l_proc,50);
297 end lck;
298 -- ----------------------------------------------------------------------------
299 -- |-------------------------< update_pil_assignment >------------------------|
300 -- ----------------------------------------------------------------------------
301 PROCEDURE update_pil_assignment
302 (p_validate in number default hr_api.g_false_num
303 ,p_pil_assignment_id in number default hr_api.g_number
304 ,p_per_in_ler_id in number default hr_api.g_number
305 ,p_applicant_assignment_id in number default hr_api.g_number
306 ,p_offer_assignment_id in number default hr_api.g_number
307 ,p_object_version_number in out nocopy number
308 ,p_return_status out nocopy varchar2
309 ) is
310 --
311 -- Variables for API Boolean parameters
312 l_validate boolean;
313 --
314 -- Variables for IN/OUT parameters
315 l_object_version_number number;
316 --
317 -- Other variables
318 l_proc varchar2(72) := g_package ||'update_pil_assignment';
319 Begin
320 hr_utility.set_location(' Entering:' || l_proc,10);
321 --
322 -- Issue a savepoint
323 --
324 savepoint update_pil_assignment_swi;
325 --
326 -- Initialise Multiple Message Detection
327 --
328 hr_multi_message.enable_message_list;
329 --
330 -- Remember IN OUT parameter IN values
331 --
332 l_object_version_number := p_object_version_number;
333 --
334 -- Convert constant values to their corresponding boolean value
335 --
336 l_validate :=
337 hr_api.constant_to_boolean
338 (p_constant_value => p_validate);
339 --
340 -- Register Surrogate ID or user key values
341 --
342 --
343 -- Call API
344 --
345 ben_pil_assignment_api.update_pil_assignment
346 (p_validate => l_validate
347 ,p_pil_assignment_id => p_pil_assignment_id
348 ,p_per_in_ler_id => p_per_in_ler_id
349 ,p_applicant_assignment_id => p_applicant_assignment_id
350 ,p_offer_assignment_id => p_offer_assignment_id
351 ,p_object_version_number => p_object_version_number
352 );
353 --
354 -- Convert API warning boolean parameter values to specific
355 -- messages and add them to Multiple Message List
356 --
357 --
358 -- Convert API non-warning boolean parameter values
359 --
360 --
361 -- Derive the API return status value based on whether
362 -- messages of any type exist in the Multiple Message List.
363 -- Also disable Multiple Message Detection.
364 --
365 p_return_status := hr_multi_message.get_return_status_disable;
366 hr_utility.set_location(' Leaving:' || l_proc,20);
367 --
368 exception
369 when hr_multi_message.error_message_exist then
370 --
371 -- Catch the Multiple Message List exception which
372 -- indicates API processing has been aborted because
373 -- at least one message exists in the list.
374 --
375 rollback to update_pil_assignment_swi;
376 --
377 -- Reset IN OUT parameters and set OUT parameters
378 --
379 p_object_version_number := l_object_version_number;
380 p_return_status := hr_multi_message.get_return_status_disable;
381 hr_utility.set_location(' Leaving:' || l_proc, 30);
382 when others then
383 --
384 -- When Multiple Message Detection is enabled catch
385 -- any Application specific or other unexpected
386 -- exceptions. Adding appropriate details to the
387 -- Multiple Message List. Otherwise re-raise the
388 -- error.
389 --
390 rollback to update_pil_assignment_swi;
391 if hr_multi_message.unexpected_error_add(l_proc) then
392 hr_utility.set_location(' Leaving:' || l_proc,40);
393 raise;
394 end if;
395 --
396 -- Reset IN OUT and set OUT parameters
397 --
398 p_object_version_number := l_object_version_number;
399 p_return_status := hr_multi_message.get_return_status_disable;
400 hr_utility.set_location(' Leaving:' || l_proc,50);
401 end update_pil_assignment;
402 end ben_pil_assignment_swi;