DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_RCF_BUS

Source


1 Package Body per_rcf_bus as
2 /* $Header: percfrhi.pkb 120.2 2006/04/07 04:33:51 cnholmes noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_rcf_bus.';  -- Global package name
9 --
10 -- The following two global variables are only to be
11 -- used by the return_legislation_code function.
12 --
13 g_legislation_code            varchar2(150)  default null;
14 g_rec_activity_for_id number         default null;
15 --
16 --  ---------------------------------------------------------------------------
17 --  |----------------------< set_security_group_id >--------------------------|
18 --  ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21   (p_rec_activity_for_id          in number
22   ,p_associated_column1                   in varchar2 default null
23   ) is
24   --
25   -- Declare cursor
26   --
27   cursor csr_sec_grp is
28     select pbg.security_group_id
29       from per_business_groups pbg
30          , per_recruitment_activity_for rcf
31      where rcf.recruitment_activity_for_id = p_rec_activity_for_id
32        and pbg.business_group_id = rcf.business_group_id;
33   --
34   -- Declare local variables
35   --
36   l_security_group_id number;
37   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
38   --
39 begin
40   --
41   hr_utility.set_location('Entering:'|| l_proc, 10);
42   --
43   -- Ensure that all the mandatory parameter are not null
44   --
45   hr_api.mandatory_arg_error
46     (p_api_name           => l_proc
47     ,p_argument           => 'recruitment_activity_for_id'
48     ,p_argument_value     => p_rec_activity_for_id
49     );
50   --
51   open csr_sec_grp;
52   fetch csr_sec_grp into l_security_group_id;
53   --
54   if csr_sec_grp%notfound then
55      --
56      close csr_sec_grp;
57      --
58      -- The primary key is invalid therefore we must error
59      --
60      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
61      hr_multi_message.add
62        (p_associated_column1
63         => nvl(p_associated_column1,'RECRUITMENT_ACTIVITY_FOR_ID')
64        );
65      --
66   else
67     close csr_sec_grp;
68     --
69     -- Set the security_group_id in CLIENT_INFO
70     --
71     hr_api.set_security_group_id
72       (p_security_group_id => l_security_group_id
73       );
74   end if;
75   --
76   hr_utility.set_location(' Leaving:'|| l_proc, 20);
77   --
78 end set_security_group_id;
79 --
80 --  ---------------------------------------------------------------------------
81 --  |---------------------< return_legislation_code >-------------------------|
82 --  ---------------------------------------------------------------------------
83 --
84 Function return_legislation_code
85   (p_rec_activity_for_id          in     number
86   )
87   Return Varchar2 Is
88   --
89   -- Declare cursor
90   --
91  cursor csr_leg_code is
92     select pbg.legislation_code
93       from per_business_groups pbg
94          , per_recruitment_activity_for rcf
95      where rcf.recruitment_activity_for_id = p_rec_activity_for_id
96        and pbg.business_group_id = rcf.business_group_id;
97   --
98   -- Declare local variables
99   --
100   l_legislation_code  varchar2(150);
101   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
102   --
103 Begin
104   --
105   hr_utility.set_location('Entering:'|| l_proc, 10);
106   --
107   -- Ensure that all the mandatory parameter are not null
108   --
109   hr_api.mandatory_arg_error
110     (p_api_name           => l_proc
111     ,p_argument           => 'recruitment_activity_for_id'
112     ,p_argument_value     => p_rec_activity_for_id
113     );
114   --
115   if ( nvl(per_rcf_bus.g_rec_activity_for_id, hr_api.g_number)
116        = p_rec_activity_for_id) then
117     --
118     -- The legislation code has already been found with a previous
119     -- call to this function. Just return the value in the global
120     -- variable.
121     --
122     l_legislation_code := per_rcf_bus.g_legislation_code;
123     hr_utility.set_location(l_proc, 20);
124   else
125     --
126     -- The ID is different to the last call to this function
127     -- or this is the first call to this function.
128     --
129     open csr_leg_code;
130     fetch csr_leg_code into l_legislation_code;
131     --
132     if csr_leg_code%notfound then
133       --
134       -- The primary key is invalid therefore we must error
135       --
136       close csr_leg_code;
137       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
138       fnd_message.raise_error;
139     end if;
140     hr_utility.set_location(l_proc,30);
141     --
142     -- Set the global variables so the values are
143     -- available for the next call to this function.
144     --
145     close csr_leg_code;
146     per_rcf_bus.g_rec_activity_for_id := p_rec_activity_for_id;
147     per_rcf_bus.g_legislation_code  := l_legislation_code;
148   end if;
149   hr_utility.set_location(' Leaving:'|| l_proc, 40);
150   return l_legislation_code;
151 end return_legislation_code;
152 --
153 -- ----------------------------------------------------------------------------
154 -- |-----------------------< chk_non_updateable_args >------------------------|
155 -- ----------------------------------------------------------------------------
156 -- {Start Of Comments}
157 --
158 -- Description:
159 --   This procedure is used to ensure that non updateable attributes have
160 --   not been updated. If an attribute has been updated an error is generated.
161 --
162 -- Pre Conditions:
163 --   g_old_rec has been populated with details of the values currently in
164 --   the database.
165 --
166 -- In Arguments:
167 --   p_rec has been populated with the updated values the user would like the
168 --   record set to.
169 --
170 -- Post Success:
171 --   Processing continues if all the non updateable attributes have not
172 --   changed.
173 --
174 -- Post Failure:
175 --   An application error is raised if any of the non updatable attributes
176 --   have been altered.
177 --
178 -- {End Of Comments}
179 -- ----------------------------------------------------------------------------
180 Procedure chk_non_updateable_args
181   (p_rec in per_rcf_shd.g_rec_type
182   ) IS
183 --
184   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
185 --
186 Begin
187   hr_utility.set_location('Entering:'|| l_proc, 10);
188   --
189   -- Only proceed with the validation if a row exists for the current
190   -- record in the HR Schema.
191   --
192   IF NOT per_rcf_shd.api_updating
193       (p_rec_activity_for_id          => p_rec.rec_activity_for_id
194       ,p_object_version_number        => p_rec.object_version_number
195       ) THEN
196      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
197      fnd_message.set_token('PROCEDURE ', l_proc);
198      fnd_message.set_token('STEP ', '5');
199      fnd_message.raise_error;
200   END IF;
201   --
202   --  Add checks to ensure non-updateable args have
203   --  not been updated.
204   if (p_rec.business_group_id <> per_rcf_shd.g_old_rec.business_group_id)
205   then
206    hr_api.argument_changed_error
207      (p_api_name    => l_proc
208      ,p_argument    => 'BUSINESS_GROUP_ID'
209      ,p_base_table  => per_rcf_shd.g_tab_nam
210      );
211   end if;
212   --
213   hr_utility.set_location(' Leaving:'|| l_proc, 40);
214 End chk_non_updateable_args;
215 --
216 -- ----------------------------------------------------------------------------
217 -- |-----------------------< chk_vacancy_id >---------------------------------|
218 -- ----------------------------------------------------------------------------
219 -- {Start Of Comments}
220 --
221 -- Description:
222 --   This procedure is used to ensure that mandatory parameters have been
223 --   set and the business group is valid.
224 --
225 -- Pre Conditions:
226 --   g_old_rec has been populated with details of the values currently in
227 --   the database.
228 --
229 -- In Arguments:
230 --   p_vacancy_id
231 --   p_business_group_id.
232 --
233 -- Post Success:
234 --   Processing continues if the vacancy id is valid and the business group
235 --   id matches with that in the PER_ALL_VACANCIES table.
236 --
237 -- Post Failure:
238 --   An application error is raised if the vacancy id is null or is not valid
239 --   or if the business group id is not valid.
240 --
241 -- {End Of Comments}
242 -- ----------------------------------------------------------------------------
243 Procedure chk_vacancy_id
244   (p_vacancy_id            in  per_recruitment_activity_for.vacancy_id%type,
245    p_business_group_id     in
246      per_recruitment_activity_for.business_group_id%type,
247    p_rec_activity_for_id   in
248      per_recruitment_activity_for.recruitment_activity_for_id%type,
249    p_object_version_number in
250      per_recruitment_activity_for.object_version_number%type
251   ) IS
252 --
253   l_proc     varchar2(72) := g_package || 'chk_vacancy_id';
254   l_business_group_id  per_recruitment_activity_for.business_group_id%type;
255   l_vacancy_id  per_recruitment_activity_for.vacancy_id%type;
256   l_api_updating boolean;
257 --
258 --   Cursor to check that the vacancy id exists in the reference table
259 --   PER_ALL_VACANCIES.
260 --
261 cursor csr_vacancy_id is
262   select l_vacancy_id,l_business_group_id
263     from per_all_vacancies
264   where vacancy_id = p_vacancy_id;
265 --
266 Begin
267 hr_utility.set_location('Entering:'|| l_proc, 10);
268 --
269   l_api_updating := per_rcf_shd.api_updating(p_rec_activity_for_id,
270     p_object_version_number);
271   --
272   -- Check to see if the vacancy id has changed.
273   --
274   hr_utility.set_location(l_proc, 20);
275   if ((l_api_updating
276     and (nvl(per_rcf_shd.g_old_rec.vacancy_id,hr_api.g_number) <>
277     p_vacancy_id))
278     or (NOT l_api_updating)) then
279     --
280     -- Check to ensure that the vacancy id is not null.
281     --
282     hr_utility.set_location(l_proc, 30);
283     if p_vacancy_id is null then
284       hr_api.mandatory_arg_error
285       (p_api_name           => l_proc
286       ,p_argument           => 'vacancy_id'
287       ,p_argument_value     => p_vacancy_id
288       );
289     end if;
290     --
291     -- Check that the vacancy id exists in the PER_ALL_VACANCIES table.
292     --
293     open csr_vacancy_id;
294     fetch csr_vacancy_id into l_vacancy_id,l_business_group_id;
295     hr_utility.set_location(l_proc, 40);
296     if csr_vacancy_id%notfound then
297     hr_utility.set_location(l_proc, 41);
298       close csr_vacancy_id;
299       fnd_message.set_name('PER','PER_289469_RCF_INV_VAC_ID');
300       hr_multi_message.add
301         (p_associated_column1 => 'PER_RECRUITMENT_ACTIVITY_FOR.VACANCY_ID'
302         );
303     else
304       --
305       -- Check that the business group id is the same as that in the
306       -- PER_ALL_VACANCIES table for this vacancy_id.
307       --
308       hr_utility.set_location(l_proc, 50);
309       if(l_business_group_id <> p_business_group_id) then
310       hr_utility.set_location(l_proc, 51);
311         close csr_vacancy_id;
312         fnd_message.set_name('PER', 'PER_289468_RCF_INV_VAC_BG');
313         hr_multi_message.add
314         (p_associated_column1 =>
315                            'PER_RECRUITMENT_ACTIVITY_FOR.VACANCY_ID'
316         ,p_associated_column2 =>
317                            'PER_RECRUITMENT_ACTIVITY_FOR.BUSINESS_GROUP_ID'
318         );
319       else
320       hr_utility.set_location(l_proc, 60);
321         close csr_vacancy_id;
322       end if;
323     end if;
324   --
325   end if;
326   hr_utility.set_location(' Leaving:'|| l_proc, 70);
327   --
328 end chk_vacancy_id;
329 --
330 -- ----------------------------------------------------------------------------
331 -- |-----------------------< chk_rec_activity_id >------------------------|
332 -- ----------------------------------------------------------------------------
333 -- {Start Of Comments}
334 --
335 -- Description:
336 --   This procedure is used to ensure that mandatory parameters have been
337 --   set and the business group is valid.
338 --
339 -- Pre Conditions:
340 --   g_old_rec has been populated with details of the values currently in
341 --   the database.
342 --
343 -- In Arguments:
344 --   p_recruitment_activity_id
345 --   p_business_group_id.
346 --
347 -- Post Success:
348 --   Processing continues if the rec activity id is valid and the
349 --   business group id matches with that in the PER_REC_ACTIVITY_FOR table.
350 --
351 -- Post Failure:
352 --   An application error is raised if the rec activity id is null or is
353 --   not valid or if the business group id is not valid.
354 --
355 -- {End Of Comments}
356 -- ----------------------------------------------------------------------------
357 Procedure chk_rec_activity_id
358   (p_rec_activity_id             in
359      per_recruitment_activity_for.recruitment_activity_id%type,
360    p_business_group_id           in
361      per_recruitment_activity_for.business_group_id%type,
362    p_rec_activity_for_id         in
363      per_recruitment_activity_for.recruitment_activity_for_id%type,
364    p_object_version_number       in
365      per_recruitment_activity_for.object_version_number%type
366   ) IS
367 --
368   l_proc     varchar2(72) := g_package || 'chk_rec_activity_id';
369   l_rec_activity_id  per_recruitment_activity_for.recruitment_activity_id%type;
370   l_business_group_id  per_recruitment_activity_for.business_group_id%type;
371   l_api_updating boolean;
372 --
373 --   Cursor to check that the recruitment activity id exists in the reference
374 --   table PER_RECRUITMENT_ACTIVITIES.
375 --
376 cursor csr_rec_activity_id is
377   select recruitment_activity_id, business_group_id
378     from per_recruitment_activities
379   where recruitment_activity_id = p_rec_activity_id;
380 --
381 Begin
382 hr_utility.set_location('Entering:'|| l_proc, 10);
383   --
384   l_api_updating := per_rcf_shd.api_updating(p_rec_activity_for_id,
385     p_object_version_number);
386   --
387   -- Check to see if the recruitment activity id has changed.
388   --
389   hr_utility.set_location(l_proc, 20);
390   if ((l_api_updating
391     and (nvl(per_rcf_shd.g_old_rec.rec_activity_id,hr_api.g_number) <>
392     p_rec_activity_id))
393     or (NOT l_api_updating)) then
394     --
395     -- Check to ensure that the recruitment_activity_id is not null.
396     --
397     hr_utility.set_location(l_proc, 30);
398     if p_rec_activity_id is null then
399       hr_api.mandatory_arg_error
400       (p_api_name           => l_proc
401       ,p_argument           => 'rec_activity_id'
402       ,p_argument_value     => p_rec_activity_id
403       );
404     end if;
405     --
406     -- Check that the recruitment activity id exists in the
407     -- PER_RECRUITMENT_ACTIVITIES table.
408     --
409     open csr_rec_activity_id;
410     fetch csr_rec_activity_id into l_rec_activity_id, l_business_group_id;
411     hr_utility.set_location(l_proc, 40);
412     if csr_rec_activity_id%notfound then
413     hr_utility.set_location(l_proc, 41);
414       close csr_rec_activity_id;
415       fnd_message.set_name('PER','PER_289470_RCF_INV_ACT_ID');
416       hr_multi_message.add
417         (p_associated_column1 =>
418                           'PER_RECRUITMENT_ACTIVITY_FOR.RECRUITMENT_ACTIVITY_ID'
419         );
420     else
421       --
422       -- Check that the business group id is the same as that in the
423       -- PER_RECRUITMENT_ACTIVITY_FOR table for this recruitment_activity_id.
424       --
425       hr_utility.set_location(l_proc, 50);
426       if (l_business_group_id <> p_business_group_id) then
427       hr_utility.set_location(l_proc, 51);
428         close csr_rec_activity_id;
429         fnd_message.set_name('PER', 'PER_289471_RCF_INV_ACT_BG');
430         hr_multi_message.add
431         (p_associated_column1 =>
432                           'PER_RECRUITMENT_ACTIVITY_FOR.RECRUITMENT_ACTIVITY_ID'
433         ,p_associated_column2 =>
434                           'PER_RECRUITMENT_ACTIVITY_FOR.BUSINESS_GROUP_ID'
435          );
436        else
437       hr_utility.set_location(l_proc, 60);
438          close csr_rec_activity_id;
439        end if;
440     end if;
441     --
442   end if;
443   hr_utility.set_location(' Leaving:'|| l_proc, 70);
444   --
445   end chk_rec_activity_id;
446 --
447 --
448 -- ----------------------------------------------------------------------------
449 -- |-----------------------< chk_vacancy_rec_activity>------------------------|
450 -- ----------------------------------------------------------------------------
451 -- {Start Of Comments}
452 --
453 -- Description:
454 --   This check procedure ensures that there should be only one internal
455 --   recruitment activity and one external recruitment for a given vacancy
456 --
457 -- Pre Conditions:
458 --   g_old_rec has been populated with details of the values currently in
459 --   the database.
460 --
461 -- In Arguments:
462 --   p_vacancy_id
463 --   p_rec_activity_id
464 --
465 -- Post Success:
466 --   Processing continues if the check procedure does not throw any error.
467 --
468 --
469 -- Post Failure:
470 --
471 --  An application error is raised if there are more than one internal or
472 --  external recruitment activity for a given vacancy
473 --
474 -- {End Of Comments}
475 -- ----------------------------------------------------------------------------
476 Procedure chk_vacancy_rec_activity
477   (p_vacancy_id            in  per_recruitment_activity_for.vacancy_id%type
478   ,p_rec_activity_id             in
479      per_recruitment_activity_for.recruitment_activity_id%type
480   ) IS
481 --
482   l_proc     varchar2(72) := g_package || 'chk_vacancy_rec_activity';
483   l_vacancy_id  per_recruitment_activity_for.vacancy_id%type;
484   l_internal irc_all_recruiting_sites.internal%type;
485   l_external irc_all_recruiting_sites.external%type;
486   l_ret varchar2(1);
487 --
488   cursor csr_internal is
489   select null
490     from irc_all_recruiting_sites irs
491         ,per_recruitment_activities pra
492         ,per_recruitment_activity_for prf
493    where irs.recruiting_site_id = pra.recruiting_site_id
494      and pra.recruitment_activity_id = prf.recruitment_activity_id
495      and pra.recruitment_activity_id <> p_rec_activity_id
496      and irs.internal = 'Y'
497      and prf.vacancy_id = p_vacancy_id;
498 --
499   cursor csr_external is
500   select null
501     from irc_all_recruiting_sites irs
502         ,per_recruitment_activities pra
503         ,per_recruitment_activity_for prf
504    where irs.recruiting_site_id = pra.recruiting_site_id
505      and pra.recruitment_activity_id = prf.recruitment_activity_id
506      and pra.recruitment_activity_id <> p_rec_activity_id
507      and irs.external = 'Y' and
508      prf.vacancy_id = p_vacancy_id;
509 --
510   cursor csr_rse is
511      select irs.internal
512            ,irs.external
513        from irc_all_recruiting_sites irs
514            ,per_recruitment_activities pra
515       where pra.recruitment_activity_id = p_rec_activity_id
516         and pra.recruiting_site_id = irs.recruiting_site_id;
517 --
518 Begin
519   hr_utility.set_location('Entering:'|| l_proc, 10);
520   --
521  if hr_multi_message.no_exclusive_error
522  (p_check_column1    => 'PER_RECRUITMENT_ACTIVITY_FOR.VACANCY_ID'
523  ,p_check_column2   => 'PER_RECRUITMENT_ACTIVITY_FOR.RECRUITMENT_ACTIVITY_ID'
524  ) then
525    open csr_rse;
526    fetch csr_rse into l_internal,l_external;
527    close csr_rse;
528    --
529    hr_utility.set_location(l_proc, 20);
530    if l_internal = 'Y'
531    then
532      hr_utility.set_location(l_proc, 30);
533      open csr_internal;
534      fetch csr_internal into l_ret;
535      if csr_internal%found
536      then
537        close csr_internal;
538        hr_utility.set_location(l_proc,40);
539        fnd_message.set_name('PER','IRC_412174_VAC_INT_SITE_EXT');
540        fnd_message.raise_error;
541      end if;
542      close csr_internal;
543    end if;
544    if l_external = 'Y'
545    then
546      hr_utility.set_location(l_proc, 50);
547      open csr_external;
548      fetch csr_external into l_ret;
549      if csr_external%found
550      then
551        close csr_external;
552        hr_utility.set_location(l_proc,60);
553        fnd_message.set_name('PER','IRC_412175_VAC_EXT_SITE_EXT');
554        fnd_message.raise_error;
555      end if;
556      hr_utility.set_location(l_proc,70);
557      close csr_external;
558    end if;
559    --
560    hr_utility.set_location('Leaving :' || l_proc,80);
561    --
562 end if;
563 --
564 exception
565  when app_exception.application_exception then
566   if hr_multi_message.exception_add
567      (p_associated_column1 =>
568      'per_recruitment_activity_for.VACANCY_ID'
569      ,p_associated_column2 =>
570      'per_recruitment_activity_for.RECRUITMENT_ACTIVITY_ID'
571      ) then
572     hr_utility.set_location(' Exception :'||l_proc,90);
573     raise;
574   end if;
575   hr_utility.set_location(' Exception :'|| l_proc, 91);
576   --
577 end chk_vacancy_rec_activity;
578 --
579 --
580 -- ---------------------------------------------------------------------------
581 -- |-----------------------< Chk_rec_activity_dates>-------------------------|
582 -- ---------------------------------------------------------------------------
583 -- {Start Of Comments}
584 --
585 -- Description:
586 --   This check procedure ensures that the external posting start date should
587 --  be after the Internal posting start date.
588 --
589 -- Pre Conditions:
590 --   g_old_rec has been populated with details of the values currently in
591 --   the database.
592 --
593 -- In Arguments:
594 --   p_vacancy_id
595 --
596 -- Post Success:
597 --   Processing continues if the check procedure does not throw any error.
598 --
599 --
600 -- Post Failure:
601 --
602 --  An application error is raised if the internal posting start date is
603 --  greater than external posting date
604 --
605 -- {End Of Comments}
606 -- ---------------------------------------------------------------------------
607 Procedure chk_rec_activity_dates
608   (p_vacancy_id            in  per_recruitment_activity_for.vacancy_id%type
609   ,p_rec_activity_id             in
610    per_recruitment_activity_for.recruitment_activity_id%type
611   ) IS
612 --
613   l_proc     varchar2(72) := g_package || 'chk_rec_activity_dates';
614   l_ret varchar2(1);
615   l_internal irc_all_recruiting_sites.internal%type;
616   l_external irc_all_recruiting_sites.external%type;
617   l_start_date per_recruitment_activities.date_start%type;
618   l_start_date_exists per_recruitment_activities.date_start%type;
619   l_vacancy_id  per_recruitment_activity_for.vacancy_id%type;
620     cursor csr_internal is
621 --
622   select pra.date_start
623     from irc_all_recruiting_sites irs
624         ,per_recruitment_activities pra
625         ,per_recruitment_activity_for prf
626    where irs.recruiting_site_id = pra.recruiting_site_id
627      and pra.recruitment_activity_id = prf.recruitment_activity_id
628      and irs.internal = 'Y'
629      and prf.vacancy_id = p_vacancy_id;
630 --
631   cursor csr_external is
632   select pra.date_start
633     from irc_all_recruiting_sites irs
634         ,per_recruitment_activities pra
635         ,per_recruitment_activity_for prf
636    where irs.recruiting_site_id = pra.recruiting_site_id
637      and pra.recruitment_activity_id = prf.recruitment_activity_id
638      and irs.external = 'Y' and
639      prf.vacancy_id = p_vacancy_id;
640 --
641   cursor csr_rse is
642      select irs.internal
643            ,irs.external
644            ,pra.date_start
645        from irc_all_recruiting_sites irs
646            ,per_recruitment_activities pra
647       where pra.recruitment_activity_id = p_rec_activity_id
648         and pra.recruiting_site_id = irs.recruiting_site_id;
649 --
650 Begin
651 --
652   hr_utility.set_location('Entering:'|| l_proc, 10);
653 --
654   if hr_multi_message.no_exclusive_error
655   (p_check_column1   => 'PER_RECRUITMENT_ACTIVITY_FOR.VACANCY_ID'
656   ,p_check_column2   => 'PER_RECRUITMENT_ACTIVITY_FOR.RECRUITMENT_ACTIVITY_ID'
657   ) then
658 --
659   hr_utility.set_location(l_proc, 15);
660 --
661   open csr_rse;
662   fetch csr_rse into l_internal,l_external,l_start_date;
663   close csr_rse;
664 --
665   hr_utility.set_location(l_proc, 20);
666 --
667   if l_internal = 'Y'
668   then
669 --
670   hr_utility.set_location(l_proc, 25);
671 --
672     open csr_external;
673     fetch csr_external into l_start_date_exists;
674     if csr_external%found
675     then
676 --
677   hr_utility.set_location(l_proc, 30);
678 --
679       if l_start_date > l_start_date_exists
680       then
681 --
682   hr_utility.set_location(l_proc, 35);
683 --
684         close csr_external;
685         fnd_message.set_name('PER','IRC_412176_POST_ST_DT_INVALID');
686         fnd_message.raise_error;
687       end if;
688 --
689   hr_utility.set_location(l_proc, 40);
690 --
691     end if;
692 --
693   hr_utility.set_location(l_proc, 45);
694 --
695     close csr_external;
696    end if;
697 --
698   hr_utility.set_location(l_proc, 50);
699 --
700    if l_external = 'Y'
701    then
702 --
703   hr_utility.set_location(l_proc, 55);
704 --
705      open csr_internal;
706      fetch csr_internal into l_start_date_exists;
707      if csr_internal%found
708      then
709 --
710   hr_utility.set_location(l_proc, 60);
711 --
712        if l_start_date < l_start_date_exists
713        then
714 --
715   hr_utility.set_location(l_proc, 65);
716 --
717          close csr_internal;
718          fnd_message.set_name('PER','IRC_412176_POST_ST_DT_INVALID');
719          fnd_message.raise_error;
720        end if;
721 --
722   hr_utility.set_location(l_proc, 70);
723 --
724      end if;
725 --
726   hr_utility.set_location(l_proc, 75);
727 --
728      close csr_internal;
729    end if;
730 --
731   hr_utility.set_location(l_proc, 80);
732 --
733    end if;
734 --
735    hr_utility.set_location('Exiting ' || l_proc, 85);
736 --
737 exception
738  when app_exception.application_exception then
739   if hr_multi_message.exception_add
740      (p_associated_column1 =>
741      'per_recruitment_activity_for.VACANCY_ID'
742      ,p_associated_column2 =>
743      'per_recruitment_activity_for.RECRUITMENT_ACTIVITY_ID'
744      ) then
745     hr_utility.set_location(' Exception :'||l_proc,90);
746     raise;
747   end if;
748   hr_utility.set_location(' Exception :'|| l_proc,95);
749   --
750 end chk_rec_activity_dates;
751 --
752 -- ----------------------------------------------------------------------------
753 -- |---------------------------< insert_validate >----------------------------|
754 -- ----------------------------------------------------------------------------
755 Procedure insert_validate
756   (p_rec                          in per_rcf_shd.g_rec_type
757   ) is
758 --
759   l_proc  varchar2(72) := g_package||'insert_validate';
760 --
761 Begin
762   hr_utility.set_location('Entering:'||l_proc, 10);
763   --
764   -- Validate Important Attributes
765   --
766   hr_api.validate_bus_grp_id
767     (p_business_group_id => p_rec.business_group_id
768     ,p_associated_column1 => per_rcf_shd.g_tab_nam
769                               || '.BUSINESS_GROUP_ID');
770   --
771   -- After validating the set of important attributes,
772   -- if Multiple Message detection is enabled and at least
773   -- one error has been found then abort further validation.
774   --
775   hr_multi_message.end_validation_set;
776   hr_utility.set_location(l_proc, 20);
777   --
778   per_rcf_bus.chk_vacancy_id
779   (p_vacancy_id => p_rec.vacancy_id
780   ,p_business_group_id => p_rec.business_group_id
781   ,p_rec_activity_for_id => p_rec.rec_activity_for_id
782   ,p_object_version_number => p_rec.object_version_number
783   );
784   hr_utility.set_location(l_proc, 30);
785   --
786   per_rcf_bus.chk_rec_activity_id
787   (p_rec_activity_id => p_rec.rec_activity_id
788   ,p_business_group_id => p_rec.business_group_id
789   ,p_rec_activity_for_id => p_rec.rec_activity_for_id
790   ,p_object_version_number => p_rec.object_version_number
791   );
792     hr_utility.set_location(l_proc, 40);
793   --
794   per_rcf_bus.chk_vacancy_rec_activity
795   (p_vacancy_id => p_rec.vacancy_id
796   ,p_rec_activity_id => p_rec.rec_activity_id
797   );
798   --
799   hr_utility.set_location(l_proc, 60);
800   per_rcf_bus.chk_rec_activity_dates
801   (
802    p_vacancy_id => p_rec.vacancy_id
803   ,p_rec_activity_id => p_rec.rec_activity_id
804   );
805   --
806   hr_utility.set_location(' Leaving:'||l_proc, 80);
807 End insert_validate;
808 --
809 -- ----------------------------------------------------------------------------
810 -- |---------------------------< update_validate >----------------------------|
811 -- ----------------------------------------------------------------------------
812 Procedure update_validate
813   (p_rec                          in per_rcf_shd.g_rec_type
814   ) is
815 --
816   l_proc  varchar2(72) := g_package||'update_validate';
817 --
818 Begin
819   hr_utility.set_location('Entering:'||l_proc, 10);
820   --
821   -- Call all supporting business operations
822   --
823   hr_utility.set_location(l_proc, 20);
824   --
825   per_rcf_bus.chk_non_updateable_args
826   (p_rec              => p_rec
827   );
828   hr_utility.set_location(l_proc, 30);
829   --
830   per_rcf_bus.chk_vacancy_id
831   (p_vacancy_id => p_rec.vacancy_id
832   ,p_business_group_id => per_rcf_shd.g_old_rec.business_group_id
833   ,p_rec_activity_for_id => p_rec.rec_activity_for_id
834   ,p_object_version_number => p_rec.object_version_number
835   );
836   hr_utility.set_location(l_proc, 50);
837   --
838   per_rcf_bus.chk_rec_activity_id
839   (p_rec_activity_id => p_rec.rec_activity_id
840   ,p_business_group_id => per_rcf_shd.g_old_rec.business_group_id
841   ,p_rec_activity_for_id => p_rec.rec_activity_for_id
842   ,p_object_version_number => p_rec.object_version_number
843   );
844   hr_utility.set_location(l_proc, 60);
845   --
846   per_rcf_bus.chk_vacancy_rec_activity
847   (p_vacancy_id => p_rec.vacancy_id
848   ,p_rec_activity_id => p_rec.rec_activity_id
849   );
850   --
851   hr_utility.set_location(l_proc, 70);
852   per_rcf_bus.chk_rec_activity_dates
853   (
854    p_vacancy_id => p_rec.vacancy_id
855   ,p_rec_activity_id => p_rec.rec_activity_id
856   );
857   --
858   hr_utility.set_location(' Leaving:'||l_proc, 80);
859 End update_validate;
860 --
861 -- ----------------------------------------------------------------------------
862 -- |---------------------------< delete_validate >----------------------------|
863 -- ----------------------------------------------------------------------------
864 Procedure delete_validate
865   (p_rec                          in per_rcf_shd.g_rec_type
866   ) is
867 --
868   l_proc  varchar2(72) := g_package||'delete_validate';
869 --
870 Begin
871   hr_utility.set_location('Entering:'||l_proc, 5);
872   --
873   -- Call all supporting business operations
874   --
875   hr_utility.set_location(' Leaving:'||l_proc, 10);
876 End delete_validate;
877 --
878 end per_rcf_bus;