[Home] [Help]
PACKAGE BODY: APPS.AME_CONDITION_SWI
Source
1 Package Body ame_condition_swi As
2 /* $Header: amconswi.pkb 120.0 2005/09/02 03:56 mbocutt noship $ */
3 --
4 -- Package variables
5 --
6 g_package varchar2(33) := 'ame_condition_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-------------------------< create_ame_condition >-------------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_ame_condition
12 (p_validate in number default hr_api.g_false_num
13 ,p_condition_key in varchar2
14 ,p_condition_type in varchar2
15 ,p_attribute_id in number default null
16 ,p_parameter_one in varchar2 default null
17 ,p_parameter_two in varchar2 default null
18 ,p_parameter_three in varchar2 default null
19 ,p_include_upper_limit in varchar2 default null
20 ,p_include_lower_limit in varchar2 default null
21 ,p_string_value in varchar2 default null
22 ,p_condition_id in number
23 ,p_con_start_date out nocopy date
24 ,p_con_end_date out nocopy date
25 ,p_con_object_version_number out nocopy number
26 ,p_stv_start_date out nocopy date
27 ,p_stv_end_date out nocopy date
28 ,p_stv_object_version_number out nocopy number
29 ,p_return_status out nocopy varchar2
30 ) is
31 --
32 -- Variables for API Boolean parameters
33 l_validate boolean;
34 --
35 -- Variables for IN/OUT parameters
36 --
37 -- Other variables
38 l_condition_id number;
39 l_proc varchar2(72) := g_package ||'create_ame_condition';
40 Begin
41 hr_utility.set_location(' Entering:' || l_proc,10);
42 --
43 -- Issue a savepoint
44 --
45 savepoint create_ame_condition_swi;
46 --
47 -- Initialise Multiple Message Detection
48 --
49 hr_multi_message.enable_message_list;
50 --
51 -- Remember IN OUT parameter IN values
52 --
53 --
54 -- Convert constant values to their corresponding boolean value
55 --
56 l_validate :=
57 hr_api.constant_to_boolean
58 (p_constant_value => p_validate);
59 --
60 -- Register Surrogate ID or user key values
61 --
62 ame_con_ins.set_base_key_value
63 (p_condition_id => p_condition_id
64 );
65 --
66 -- Call API
67 --
68 ame_condition_api.create_ame_condition
69 (p_validate => l_validate
70 ,p_condition_key => p_condition_key
71 ,p_condition_type => p_condition_type
72 ,p_attribute_id => p_attribute_id
73 ,p_parameter_one => p_parameter_one
74 ,p_parameter_two => p_parameter_two
75 ,p_parameter_three => p_parameter_three
76 ,p_include_upper_limit => p_include_upper_limit
77 ,p_include_lower_limit => p_include_lower_limit
78 ,p_string_value => p_string_value
79 ,p_condition_id => l_condition_id
80 ,p_con_start_date => p_con_start_date
81 ,p_con_end_date => p_con_end_date
82 ,p_con_object_version_number => p_con_object_version_number
83 ,p_stv_start_date => p_stv_start_date
84 ,p_stv_end_date => p_stv_end_date
85 ,p_stv_object_version_number => p_stv_object_version_number
86 );
87 --
88 -- Convert API warning boolean parameter values to specific
89 -- messages and add them to Multiple Message List
90 --
91 --
92 -- Convert API non-warning boolean parameter values
93 --
94 --
95 -- Derive the API return status value based on whether
96 -- messages of any type exist in the Multiple Message List.
97 -- Also disable Multiple Message Detection.
98 --
99 p_return_status := hr_multi_message.get_return_status_disable;
100 hr_utility.set_location(' Leaving:' || l_proc,20);
101 --
102 exception
103 when hr_multi_message.error_message_exist then
104 --
105 -- Catch the Multiple Message List exception which
106 -- indicates API processing has been aborted because
107 -- at least one message exists in the list.
108 --
109 rollback to create_ame_condition_swi;
110 --
111 -- Reset IN OUT parameters and set OUT parameters
112 --
113 p_con_start_date := null;
114 p_con_end_date := null;
115 p_con_object_version_number := null;
116 p_stv_start_date := null;
117 p_stv_end_date := null;
118 p_stv_object_version_number := null;
119 p_return_status := hr_multi_message.get_return_status_disable;
120 hr_utility.set_location(' Leaving:' || l_proc, 30);
121 when others then
122 --
123 -- When Multiple Message Detection is enabled catch
124 -- any Application specific or other unexpected
125 -- exceptions. Adding appropriate details to the
126 -- Multiple Message List. Otherwise re-raise the
127 -- error.
128 --
129 rollback to create_ame_condition_swi;
130 if hr_multi_message.unexpected_error_add(l_proc) then
131 hr_utility.set_location(' Leaving:' || l_proc,40);
132 raise;
133 end if;
134 --
135 -- Reset IN OUT and set OUT parameters
136 --
137 p_con_start_date := null;
138 p_con_end_date := null;
139 p_con_object_version_number := null;
140 p_stv_start_date := null;
141 p_stv_end_date := null;
142 p_stv_object_version_number := null;
143 p_return_status := hr_multi_message.get_return_status_disable;
144 hr_utility.set_location(' Leaving:' || l_proc,50);
145 end create_ame_condition;
146 -- ----------------------------------------------------------------------------
147 -- |-------------------------< update_ame_condition >-------------------------|
148 -- ----------------------------------------------------------------------------
149 PROCEDURE update_ame_condition
150 (p_validate in number default hr_api.g_false_num
151 ,p_condition_id in number
152 ,p_parameter_one in varchar2 default hr_api.g_varchar2
153 ,p_parameter_two in varchar2 default hr_api.g_varchar2
154 ,p_parameter_three in varchar2 default hr_api.g_varchar2
155 ,p_include_upper_limit in varchar2 default hr_api.g_varchar2
156 ,p_include_lower_limit in varchar2 default hr_api.g_varchar2
157 ,p_object_version_number in out nocopy number
158 ,p_start_date out nocopy date
159 ,p_end_date out nocopy date
160 ,p_return_status out nocopy varchar2
161 ) is
162 --
163 -- Variables for API Boolean parameters
164 l_validate boolean;
165 --
166 -- Variables for IN/OUT parameters
167 l_object_version_number number;
168 --
169 -- Other variables
170 l_proc varchar2(72) := g_package ||'update_ame_condition';
171 Begin
172 hr_utility.set_location(' Entering:' || l_proc,10);
173 --
174 -- Issue a savepoint
175 --
176 savepoint update_ame_condition_swi;
177 --
178 -- Initialise Multiple Message Detection
179 --
180 hr_multi_message.enable_message_list;
181 --
182 -- Remember IN OUT parameter IN values
183 --
184 l_object_version_number := p_object_version_number;
185 --
186 -- Convert constant values to their corresponding boolean value
187 --
188 l_validate :=
189 hr_api.constant_to_boolean
190 (p_constant_value => p_validate);
191 --
192 -- Register Surrogate ID or user key values
193 --
194 --
195 -- Call API
196 --
197 ame_condition_api.update_ame_condition
198 (p_validate => l_validate
199 ,p_condition_id => p_condition_id
200 ,p_parameter_one => p_parameter_one
201 ,p_parameter_two => p_parameter_two
202 ,p_parameter_three => p_parameter_three
203 ,p_include_upper_limit => p_include_upper_limit
204 ,p_include_lower_limit => p_include_lower_limit
205 ,p_object_version_number => p_object_version_number
206 ,p_start_date => p_start_date
207 ,p_end_date => p_end_date
208 );
209 --
210 -- Convert API warning boolean parameter values to specific
211 -- messages and add them to Multiple Message List
212 --
213 --
214 -- Convert API non-warning boolean parameter values
215 --
216 --
217 -- Derive the API return status value based on whether
218 -- messages of any type exist in the Multiple Message List.
219 -- Also disable Multiple Message Detection.
220 --
221 p_return_status := hr_multi_message.get_return_status_disable;
222 hr_utility.set_location(' Leaving:' || l_proc,20);
223 --
224 exception
225 when hr_multi_message.error_message_exist then
226 --
227 -- Catch the Multiple Message List exception which
228 -- indicates API processing has been aborted because
229 -- at least one message exists in the list.
230 --
231 rollback to update_ame_condition_swi;
232 --
233 -- Reset IN OUT parameters and set OUT parameters
234 --
235 p_object_version_number := l_object_version_number;
236 p_start_date := null;
237 p_end_date := null;
238 p_return_status := hr_multi_message.get_return_status_disable;
239 hr_utility.set_location(' Leaving:' || l_proc, 30);
240 when others then
241 --
242 -- When Multiple Message Detection is enabled catch
243 -- any Application specific or other unexpected
244 -- exceptions. Adding appropriate details to the
245 -- Multiple Message List. Otherwise re-raise the
246 -- error.
247 --
248 rollback to update_ame_condition_swi;
249 if hr_multi_message.unexpected_error_add(l_proc) then
250 hr_utility.set_location(' Leaving:' || l_proc,40);
251 raise;
252 end if;
253 --
254 -- Reset IN OUT and set OUT parameters
255 --
256 p_object_version_number := l_object_version_number;
257 p_start_date := null;
258 p_end_date := null;
259 p_return_status := hr_multi_message.get_return_status_disable;
260 hr_utility.set_location(' Leaving:' || l_proc,50);
261 end update_ame_condition;
262 -- ----------------------------------------------------------------------------
263 -- |-------------------------< delete_ame_condition >-------------------------|
264 -- ----------------------------------------------------------------------------
265 PROCEDURE delete_ame_condition
266 (p_validate in number default hr_api.g_false_num
267 ,p_condition_id in number
268 ,p_object_version_number in out nocopy number
269 ,p_start_date out nocopy date
270 ,p_end_date out nocopy date
271 ,p_return_status out nocopy varchar2
272 ) is
273 --
274 -- Variables for API Boolean parameters
275 l_validate boolean;
276 --
277 -- Variables for IN/OUT parameters
278 l_object_version_number number;
279 --
280 -- Other variables
281 l_proc varchar2(72) := g_package ||'delete_ame_condition';
282 Begin
283 hr_utility.set_location(' Entering:' || l_proc,10);
284 --
285 -- Issue a savepoint
286 --
287 savepoint delete_ame_condition_swi;
288 --
289 -- Initialise Multiple Message Detection
290 --
291 hr_multi_message.enable_message_list;
292 --
293 -- Remember IN OUT parameter IN values
294 --
295 l_object_version_number := p_object_version_number;
296 --
297 -- Convert constant values to their corresponding boolean value
298 --
299 l_validate :=
300 hr_api.constant_to_boolean
301 (p_constant_value => p_validate);
302 --
303 -- Register Surrogate ID or user key values
304 --
305 --
306 -- Call API
307 --
308 ame_condition_api.delete_ame_condition
309 (p_validate => l_validate
310 ,p_condition_id => p_condition_id
311 ,p_object_version_number => p_object_version_number
312 ,p_start_date => p_start_date
313 ,p_end_date => p_end_date
314 );
315 --
316 -- Convert API warning boolean parameter values to specific
317 -- messages and add them to Multiple Message List
318 --
319 --
320 -- Convert API non-warning boolean parameter values
321 --
322 --
323 -- Derive the API return status value based on whether
324 -- messages of any type exist in the Multiple Message List.
325 -- Also disable Multiple Message Detection.
326 --
327 p_return_status := hr_multi_message.get_return_status_disable;
328 hr_utility.set_location(' Leaving:' || l_proc,20);
329 --
330 exception
331 when hr_multi_message.error_message_exist then
332 --
333 -- Catch the Multiple Message List exception which
334 -- indicates API processing has been aborted because
335 -- at least one message exists in the list.
336 --
337 rollback to delete_ame_condition_swi;
338 --
339 -- Reset IN OUT parameters and set OUT parameters
340 --
341 p_object_version_number := l_object_version_number;
342 p_start_date := null;
343 p_end_date := null;
344 p_return_status := hr_multi_message.get_return_status_disable;
345 hr_utility.set_location(' Leaving:' || l_proc, 30);
346 when others then
347 --
348 -- When Multiple Message Detection is enabled catch
349 -- any Application specific or other unexpected
350 -- exceptions. Adding appropriate details to the
351 -- Multiple Message List. Otherwise re-raise the
352 -- error.
353 --
354 rollback to delete_ame_condition_swi;
355 if hr_multi_message.unexpected_error_add(l_proc) then
356 hr_utility.set_location(' Leaving:' || l_proc,40);
357 raise;
358 end if;
359 --
360 -- Reset IN OUT and set OUT parameters
361 --
362 p_object_version_number := l_object_version_number;
363 p_start_date := null;
364 p_end_date := null;
365 p_return_status := hr_multi_message.get_return_status_disable;
366 hr_utility.set_location(' Leaving:' || l_proc,50);
367 end delete_ame_condition;
368 -- ----------------------------------------------------------------------------
369 -- |------------------------< create_ame_string_value >-----------------------|
370 -- ----------------------------------------------------------------------------
371 PROCEDURE create_ame_string_value
372 (p_validate in number default hr_api.g_false_num
373 ,p_condition_id in number
374 ,p_string_value in varchar2
375 ,p_object_version_number out nocopy number
376 ,p_start_date out nocopy date
377 ,p_end_date out nocopy date
378 ,p_return_status out nocopy varchar2
379 ) is
380 --
381 -- Variables for API Boolean parameters
382 l_validate boolean;
383 --
384 -- Variables for IN/OUT parameters
385 --
386 -- Other variables
387 l_proc varchar2(72) := g_package ||'create_ame_string_value';
388 Begin
389 hr_utility.set_location(' Entering:' || l_proc,10);
390 --
391 -- Issue a savepoint
392 --
393 savepoint create_ame_string_value_swi;
394 --
395 -- Initialise Multiple Message Detection
396 --
397 hr_multi_message.enable_message_list;
398 --
399 -- Remember IN OUT parameter IN values
400 --
401 --
402 -- Convert constant values to their corresponding boolean value
403 --
404 l_validate :=
405 hr_api.constant_to_boolean
406 (p_constant_value => p_validate);
407 --
408 -- Register Surrogate ID or user key values
409 --
410 --
411 -- Call API
412 --
413 ame_condition_api.create_ame_string_value
414 (p_validate => l_validate
415 ,p_condition_id => p_condition_id
416 ,p_string_value => p_string_value
417 ,p_object_version_number => p_object_version_number
418 ,p_start_date => p_start_date
419 ,p_end_date => p_end_date
420 );
421 --
422 -- Convert API warning boolean parameter values to specific
423 -- messages and add them to Multiple Message List
424 --
425 --
426 -- Convert API non-warning boolean parameter values
427 --
428 --
429 -- Derive the API return status value based on whether
430 -- messages of any type exist in the Multiple Message List.
431 -- Also disable Multiple Message Detection.
432 --
433 p_return_status := hr_multi_message.get_return_status_disable;
434 hr_utility.set_location(' Leaving:' || l_proc,20);
435 --
436 exception
437 when hr_multi_message.error_message_exist then
438 --
439 -- Catch the Multiple Message List exception which
440 -- indicates API processing has been aborted because
441 -- at least one message exists in the list.
442 --
443 rollback to create_ame_string_value_swi;
444 --
445 -- Reset IN OUT parameters and set OUT parameters
446 --
447 p_object_version_number := null;
448 p_start_date := null;
449 p_end_date := null;
450 p_return_status := hr_multi_message.get_return_status_disable;
451 hr_utility.set_location(' Leaving:' || l_proc, 30);
452 when others then
453 --
454 -- When Multiple Message Detection is enabled catch
455 -- any Application specific or other unexpected
456 -- exceptions. Adding appropriate details to the
457 -- Multiple Message List. Otherwise re-raise the
458 -- error.
459 --
460 rollback to create_ame_string_value_swi;
461 if hr_multi_message.unexpected_error_add(l_proc) then
462 hr_utility.set_location(' Leaving:' || l_proc,40);
463 raise;
464 end if;
465 --
466 -- Reset IN OUT and set OUT parameters
467 --
468 p_object_version_number := null;
469 p_start_date := null;
470 p_end_date := null;
471 p_return_status := hr_multi_message.get_return_status_disable;
472 hr_utility.set_location(' Leaving:' || l_proc,50);
473 end create_ame_string_value;
474 -- ----------------------------------------------------------------------------
475 -- |------------------------< delete_ame_string_value >-----------------------|
476 -- ----------------------------------------------------------------------------
477 PROCEDURE delete_ame_string_value
478 (p_validate in number default hr_api.g_false_num
479 ,p_condition_id in number
480 ,p_string_value in varchar2
481 ,p_object_version_number in out nocopy number
482 ,p_start_date out nocopy date
483 ,p_end_date out nocopy date
484 ,p_return_status out nocopy varchar2
485 ) is
486 --
487 -- Variables for API Boolean parameters
488 l_validate boolean;
489 --
490 -- Variables for IN/OUT parameters
491 l_object_version_number number;
492 --
493 -- Other variables
494 l_proc varchar2(72) := g_package ||'delete_ame_string_value';
495 Begin
496 hr_utility.set_location(' Entering:' || l_proc,10);
497 --
498 -- Issue a savepoint
499 --
500 savepoint delete_ame_string_value_swi;
501 --
502 -- Initialise Multiple Message Detection
503 --
504 hr_multi_message.enable_message_list;
505 --
506 -- Remember IN OUT parameter IN values
507 --
508 l_object_version_number := p_object_version_number;
509 --
510 -- Convert constant values to their corresponding boolean value
511 --
512 l_validate :=
513 hr_api.constant_to_boolean
514 (p_constant_value => p_validate);
515 --
516 -- Register Surrogate ID or user key values
517 --
518 --
519 -- Call API
520 --
521 ame_condition_api.delete_ame_string_value
522 (p_validate => l_validate
523 ,p_condition_id => p_condition_id
524 ,p_string_value => p_string_value
525 ,p_object_version_number => p_object_version_number
526 ,p_start_date => p_start_date
527 ,p_end_date => p_end_date
528 );
529 --
530 -- Convert API warning boolean parameter values to specific
531 -- messages and add them to Multiple Message List
532 --
533 --
534 -- Convert API non-warning boolean parameter values
535 --
536 --
537 -- Derive the API return status value based on whether
538 -- messages of any type exist in the Multiple Message List.
539 -- Also disable Multiple Message Detection.
540 --
541 p_return_status := hr_multi_message.get_return_status_disable;
542 hr_utility.set_location(' Leaving:' || l_proc,20);
543 --
544 exception
545 when hr_multi_message.error_message_exist then
546 --
547 -- Catch the Multiple Message List exception which
548 -- indicates API processing has been aborted because
549 -- at least one message exists in the list.
550 --
551 rollback to delete_ame_string_value_swi;
552 --
553 -- Reset IN OUT parameters and set OUT parameters
554 --
555 p_object_version_number := l_object_version_number;
556 p_start_date := null;
557 p_end_date := null;
558 p_return_status := hr_multi_message.get_return_status_disable;
559 hr_utility.set_location(' Leaving:' || l_proc, 30);
560 when others then
561 --
562 -- When Multiple Message Detection is enabled catch
563 -- any Application specific or other unexpected
564 -- exceptions. Adding appropriate details to the
565 -- Multiple Message List. Otherwise re-raise the
566 -- error.
567 --
568 rollback to delete_ame_string_value_swi;
569 if hr_multi_message.unexpected_error_add(l_proc) then
570 hr_utility.set_location(' Leaving:' || l_proc,40);
571 raise;
572 end if;
573 --
574 -- Reset IN OUT and set OUT parameters
575 --
576 p_object_version_number := l_object_version_number;
577 p_start_date := null;
578 p_end_date := null;
579 p_return_status := hr_multi_message.get_return_status_disable;
580 hr_utility.set_location(' Leaving:' || l_proc,50);
581 end delete_ame_string_value;
582 end ame_condition_swi;