[Home] [Help]
PACKAGE BODY: APPS.IRC_LOCATION_PREFERENCES_API
Source
1 Package Body IRC_LOCATION_PREFERENCES_API as
2 /* $Header: irilpapi.pkb 120.3 2011/01/05 07:12:22 avarri noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := 'IRC_LOCATION_PREFERENCES_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< create_vac_rec_area_value >-------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_vac_rec_area_value
13 (p_validate in boolean default false
14 ,p_effective_date in date
15 ,p_vacancy_id in number default null
16 ,p_hierarchy_version_id in number default null
17 ,p_hierarchy_name in varchar2 default null
18 ,p_vac_rec_area_id out nocopy number
19 ,p_object_version_number out nocopy number
20 ) is
21 --
22 -- Declare cursors and local variables
23 --
24 l_effective_date date;
25 l_vac_rec_area_id number;
26 l_object_version_number number;
27 l_proc varchar2(72) := g_package||'create_vac_rec_area_value';
28 begin
29 hr_utility.set_location('Entering:'|| l_proc, 10);
30 --
31 -- Issue a savepoint
32 --
33 savepoint create_vac_rec_area_value;
34 --
35 -- Truncate the time portion from all IN date parameters
36 --
37 l_effective_date := trunc(p_effective_date);
38
39 --
40 -- Call Before Process User Hook
41 --
42 begin
43 IRC_LOCATION_PREFERENCES_BK1.create_vac_rec_area_value_b
44 (p_effective_date => l_effective_date
45 ,p_vacancy_id => p_vacancy_id
46 ,p_hierarchy_version_id => p_hierarchy_version_id
47 ,p_hierarchy_name => p_hierarchy_name
48 );
49 exception
50 when hr_api.cannot_find_prog_unit then
51 hr_api.cannot_find_prog_unit_error
52 (p_module_name => 'create_vac_rec_area_value'
53 ,p_hook_type => 'BP'
54 );
55 end;
56 --
57 -- Validation in addition to Row Handlers
58 --
59 --
60 -- Process Logic
61 --
62 irc_rav_ins.ins
63 (p_effective_date => l_effective_date
64 ,p_vacancy_id => p_vacancy_id
65 ,p_hierarchy_version_id => p_hierarchy_version_id
66 ,p_hierarchy_name => p_hierarchy_name
67 ,p_vac_rec_area_id => l_vac_rec_area_id
68 ,p_object_version_number => l_object_version_number
69 );
70 --
71 -- Call After Process User Hook
72 --
73 begin
74 IRC_LOCATION_PREFERENCES_BK1.create_vac_rec_area_value_a
75 (p_effective_date => l_effective_date
76 ,p_vacancy_id => p_vacancy_id
77 ,p_hierarchy_version_id => p_hierarchy_version_id
78 ,p_hierarchy_name => p_hierarchy_name
79 ,p_vac_rec_area_id => l_vac_rec_area_id
80 ,p_object_version_number => l_object_version_number
81 );
82 exception
83 when hr_api.cannot_find_prog_unit then
84 hr_api.cannot_find_prog_unit_error
85 (p_module_name => 'create_vac_rec_area_value'
86 ,p_hook_type => 'AP'
87 );
88 end;
89 --
90 -- When in validation only mode raise the Validate_Enabled exception
91 --
92 if p_validate then
93 raise hr_api.validate_enabled;
94 end if;
95 --
96 -- Set all IN OUT and OUT parameters with out values
97 --
98 p_vac_rec_area_id := l_vac_rec_area_id;
99 p_object_version_number := l_object_version_number;
100 --
101 hr_utility.set_location(' Leaving:'||l_proc, 70);
102 exception
103 when hr_api.validate_enabled then
104 --
105 -- As the Validate_Enabled exception has been raised
106 -- we must rollback to the savepoint
107 --
108 rollback to create_vac_rec_area_value;
109 --
110 -- Reset IN OUT parameters and set OUT parameters
111 -- (Any key or derived arguments must be set to null
112 -- when validation only mode is being used.)
113 --
114 p_vac_rec_area_id := null;
115 p_object_version_number := null;
116 --
117 hr_utility.set_location(' Leaving:'||l_proc, 80);
118 when others then
119 --
120 --
121 -- A validation or unexpected error has occured
122 --
123 rollback to create_vac_rec_area_value;
124 --
125 -- Reset IN OUT parameters and set all
126 -- OUT parameters, including warnings, to null
127 --
128 p_vac_rec_area_id := null;
129 p_object_version_number := null;
130 --
131 hr_utility.set_location(' Leaving:'||l_proc, 90);
132 raise;
133 end create_vac_rec_area_value;
134 --
135 -- ----------------------------------------------------------------------------
136 -- |--------------------------< create_location_preference >------------------|
137 -- ----------------------------------------------------------------------------
138 --
139 procedure create_location_preference
140 (p_validate in boolean default false
141 ,p_effective_date in date
142 ,p_object_id in number
143 ,p_object_type in varchar2
144 ,p_rec_area_id in number default null
145 ,p_business_group_id in number default null
146 ,p_country_code in varchar2 default null
147 ,p_location_id in number default null
148 ,p_attribute_category in varchar2 default null
149 ,p_attribute1 in varchar2 default null
150 ,p_attribute2 in varchar2 default null
151 ,p_attribute3 in varchar2 default null
152 ,p_attribute4 in varchar2 default null
153 ,p_attribute5 in varchar2 default null
154 ,p_attribute6 in varchar2 default null
155 ,p_attribute7 in varchar2 default null
156 ,p_attribute8 in varchar2 default null
157 ,p_attribute9 in varchar2 default null
158 ,p_attribute10 in varchar2 default null
159 ,p_attribute11 in varchar2 default null
160 ,p_attribute12 in varchar2 default null
161 ,p_attribute13 in varchar2 default null
162 ,p_attribute14 in varchar2 default null
163 ,p_attribute15 in varchar2 default null
164 ,p_attribute16 in varchar2 default null
165 ,p_attribute17 in varchar2 default null
166 ,p_attribute18 in varchar2 default null
167 ,p_attribute19 in varchar2 default null
168 ,p_attribute20 in varchar2 default null
169 ,p_attribute21 in varchar2 default null
170 ,p_attribute22 in varchar2 default null
171 ,p_attribute23 in varchar2 default null
172 ,p_attribute24 in varchar2 default null
173 ,p_attribute25 in varchar2 default null
174 ,p_attribute26 in varchar2 default null
175 ,p_attribute27 in varchar2 default null
176 ,p_attribute28 in varchar2 default null
177 ,p_attribute29 in varchar2 default null
178 ,p_attribute30 in varchar2 default null
179 ,p_location_pref_id out nocopy number
180 ,p_object_version_number out nocopy number
181 ) is
182 --
183 -- Declare cursors and local variables
184 --
185 l_effective_date date;
186 l_location_pref_id number;
187 l_object_version_number number;
188 l_proc varchar2(72) := g_package||'create_location_preference';
189 begin
190 hr_utility.set_location('Entering:'|| l_proc, 10);
191 --
192 -- Issue a savepoint
193 --
194 savepoint create_location_preference;
195 --
196 -- Truncate the time portion from all IN date parameters
197 --
198 l_effective_date := trunc(p_effective_date);
199
200 --
201 -- Call Before Process User Hook
202 --
203 begin
204 IRC_LOCATION_PREFERENCES_BK2.create_location_preference_b
205 (p_effective_date => l_effective_date
206 ,p_object_id => p_object_id
207 ,p_object_type => p_object_type
208 ,p_rec_area_id => p_rec_area_id
209 ,p_business_group_id => p_business_group_id
210 ,p_country_code => p_country_code
211 ,p_location_id => p_location_id
212 ,p_attribute_category => p_attribute_category
213 ,p_attribute1 => p_attribute1
214 ,p_attribute2 => p_attribute2
215 ,p_attribute3 => p_attribute3
216 ,p_attribute4 => p_attribute4
217 ,p_attribute5 => p_attribute5
218 ,p_attribute6 => p_attribute6
219 ,p_attribute7 => p_attribute7
220 ,p_attribute8 => p_attribute8
221 ,p_attribute9 => p_attribute9
222 ,p_attribute10 => p_attribute10
223 ,p_attribute11 => p_attribute11
224 ,p_attribute12 => p_attribute12
225 ,p_attribute13 => p_attribute13
226 ,p_attribute14 => p_attribute14
227 ,p_attribute15 => p_attribute15
228 ,p_attribute16 => p_attribute16
229 ,p_attribute17 => p_attribute17
230 ,p_attribute18 => p_attribute18
231 ,p_attribute19 => p_attribute19
232 ,p_attribute20 => p_attribute20
233 ,p_attribute21 => p_attribute21
234 ,p_attribute22 => p_attribute22
235 ,p_attribute23 => p_attribute23
236 ,p_attribute24 => p_attribute24
237 ,p_attribute25 => p_attribute25
238 ,p_attribute26 => p_attribute26
239 ,p_attribute27 => p_attribute27
240 ,p_attribute28 => p_attribute28
241 ,p_attribute29 => p_attribute29
242 ,p_attribute30 => p_attribute30
243 );
244 exception
245 when hr_api.cannot_find_prog_unit then
246 hr_api.cannot_find_prog_unit_error
247 (p_module_name => 'create_location_preference'
248 ,p_hook_type => 'BP'
249 );
250 end;
251 --
252 -- Validation in addition to Row Handlers
253 --
254 --
255 -- Process Logic
256 --
257 irc_ilp_ins.ins
258 (p_effective_date => l_effective_date
259 ,p_object_id => p_object_id
260 ,p_object_type => p_object_type
261 ,p_rec_area_id => p_rec_area_id
262 ,p_business_group_id => p_business_group_id
263 ,p_country_code => p_country_code
264 ,p_location_id => p_location_id
265 ,p_attribute_category => p_attribute_category
266 ,p_attribute1 => p_attribute1
267 ,p_attribute2 => p_attribute2
268 ,p_attribute3 => p_attribute3
269 ,p_attribute4 => p_attribute4
270 ,p_attribute5 => p_attribute5
271 ,p_attribute6 => p_attribute6
272 ,p_attribute7 => p_attribute7
273 ,p_attribute8 => p_attribute8
274 ,p_attribute9 => p_attribute9
275 ,p_attribute10 => p_attribute10
276 ,p_attribute11 => p_attribute11
277 ,p_attribute12 => p_attribute12
278 ,p_attribute13 => p_attribute13
279 ,p_attribute14 => p_attribute14
280 ,p_attribute15 => p_attribute15
281 ,p_attribute16 => p_attribute16
282 ,p_attribute17 => p_attribute17
283 ,p_attribute18 => p_attribute18
284 ,p_attribute19 => p_attribute19
285 ,p_attribute20 => p_attribute20
286 ,p_attribute21 => p_attribute21
287 ,p_attribute22 => p_attribute22
288 ,p_attribute23 => p_attribute23
289 ,p_attribute24 => p_attribute24
290 ,p_attribute25 => p_attribute25
291 ,p_attribute26 => p_attribute26
292 ,p_attribute27 => p_attribute27
293 ,p_attribute28 => p_attribute28
294 ,p_attribute29 => p_attribute29
295 ,p_attribute30 => p_attribute30
296 ,p_location_pref_id => l_location_pref_id
297 ,p_object_version_number=> l_object_version_number
298 );
299 --
300 -- Call After Process User Hook
301 --
302 begin
303 IRC_LOCATION_PREFERENCES_BK2.create_location_preference_a
304 (p_effective_date => l_effective_date
305 ,p_object_id => p_object_id
306 ,p_object_type => p_object_type
307 ,p_rec_area_id => p_rec_area_id
308 ,p_business_group_id => p_business_group_id
309 ,p_country_code => p_country_code
310 ,p_location_id => p_location_id
311 ,p_attribute_category => p_attribute_category
312 ,p_attribute1 => p_attribute1
313 ,p_attribute2 => p_attribute2
314 ,p_attribute3 => p_attribute3
315 ,p_attribute4 => p_attribute4
316 ,p_attribute5 => p_attribute5
317 ,p_attribute6 => p_attribute6
318 ,p_attribute7 => p_attribute7
319 ,p_attribute8 => p_attribute8
320 ,p_attribute9 => p_attribute9
321 ,p_attribute10 => p_attribute10
322 ,p_attribute11 => p_attribute11
323 ,p_attribute12 => p_attribute12
324 ,p_attribute13 => p_attribute13
325 ,p_attribute14 => p_attribute14
326 ,p_attribute15 => p_attribute15
327 ,p_attribute16 => p_attribute16
328 ,p_attribute17 => p_attribute17
329 ,p_attribute18 => p_attribute18
330 ,p_attribute19 => p_attribute19
331 ,p_attribute20 => p_attribute20
332 ,p_attribute21 => p_attribute21
333 ,p_attribute22 => p_attribute22
334 ,p_attribute23 => p_attribute23
335 ,p_attribute24 => p_attribute24
336 ,p_attribute25 => p_attribute25
337 ,p_attribute26 => p_attribute26
338 ,p_attribute27 => p_attribute27
339 ,p_attribute28 => p_attribute28
340 ,p_attribute29 => p_attribute29
341 ,p_attribute30 => p_attribute30
342 ,p_location_pref_id => l_location_pref_id
343 ,p_object_version_number=> l_object_version_number
344 );
345 exception
346 when hr_api.cannot_find_prog_unit then
347 hr_api.cannot_find_prog_unit_error
348 (p_module_name => 'create_location_preference'
349 ,p_hook_type => 'AP'
350 );
351 end;
352 --
353 -- When in validation only mode raise the Validate_Enabled exception
354 --
355 if p_validate then
356 raise hr_api.validate_enabled;
357 end if;
358 --
359 -- Set all IN OUT and OUT parameters with out values
360 --
361 p_location_pref_id := l_location_pref_id;
362 p_object_version_number := l_object_version_number;
363 --
364 hr_utility.set_location(' Leaving:'||l_proc, 70);
365 exception
366 when hr_api.validate_enabled then
367 --
368 -- As the Validate_Enabled exception has been raised
369 -- we must rollback to the savepoint
370 --
371 rollback to create_location_preference;
372 --
373 -- Reset IN OUT parameters and set OUT parameters
374 -- (Any key or derived arguments must be set to null
375 -- when validation only mode is being used.)
376 --
377 p_location_pref_id := null;
378 p_object_version_number := null;
379 --
380 hr_utility.set_location(' Leaving:'||l_proc, 80);
381 when others then
382 --
383 --
384 -- A validation or unexpected error has occured
385 --
386 rollback to create_location_preference;
387 --
388 -- Reset IN OUT parameters and set all
389 -- OUT parameters, including warnings, to null
390 --
391 p_location_pref_id := null;
392 p_object_version_number := null;
393 --
394 hr_utility.set_location(' Leaving:'||l_proc, 90);
395 raise;
396 end create_location_preference;
397 --
398 -- ----------------------------------------------------------------------------
399 -- |--------------------------< delete_vac_rec_area_value >-------------------|
400 -- ----------------------------------------------------------------------------
401 --
402 procedure delete_vac_rec_area_value
403 (p_validate in boolean default false
404 ,p_vac_rec_area_id in number
405 ,p_object_version_number in number
406 ) is
407 --
408 -- Declare cursors and local variables
409 --
410 l_in_out_parameter number;
411 l_effective_date date;
412 l_proc varchar2(72) := g_package||'delete_vac_rec_area_value';
413 begin
414 hr_utility.set_location('Entering:'|| l_proc, 10);
415 --
416 -- Issue a savepoint
417 --
418 savepoint delete_vac_rec_area_value;
419 --
420 -- Call Before Process User Hook
421 --
422 begin
423 IRC_LOCATION_PREFERENCES_BK3.delete_vac_rec_area_value_b
424 (p_vac_rec_area_id
425 ,p_object_version_number
426 );
427 exception
428 when hr_api.cannot_find_prog_unit then
429 hr_api.cannot_find_prog_unit_error
430 (p_module_name => 'delete_vac_rec_area_value'
431 ,p_hook_type => 'BP'
432 );
433 end;
434 --
435 -- Validation in addition to Row Handlers
436 --
437 irc_rav_del.del(p_vac_rec_area_id
438 ,p_object_version_number
439 );
440 --
441 -- Process Logic
442 --
443 --
444 -- Call After Process User Hook
445 --
446 begin
447 IRC_LOCATION_PREFERENCES_BK3.delete_vac_rec_area_value_a
448 (p_vac_rec_area_id
449 ,p_object_version_number
450 );
451 exception
452 when hr_api.cannot_find_prog_unit then
453 hr_api.cannot_find_prog_unit_error
454 (p_module_name => 'delete_vac_rec_area_value'
455 ,p_hook_type => 'AP'
456 );
457 end;
458 --
459 -- When in validation only mode raise the Validate_Enabled exception
460 --
461 if p_validate then
462 raise hr_api.validate_enabled;
463 end if;
464 --
465 hr_utility.set_location(' Leaving:'||l_proc, 70);
466 exception
467 when hr_api.validate_enabled then
468 --
469 -- As the Validate_Enabled exception has been raised
470 -- we must rollback to the savepoint
471 --
472 rollback to delete_vac_rec_area_value;
473 --
474 hr_utility.set_location(' Leaving:'||l_proc, 80);
475 when others then
476 --
477 -- A validation or unexpected error has occured
478 --
479 rollback to delete_vac_rec_area_value;
480 --
481 hr_utility.set_location(' Leaving:'||l_proc, 90);
482 raise;
483 end delete_vac_rec_area_value;
484 --
485 -- ----------------------------------------------------------------------------
486 -- |--------------------------< delete_location_preference >------------------|
487 -- ----------------------------------------------------------------------------
488 --
489 procedure delete_location_preference
490 (p_validate in boolean default false
491 ,p_location_pref_id in number
492 ,p_object_version_number in number
493 ) is
494 --
495 -- Declare cursors and local variables
496 --
497 l_in_out_parameter number;
498 l_effective_date date;
499 l_proc varchar2(72) := g_package||'delete_location_preference';
500 begin
501 hr_utility.set_location('Entering:'|| l_proc, 10);
502 --
503 -- Issue a savepoint
504 --
505 savepoint delete_location_preference;
506 --
507 -- Call Before Process User Hook
508 --
509 begin
510 IRC_LOCATION_PREFERENCES_BK4.delete_location_preference_b
511 (p_location_pref_id
512 ,p_object_version_number
513 );
514 exception
515 when hr_api.cannot_find_prog_unit then
516 hr_api.cannot_find_prog_unit_error
517 (p_module_name => 'delete_location_preference'
518 ,p_hook_type => 'BP'
519 );
520 end;
521 --
522 -- Validation in addition to Row Handlers
523 --
524 irc_ilp_del.del(p_location_pref_id
525 ,p_object_version_number
526 );
527 --
528 -- Process Logic
529 --
530 --
531 -- Call After Process User Hook
532 --
533 begin
534 IRC_LOCATION_PREFERENCES_BK4.delete_location_preference_a
535 (p_location_pref_id
536 ,p_object_version_number
537 );
538 exception
539 when hr_api.cannot_find_prog_unit then
540 hr_api.cannot_find_prog_unit_error
541 (p_module_name => 'delete_location_preference'
542 ,p_hook_type => 'AP'
543 );
544 end;
545 --
546 -- When in validation only mode raise the Validate_Enabled exception
547 --
548 if p_validate then
549 raise hr_api.validate_enabled;
550 end if;
551 --
552 hr_utility.set_location(' Leaving:'||l_proc, 70);
553 exception
554 when hr_api.validate_enabled then
555 --
556 -- As the Validate_Enabled exception has been raised
557 -- we must rollback to the savepoint
558 --
559 rollback to delete_location_preference;
560 --
561 hr_utility.set_location(' Leaving:'||l_proc, 80);
562 when others then
563 --
564 -- A validation or unexpected error has occured
565 --
566 rollback to delete_location_preference;
567 --
568 hr_utility.set_location(' Leaving:'||l_proc, 90);
569 raise;
570 end delete_location_preference;
571 --
572 -- ----------------------------------------------------------------------------
573 -- |--------------------------< update_vac_rec_area_value >-------------------|
574 -- ----------------------------------------------------------------------------
575 --
576 procedure update_vac_rec_area_value
577 (p_validate in boolean default false
578 ,p_effective_date in date
579 ,p_vacancy_id in number default hr_api.g_number
580 ,p_hierarchy_version_id in number default hr_api.g_number
581 ,p_hierarchy_name in varchar2 default hr_api.g_varchar2
582 ,p_vac_rec_area_id in number
583 ,p_object_version_number in out nocopy number
584 ) is
585 --
586 -- Declare cursors and local variables
587 --
588 l_effective_date date;
589 l_object_version_number number;
590 l_proc varchar2(72) := g_package||'update_vac_rec_area_value';
591 --
592 begin
593 hr_utility.set_location('Entering:'|| l_proc, 10);
594 --
595 -- Issue a savepoint
596 --
597 savepoint update_vac_rec_area_value;
598 --
599 -- Truncate the time portion from all IN date parameters
600 --
601 l_effective_date := trunc(p_effective_date);
602 l_object_version_number := p_object_version_number;
603 --
604 -- Call Before Process User Hook
605 --
606 begin
607 IRC_LOCATION_PREFERENCES_BK5.update_vac_rec_area_value_b
608 (p_effective_date => l_effective_date
609 ,p_vacancy_id => p_vacancy_id
610 ,p_hierarchy_version_id => p_hierarchy_version_id
611 ,p_hierarchy_name => p_hierarchy_name
612 );
613 exception
614 when hr_api.cannot_find_prog_unit then
615 hr_api.cannot_find_prog_unit_error
616 (p_module_name => 'update_vac_rec_area_value'
617 ,p_hook_type => 'BP'
618 );
619 end;
620 --
621 -- Validation in addition to Row Handlers
622 --
623 -- Update the Recruiting Area
624 --
625 irc_rav_upd.upd
626 (p_effective_date => l_effective_date
627 ,p_vacancy_id => p_vacancy_id
628 ,p_hierarchy_version_id => p_hierarchy_version_id
629 ,p_hierarchy_name => p_hierarchy_name
630 ,p_vac_rec_area_id => p_vac_rec_area_id
631 ,p_object_version_number => l_object_version_number
632 );
633 --
634 -- Call After Process User Hook
635 --
636 begin
637 IRC_LOCATION_PREFERENCES_BK5.update_vac_rec_area_value_a
638 (p_effective_date => l_effective_date
639 ,p_vacancy_id => p_vacancy_id
640 ,p_hierarchy_version_id => p_hierarchy_version_id
641 ,p_hierarchy_name => p_hierarchy_name
642 ,p_vac_rec_area_id => p_vac_rec_area_id
643 ,p_object_version_number => l_object_version_number
644 );
645 exception
646 when hr_api.cannot_find_prog_unit then
647 hr_api.cannot_find_prog_unit_error
648 (p_module_name => 'update_vac_rec_area_value'
649 ,p_hook_type => 'AP'
650 );
651 end;
652 --
653 -- When in validation only mode raise the Validate_Enabled exception
654 --
655 if p_validate then
656 raise hr_api.validate_enabled;
657 end if;
658 --
659 -- Set all IN OUT and OUT parameters with out values
660 --
661 p_object_version_number := l_object_version_number;
662 --
663 hr_utility.set_location(' Leaving:'||l_proc, 70);
664 exception
665 when hr_api.validate_enabled then
666 --
667 -- As the Validate_Enabled exception has been raised
668 -- we must rollback to the savepoint
669 --
670 rollback to update_vac_rec_area_value;
671 --
672 -- Reset IN OUT parameters and set OUT parameters
673 -- (Any key or derived arguments must be set to null
674 -- when validation only mode is being used.)
675 --
676 p_object_version_number := l_object_version_number;
677 --
678 hr_utility.set_location(' Leaving:'||l_proc, 80);
679 when others then
680 --
681 --
682 -- A validation or unexpected error has occured
683 --
684 rollback to update_vac_rec_area_value;
685 --
686 -- Reset IN OUT parameters and set all
687 -- OUT parameters, including warnings, to null
688 --
689 p_object_version_number := l_object_version_number;
690 --
691 hr_utility.set_location(' Leaving:'||l_proc, 90);
692 raise;
693 end update_vac_rec_area_value;
694 --
695 end IRC_LOCATION_PREFERENCES_API;