[Home] [Help]
PACKAGE BODY: APPS.IRC_VACANCY_CONSIDERATIONS_API
Source
1 Package Body IRC_VACANCY_CONSIDERATIONS_API as
2 /* $Header: irivcapi.pkb 120.2.12010000.2 2008/11/04 13:53:29 avarri ship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' IRC_VACANCY_CONSIDERATIONS_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |----------------------< GET_EMAIL_MESSAGE_BODY >--------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 function get_email_message_body
13 (p_person_id in number
14 ,p_vacancy_id in number
15 ,p_effective_date in date
16 )
17 return varchar2 is
18 --
19 -- Declare cursors and local variables
20 --
21 cursor c_potential_applicant_details is
22 select first_name
23 from per_all_people_f
24 where person_id = p_person_id;
25 --
26 cursor c_recruiter_details is
27 select ppl.full_name
28 , pj.name job_name
29 from per_all_people_f ppl
30 , per_all_assignments_f pasg
31 , per_jobs pj
32 where ppl.person_id = fnd_global.employee_id
33 and ppl.person_id = pasg.person_id
34 and pasg.primary_flag = 'Y'
35 and pasg.job_id = pj.job_id(+)
36 and p_effective_date
37 between ppl.effective_start_date
38 and ppl.effective_end_date
39 and p_effective_date
40 between pasg.effective_start_date
41 and pasg.effective_end_date;
42 --
43 cursor c_posting_details is
44 select pctl.brief_description
45 , pctl.job_title
46 , pctl.posting_content_id
47 , pctl.name
48 from per_recruitment_activity_for raf
49 , per_recruitment_activities ra
50 , irc_posting_contents_tl pctl
51 where raf.vacancy_id = p_vacancy_id
52 and raf.recruitment_activity_id = ra.recruitment_activity_id
53 and ra.posting_content_id = pctl.posting_content_id
54 and userenv('LANG') = pctl.language
55 and rownum = 1;
56 --
57 l_message_intro VARCHAR2(2000) ;
58 l_message_conc VARCHAR2(2000) ;
59
60 l_base_url VARCHAR2(250);
61 l_whole_url VARCHAR2(2000);
62 l_appl_first_name VARCHAR2(150);
63 l_recr_full_name VARCHAR2(150);
64 l_recr_job_name VARCHAR2(150);
65 l_job_title irc_posting_contents_tl.job_title%type;
66 l_posting_content_id irc_posting_contents_tl.posting_content_id%type;
67 l_posting_content_name irc_posting_contents_tl.name%type;
68 l_name VARCHAR2(240);
69 l_brief_description_clob irc_posting_contents_tl.brief_description%type;
70 l_brief_description_v2 varchar2(240) default '';
71 l_user_name VARCHAR2(240) ;
72 l_amount BINARY_INTEGER default 240;
73
74 l_whole_message VARCHAR2(32000);
75 l_proc varchar2(72) := g_package||
76 'get_email_message_body';
77 l_apps_fwk_agent VARCHAR2(2000);
78 --
79 begin
80 hr_utility.set_location('Entering:'|| l_proc, 10);
81 --
82 -- Obtain all the data for use in the message.
83 --
84 --Commented for Bug 6004149
85 --l_base_url := fnd_profile.value('IRC_JOB_NOTIFICATION_URL');
86
87 if (irc_utilities_pkg.is_internal_person(p_person_id,p_effective_date)='TRUE') then
88 l_apps_fwk_agent := rtrim(fnd_profile.value_specific('APPS_FRAMEWORK_AGENT',0,0,0,0,0)
89 ||fnd_profile.value('ICX_PREFIX'),'/');
90 l_base_url := irc_seeker_vac_matching_pkg.get_job_notification_function('Y');
91 else
92 l_apps_fwk_agent := rtrim(nvl(fnd_profile.value('IRC_FRAMEWORK_AGENT'),fnd_profile.value('APPS_FRAMEWORK_AGENT'))
93 ||fnd_profile.value('ICX_PREFIX'),'/');
94 l_base_url := irc_seeker_vac_matching_pkg.get_job_notification_function('N');
95 end if;
96 --
97 if l_base_url is null then
98 fnd_message.set_name('PER','IRC_412056_NO_EMAIL_JOB_URL');
99 fnd_message.raise_error;
100 end if;
101 --
102 open c_potential_applicant_details ;
103 fetch c_potential_applicant_details into l_appl_first_name;
104 close c_potential_applicant_details;
105 --
106 open c_recruiter_details ;
107 fetch c_recruiter_details into l_recr_full_name, l_recr_job_name ;
108 close c_recruiter_details ;
109 -- Get the advert details (inc a clob), convert to a v2 for workflow to accept.
110 open c_posting_details ;
111 fetch c_posting_details into l_brief_description_clob, l_job_title, l_posting_content_id, l_posting_content_name ;
112 close c_posting_details;
113 --
114 -- Incase the job_title is null, Display posting name.
115 if ( l_job_title is null ) then
116 l_name := l_posting_content_name;
117 else
118 l_name := l_job_title;
119 end if;
120 --
121 l_whole_url:= '<a HREF="'
122 || l_apps_fwk_agent
123 || '/OA_HTML/OA.jsp?OAFunc='
124 || l_base_url
125 || '&p_svid='||to_char(p_vacancy_id)
126 || '&p_spid='||to_char(l_posting_content_id)
127 || '">'
128 || l_name
129 || '</a>';
130
131 -- Convert the clob to a v2 so that wf can display it.
132 IF (dbms_lob.getlength(l_brief_description_clob) > 0) THEN
133 dbms_lob.read( l_brief_description_clob
134 , l_amount
135 , 1
136 , l_brief_description_v2
137 );
138 ELSE
139 l_brief_description_v2 := '';
140 END IF;
141
142 l_user_name := irc_notification_helper_pkg.get_job_seekers_role
143 (p_person_id => p_person_id);
144
145 -- Build the message up.
146
147 fnd_message.set_name('PER','IRC_PURSUE_SEEKER_INTRO');
148 fnd_message.set_token('SEEKER_FIRST_NAME',l_appl_first_name );
149 fnd_message.set_token('VAC_JOB_TITLE', l_name);
150 l_message_intro := fnd_message.get;
151
152 fnd_message.set_name('PER','IRC_PURSUE_SEEKER_CONC');
153 fnd_message.set_token('URL', l_whole_url);
154 fnd_message.set_token('SENDER_FULL_NAME', l_recr_full_name);
155 fnd_message.set_token('SENDER_JOB_TITLE', l_recr_job_name);
156 l_message_conc := fnd_message.get;
157
158 l_whole_message := l_message_intro
159 || '<br>' || l_brief_description_v2||'<br><br>'
160 || l_message_conc ;
161
162 RETURN l_whole_message;
163 hr_utility.set_location('Leaving:'|| l_proc, 100);
164 end get_email_message_body;
165 --
166 -- ----------------------------------------------------------------------------
167 -- |----------------------< GET_TEXT_MESSAGE_BODY >--------------------------|
168 -- ----------------------------------------------------------------------------
169 function get_text_message_body
170 (p_person_id in number
171 ,p_vacancy_id in number
172 ,p_effective_date in date
173 )
174 return varchar2 is
175 --
176 -- Declare cursors and local variables
177 --
178 cursor c_potential_applicant_details is
179 select first_name
180 from per_all_people_f
181 where person_id = p_person_id;
182 --
183 cursor c_recruiter_details is
184 select ppl.full_name
185 , pj.name job_name
186 from per_all_people_f ppl
187 , per_all_assignments_f pasg
188 , per_jobs pj
189 where ppl.person_id = fnd_global.employee_id
190 and ppl.person_id = pasg.person_id
191 and pasg.primary_flag = 'Y'
192 and pasg.job_id = pj.job_id(+)
193 and p_effective_date
194 between ppl.effective_start_date
195 and ppl.effective_end_date
196 and p_effective_date
197 between pasg.effective_start_date
198 and pasg.effective_end_date;
199 --
200 cursor c_posting_details is
201 select pctl.brief_description
202 , pctl.job_title
203 , pctl.posting_content_id
204 , pctl.name
205 from per_recruitment_activity_for raf
206 , per_recruitment_activities ra
207 , irc_posting_contents_tl pctl
208 where raf.vacancy_id = p_vacancy_id
209 and raf.recruitment_activity_id = ra.recruitment_activity_id
210 and ra.posting_content_id = pctl.posting_content_id
211 and userenv('LANG') = pctl.language
212 and rownum = 1;
213 --
214 l_message_intro VARCHAR2(2000) ;
215 l_message_conc VARCHAR2(2000) ;
216
217 l_base_url VARCHAR2(250);
218 l_whole_url VARCHAR2(2000);
219 l_appl_first_name VARCHAR2(150);
220 l_recr_full_name VARCHAR2(150);
221 l_recr_job_name VARCHAR2(150);
222 l_job_title irc_posting_contents_tl.job_title%type;
223 l_posting_content_id irc_posting_contents_tl.posting_content_id%type;
224 l_posting_content_name irc_posting_contents_tl.name%type;
225 l_name VARCHAR2(240);
226 l_brief_description_clob irc_posting_contents_tl.brief_description%type;
227 l_brief_description_v2 varchar2(240) default '';
228 l_user_name VARCHAR2(240) ;
229 l_amount BINARY_INTEGER default 240;
230
231 l_whole_message VARCHAR2(32000);
232 l_proc varchar2(72) := g_package||
233 'get_text_message_body';
234 l_apps_fwk_agent VARCHAR2(2000);
235 --
236 begin
237 hr_utility.set_location('Entering:'|| l_proc, 10);
238 --
239 -- Obtain all the data for use in the message.
240 --
241 --Commented for Bug 6004149
242 --l_base_url := fnd_profile.value('IRC_JOB_NOTIFICATION_URL');
243 if (irc_utilities_pkg.is_internal_person(p_person_id,p_effective_date)='TRUE') then
244 l_apps_fwk_agent := rtrim(fnd_profile.value_specific('APPS_FRAMEWORK_AGENT',0,0,0,0,0)
245 ||fnd_profile.value('ICX_PREFIX'),'/');
246 l_base_url := irc_seeker_vac_matching_pkg.get_job_notification_function('Y');
247 else
248 l_apps_fwk_agent := rtrim(nvl(fnd_profile.value('IRC_FRAMEWORK_AGENT'),fnd_profile.value('APPS_FRAMEWORK_AGENT'))
249 ||fnd_profile.value('ICX_PREFIX'),'/');
250 l_base_url := irc_seeker_vac_matching_pkg.get_job_notification_function('N');
251 end if;
252 --
253 if l_base_url is null then
254 fnd_message.set_name('PER','IRC_412056_NO_EMAIL_JOB_URL');
255 fnd_message.raise_error;
256 end if;
257 --
258 open c_potential_applicant_details ;
259 fetch c_potential_applicant_details into l_appl_first_name;
260 close c_potential_applicant_details;
261 --
262 open c_recruiter_details ;
263 fetch c_recruiter_details into l_recr_full_name, l_recr_job_name ;
264 close c_recruiter_details ;
265 -- Get the advert details (inc a clob), convert to a v2 for workflow to accept.
266 open c_posting_details ;
267 fetch c_posting_details into l_brief_description_clob, l_job_title, l_posting_content_id, l_posting_content_name ;
268 close c_posting_details;
269 --
270 -- Incase the job_title is null, Display posting name.
271 if ( l_job_title is null ) then
272 l_name := l_posting_content_name;
273 else
274 l_name := l_job_title;
275 end if;
276 --
277 l_whole_url:= l_apps_fwk_agent
278 || '/OA_HTML/OA.jsp?OAFunc='
279 || l_base_url
280 || '&p_svid='||to_char(p_vacancy_id)
281 || '&p_spid='||to_char(l_posting_content_id);
282
283 -- Convert the clob to a v2 so that wf can display it.
284 IF (dbms_lob.getlength(l_brief_description_clob) > 0) THEN
285 dbms_lob.read( l_brief_description_clob
286 , l_amount
287 , 1
288 , l_brief_description_v2
289 );
290 ELSE
291 l_brief_description_v2 := '';
292 END IF;
293
294 l_user_name := irc_notification_helper_pkg.get_job_seekers_role
295 (p_person_id => p_person_id);
296
297 -- Build the message up.
298
299 fnd_message.set_name('PER','IRC_PURSUE_SEEKER_INTRO_TEXT');
300 fnd_message.set_token('SEEKER_FIRST_NAME',l_appl_first_name );
301 fnd_message.set_token('VAC_JOB_TITLE', l_name);
302 l_message_intro := fnd_message.get;
303
304 fnd_message.set_name('PER','IRC_PURSUE_SEEKER_CONC_TEXT');
305 fnd_message.set_token('URL', l_whole_url);
306 fnd_message.set_token('SENDER_FULL_NAME', l_recr_full_name);
307 fnd_message.set_token('SENDER_JOB_TITLE', l_recr_job_name);
308 l_message_conc := fnd_message.get;
309
310 l_whole_message := l_message_intro
311 || '\n' || l_brief_description_v2||'\n\n'
312 || l_message_conc ;
313
314 RETURN l_whole_message;
315 hr_utility.set_location('Leaving:'|| l_proc, 100);
316 end get_text_message_body;
317
318 -- ----------------------------------------------------------------------------
319 -- |--------------------------< NOTIFY_SEEKER_IF_REQUIRED >-------------------|
320 -- ----------------------------------------------------------------------------
321 -- Comment
322 -- This procedure will send an email to a job seeker under certain
323 -- circumstances.
324 procedure notify_seeker_if_required
325 (p_person_id in number
326 ,p_vacancy_id in number
327 ,p_consideration_status in varchar2
328 ,p_effective_date in date
329 ,p_validate_only in boolean)
330 is
331 --
332 -- Declare cursors and local variables
333 --
334 l_proc varchar2(72) := g_package||
335 'notify_seeker_if_required';
336 l_message_subject VARCHAR2(240)
337 DEFAULT fnd_message.get_string('PER','IRC_PURSUE_SEEKER_SUBJECT');
338 --
339 l_id NUMBER;
340 l_rec_found varchar2(1);
341 --
342 cursor c_posting_details is
343 select null
344 from per_recruitment_activity_for raf
345 , per_recruitment_activities ra
346 , irc_posting_contents_tl pctl
347 where raf.vacancy_id = p_vacancy_id
348 and raf.recruitment_activity_id = ra.recruitment_activity_id
349 and ra.posting_content_id = pctl.posting_content_id
350 and userenv('LANG') = pctl.language
351 and rownum = 1;
352 begin
353 hr_utility.set_location('Entering:'|| l_proc, 10);
354 --
355 -- An email only need to be sent under certain conditions
356 --
357 if p_consideration_status = 'PURSUE' and p_validate_only = FALSE then
358 --
359 open c_posting_details;
360 fetch c_posting_details into l_rec_found;
361 if(c_posting_details%notfound)
362 then
363 close c_posting_details;
364 fnd_message.set_name('PER','IRC_412148_VAC_NO_POSTING');
365 fnd_message.raise_error;
366 end if;
367 close c_posting_details;
368 l_id := irc_notification_helper_pkg.send_notification
369 ( p_person_id => p_person_id
370 , p_subject => l_message_subject
371 , p_html_body => get_email_message_body
372 ( p_person_id => p_person_id
373 , p_vacancy_id => p_vacancy_id
374 , p_effective_date => p_effective_date)
375 , p_text_body => get_text_message_body
376 ( p_person_id => p_person_id
377 , p_vacancy_id => p_vacancy_id
378 , p_effective_date => p_effective_date)
379 );
380 end if;
381 --
382 hr_utility.set_location('Leaving:'|| l_proc, 100);
383 exception
384 when others then
385 -- Let the calling code handle any errors
386 raise;
387 end notify_seeker_if_required;
388 -- ----------------------------------------------------------------------------
389 -- |--------------------------< CREATE_VACANCY_CONSIDERATION >----------------|
390 -- ----------------------------------------------------------------------------
391 --
392 procedure create_vacancy_consideration
393 (p_validate in boolean default false
394 ,p_person_id in number
395 ,p_vacancy_id in number
396 ,p_consideration_status in varchar2 default 'CONSIDER'
397 ,p_vacancy_consideration_id out nocopy number
398 ,p_object_version_number out nocopy number
399 ,p_effective_date in date
400 )is
401 --
402 -- Declare cursors and local variables
403 --
404 --
405 l_proc varchar2(72) := g_package||
406 'create_vacancy_consideration';
407 l_vacancy_consideration_id number;
408 l_object_version_number number;
409 l_effective_date date;
410 --
411 begin
412 hr_utility.set_location('Entering:'|| l_proc, 10);
413 --
414 -- Issue a savepoint
415 --
416 savepoint create_vacancy_consideration;
417 --
418 -- Truncate the time portion from all IN date parameters
419 --
420 l_effective_date := trunc(p_effective_date);
421 --
422 -- Call Before Process User Hook
423 --
424 begin
425 IRC_VACANCY_CONSIDERATIONS_BK1.CREATE_VACANCY_CONSIDERATION_B
426 (
427 p_person_id => p_person_id
428 ,p_vacancy_id => p_vacancy_id
429 ,p_consideration_status => p_consideration_status
430 ,p_effective_date => l_effective_date
431 );
432 exception
433 when hr_api.cannot_find_prog_unit then
434 hr_api.cannot_find_prog_unit_error
435 (p_module_name => 'CREATE_VACANCY_CONSIDERATION'
436 ,p_hook_type => 'BP'
437 );
438 end;
439 --
440 -- Process Logic
441 --
442 irc_ivc_ins.ins
443 (
444 p_person_id => p_person_id
445 ,p_vacancy_id => p_vacancy_id
446 ,p_consideration_status => p_consideration_status
447 ,p_vacancy_consideration_id => l_vacancy_consideration_id
448 ,p_object_version_number => l_object_version_number
449 ,p_effective_date => l_effective_date
450 );
451 --
452 notify_seeker_if_required
453 (p_person_id => p_person_id
454 ,p_vacancy_id => p_vacancy_id
455 ,p_consideration_status => p_consideration_status
456 ,p_effective_date => l_effective_date
457 ,p_validate_only => p_validate
458 );
459 --
460 -- Call After Process User Hook
461 --
462 begin
463 IRC_VACANCY_CONSIDERATIONS_BK1.CREATE_VACANCY_CONSIDERATION_A
464 (p_vacancy_consideration_id => l_vacancy_consideration_id
465 ,p_person_id => p_person_id
466 ,p_vacancy_id => p_vacancy_id
467 ,p_consideration_status => p_consideration_status
468 ,p_object_version_number => l_object_version_number
469 ,p_effective_date => l_effective_date
470 );
471 exception
472 when hr_api.cannot_find_prog_unit then
473 hr_api.cannot_find_prog_unit_error
474 (p_module_name => 'CREATE_VACANCY_CONSIDERATION'
475 ,p_hook_type => 'AP'
476 );
477 end;
478 --
479 -- When in validation only mode raise the Validate_Enabled exception
480 --
481 if p_validate then
482 raise hr_api.validate_enabled;
483 end if;
484 --
485 -- Set all output arguments
486 --
487 p_object_version_number := l_object_version_number;
488 p_vacancy_consideration_id := l_vacancy_consideration_id;
489 --
490 hr_utility.set_location(' Leaving:'||l_proc, 70);
491 exception
492 when hr_api.validate_enabled then
493 --
494 -- As the Validate_Enabled exception has been raised
495 -- we must rollback to the savepoint
496 --
497 rollback to CREATE_VACANCY_CONSIDERATION;
498 --
499 -- Only set output warning arguments
500 -- (Any key or derived arguments must be set to null
501 -- when validation only mode is being used.)
502 --
503 p_object_version_number := null;
504 p_vacancy_consideration_id := null;
505 hr_utility.set_location(' Leaving:'||l_proc, 80);
506 when others then
507 --
508 -- A validation or unexpected error has occured
509 --
510 rollback to CREATE_VACANCY_CONSIDERATION;
511 --
512 -- Reset IN OUT parameters and set OUT parameters
513 --
514 p_object_version_number := null;
515 p_vacancy_consideration_id := null;
516 hr_utility.set_location(' Leaving:'||l_proc, 90);
517 raise;
518 end CREATE_VACANCY_CONSIDERATION;
519 --
520 -- ----------------------------------------------------------------------------
521 -- |--------------------------< UPDATE_VACANCY_CONSIDERATION >----------------|
522 -- ----------------------------------------------------------------------------
523 --
524 procedure update_vacancy_consideration
525 (p_validate in boolean default false
526 ,p_vacancy_consideration_id in number
527 ,p_party_id in number default hr_api.g_number
528 ,p_consideration_status in varchar2 default hr_api.g_varchar2
529 ,p_object_version_number in out nocopy number
530 ,p_effective_date in date
531 ) is
532 --
533 --
534 -- Declare cursors and local variables
535 --
536 l_proc varchar2(72) := g_package||
537 'update_vacancy_consideration';
538 l_object_version_number number := p_object_version_number;
539 l_effective_date date;
540 l_person_id number;
541 l_vacancy_id number;
542 cursor csr_person_vac is
543 Select person_id, vacancy_id
544 from irc_vacancy_considerations
545 where vacancy_consideration_id = p_vacancy_consideration_id;
546 --
547 begin
548 hr_utility.set_location('Entering:'|| l_proc, 10);
549 --
550 -- Issue a savepoint
551 --
552 savepoint update_vacancy_consideration;
553 --
554 -- Truncate the time portion from all IN date parameters
555 --
556 l_effective_date := trunc(p_effective_date);
557 --
558 -- Call Before Process User Hook
559 --
560 begin
561 IRC_VACANCY_CONSIDERATIONS_BK2.UPDATE_VACANCY_CONSIDERATION_B
562 (
563 p_vacancy_consideration_id => p_vacancy_consideration_id
564 ,p_party_id => p_party_id
565 ,p_consideration_status => p_consideration_status
566 ,p_object_version_number => l_object_version_number
567 ,p_effective_date => l_effective_date
568 );
569 exception
570 when hr_api.cannot_find_prog_unit then
571 hr_api.cannot_find_prog_unit_error
572 (p_module_name => 'UPDATE_VACANCY_CONSIDERATION'
573 ,p_hook_type => 'BP'
574 );
575 end;
576 --
577 -- Process Logic
578 --
579 irc_ivc_upd.upd
580 (
581 p_vacancy_consideration_id => p_vacancy_consideration_id
582 ,p_party_id => p_party_id
583 ,p_consideration_status => p_consideration_status
584 ,p_object_version_number => l_object_version_number
585 ,p_effective_date => l_effective_date
586 );
587 --
588 --
589 open csr_person_vac;
590 fetch csr_person_vac into l_person_id, l_vacancy_id;
591 close csr_person_vac;
592 notify_seeker_if_required
593 (p_person_id => l_person_id
594 ,p_vacancy_id => l_vacancy_id
595 ,p_consideration_status => p_consideration_status
596 ,p_effective_date => l_effective_date
597 ,p_validate_only => p_validate
598 );
599 -- Call After Process User Hook
600 --
601 begin
602 IRC_VACANCY_CONSIDERATIONS_BK2.UPDATE_VACANCY_CONSIDERATION_A
603 (p_vacancy_consideration_id => p_vacancy_consideration_id
604 ,p_party_id => p_party_id
605 ,p_consideration_status => p_consideration_status
606 ,p_object_version_number => l_object_version_number
607 ,p_effective_date => l_effective_date
608 );
609 exception
610 when hr_api.cannot_find_prog_unit then
611 hr_api.cannot_find_prog_unit_error
612 (p_module_name => 'UPDATE_VACANCY_CONSIDERATION'
613 ,p_hook_type => 'AP'
614 );
615 end;
616 --
617 -- When in validation only mode raise the Validate_Enabled exception
618 --
619 if p_validate then
620 raise hr_api.validate_enabled;
621 end if;
622 --
623 -- Set all output arguments
624 --
625 p_object_version_number := l_object_version_number;
626 --
627 hr_utility.set_location(' Leaving:'||l_proc, 70);
628 exception
629 when hr_api.validate_enabled then
630 --
631 -- As the Validate_Enabled exception has been raised
632 -- we must rollback to the savepoint
633 --
634 rollback to UPDATE_VACANCY_CONSIDERATION;
635 --
636 -- Only set output warning arguments
637 -- (Any key or derived arguments must be set to null
638 -- when validation only mode is being used.)
639 --
640 p_object_version_number := l_object_version_number;
641 hr_utility.set_location(' Leaving:'||l_proc, 80);
642 when others then
643 --
644 -- A validation or unexpected error has occured
645 --
646 rollback to UPDATE_VACANCY_CONSIDERATION;
647 --
648 -- Reset IN OUT parameters and set OUT parameters
649 --
650 p_object_version_number := l_object_version_number;
651 hr_utility.set_location(' Leaving:'||l_proc, 90);
652 raise;
653 end UPDATE_VACANCY_CONSIDERATION;
654 --
655 -- ----------------------------------------------------------------------------
656 -- |--------------------------< DELETE_VACANCY_CONSIDERATION >----------------|
657 -- ----------------------------------------------------------------------------
658 --
659 procedure delete_vacancy_consideration
660 (p_validate in boolean default false
661 ,p_vacancy_consideration_id in number
662 ,p_object_version_number in number
663 ) is
664 --
665 -- Declare cursors and local variables
666 --
667 l_proc varchar2(72) := g_package||
668 'delete_vacancy_consideration';
669 begin
670 hr_utility.set_location('Entering:'|| l_proc, 10);
671 --
672 -- Issue a savepoint
673 --
674 savepoint delete_vacancy_consideration;
675 --
676 -- Call Before Process User Hook
677 --
678 begin
679 IRC_VACANCY_CONSIDERATIONS_BK3.DELETE_VACANCY_CONSIDERATION_B
680 (p_vacancy_consideration_id => p_vacancy_consideration_id
681 ,p_object_version_number => p_object_version_number
682 );
683 exception
684 when hr_api.cannot_find_prog_unit then
685 hr_api.cannot_find_prog_unit_error
686 (p_module_name => 'DELETE_VACANCY_CONSIDERATION'
687 ,p_hook_type => 'BP'
688 );
689 end;
690 --
691 -- Process Logic
692 --
693 irc_ivc_del.del
694 (p_vacancy_consideration_id => p_vacancy_consideration_id
695 ,p_object_version_number => p_object_version_number
696 );
697 --
698 -- Call After Process User Hook
699 --
700 begin
701 IRC_VACANCY_CONSIDERATIONS_BK3.DELETE_VACANCY_CONSIDERATION_A
702 (
703 p_vacancy_consideration_id => p_vacancy_consideration_id
704 ,p_object_version_number => p_object_version_number
705 );
706 exception
707 when hr_api.cannot_find_prog_unit then
708 hr_api.cannot_find_prog_unit_error
709 (p_module_name => 'DELETE_VACANCY_CONSIDERATION'
710 ,p_hook_type => 'AP'
711 );
712 end;
713 --
714 -- When in validation only mode raise the Validate_Enabled exception
715 --
716 if p_validate then
717 raise hr_api.validate_enabled;
718 end if;
719 --
720 -- Set all output arguments
721 --
722 --
723 hr_utility.set_location(' Leaving:'||l_proc, 70);
724 exception
725 when hr_api.validate_enabled then
726 --
727 -- As the Validate_Enabled exception has been raised
728 -- we must rollback to the savepoint
729 --
730 rollback to DELETE_VACANCY_CONSIDERATION;
731 --
732 -- Only set output warning arguments
733 -- (Any key or derived arguments must be set to null
734 -- when validation only mode is being used.)
735 --
736 hr_utility.set_location(' Leaving:'||l_proc, 80);
737 when others then
738 --
739 -- A validation or unexpected error has occured
740 --
741 rollback to DELETE_VACANCY_CONSIDERATION;
742 hr_utility.set_location(' Leaving:'||l_proc, 90);
743 raise;
744 end DELETE_VACANCY_CONSIDERATION;
745 --
746 end IRC_VACANCY_CONSIDERATIONS_API;