DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_RAA_BUS

Source


1 Package Body per_raa_bus as
2 /* $Header: peraarhi.pkb 115.20 2003/11/21 02:05:11 vvayanip ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_raa_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_recruitment_activity_id     number         default null;
15 --
16 --  ---------------------------------------------------------------------------
17 --  |----------------------< set_security_group_id >--------------------------|
18 --  ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21   (p_recruitment_activity_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_activities raa
31      where raa.recruitment_activity_id = p_recruitment_activity_id
32        and pbg.business_group_id = raa.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_id'
48     ,p_argument_value     => p_recruitment_activity_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_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_recruitment_activity_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_activities raa
95      where raa.recruitment_activity_id = p_recruitment_activity_id
96        and pbg.business_group_id = raa.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_id'
112     ,p_argument_value     => p_recruitment_activity_id
113     );
114   --
115   if ( nvl(per_raa_bus.g_recruitment_activity_id, hr_api.g_number)
116        = p_recruitment_activity_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_raa_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_raa_bus.g_recruitment_activity_id     := p_recruitment_activity_id;
147     per_raa_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_df >----------------------------------|
155 -- ----------------------------------------------------------------------------
156 --
157 -- Description:
158 --   Validates all the Descriptive Flexfield values.
159 --
160 -- Prerequisites:
161 --   All other columns have been validated.  Must be called as the
162 --   last step from insert_validate and update_validate.
163 --
164 -- In Arguments:
165 --   p_rec
166 --
167 -- Post Success:
168 --   If the Descriptive Flexfield structure column and data values are
169 --   all valid this procedure will end normally and processing will
170 --   continue.
171 --
172 -- Post Failure:
173 --   If the Descriptive Flexfield structure column value or any of
174 --   the data values are invalid then an application error is raised as
175 --   a PL/SQL exception.
176 --
177 -- Access Status:
178 --   Internal Row Handler Use Only.
179 --
180 -- ----------------------------------------------------------------------------
181 procedure chk_df
182   (p_rec in per_raa_shd.g_rec_type
183   ) is
184 --
185   l_proc   varchar2(72) := g_package || 'chk_df';
186 --
187 begin
188   hr_utility.set_location('Entering:'||l_proc,10);
189   --
190   if ((p_rec.recruitment_activity_id is not null)  and (
191     nvl(per_raa_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
192     nvl(p_rec.attribute_category, hr_api.g_varchar2)  or
193     nvl(per_raa_shd.g_old_rec.attribute1, hr_api.g_varchar2) <>
194     nvl(p_rec.attribute1, hr_api.g_varchar2)  or
195     nvl(per_raa_shd.g_old_rec.attribute2, hr_api.g_varchar2) <>
196     nvl(p_rec.attribute2, hr_api.g_varchar2)  or
197     nvl(per_raa_shd.g_old_rec.attribute3, hr_api.g_varchar2) <>
198     nvl(p_rec.attribute3, hr_api.g_varchar2)  or
199     nvl(per_raa_shd.g_old_rec.attribute4, hr_api.g_varchar2) <>
200     nvl(p_rec.attribute4, hr_api.g_varchar2)  or
201     nvl(per_raa_shd.g_old_rec.attribute5, hr_api.g_varchar2) <>
202     nvl(p_rec.attribute5, hr_api.g_varchar2)  or
203     nvl(per_raa_shd.g_old_rec.attribute6, hr_api.g_varchar2) <>
204     nvl(p_rec.attribute6, hr_api.g_varchar2)  or
205     nvl(per_raa_shd.g_old_rec.attribute7, hr_api.g_varchar2) <>
206     nvl(p_rec.attribute7, hr_api.g_varchar2)  or
207     nvl(per_raa_shd.g_old_rec.attribute8, hr_api.g_varchar2) <>
208     nvl(p_rec.attribute8, hr_api.g_varchar2)  or
209     nvl(per_raa_shd.g_old_rec.attribute9, hr_api.g_varchar2) <>
210     nvl(p_rec.attribute9, hr_api.g_varchar2)  or
211     nvl(per_raa_shd.g_old_rec.attribute10, hr_api.g_varchar2) <>
212     nvl(p_rec.attribute10, hr_api.g_varchar2)  or
213     nvl(per_raa_shd.g_old_rec.attribute11, hr_api.g_varchar2) <>
214     nvl(p_rec.attribute11, hr_api.g_varchar2)  or
215     nvl(per_raa_shd.g_old_rec.attribute12, hr_api.g_varchar2) <>
216     nvl(p_rec.attribute12, hr_api.g_varchar2)  or
217     nvl(per_raa_shd.g_old_rec.attribute13, hr_api.g_varchar2) <>
218     nvl(p_rec.attribute13, hr_api.g_varchar2)  or
219     nvl(per_raa_shd.g_old_rec.attribute14, hr_api.g_varchar2) <>
220     nvl(p_rec.attribute14, hr_api.g_varchar2)  or
221     nvl(per_raa_shd.g_old_rec.attribute15, hr_api.g_varchar2) <>
222     nvl(p_rec.attribute15, hr_api.g_varchar2)  or
223     nvl(per_raa_shd.g_old_rec.attribute16, hr_api.g_varchar2) <>
224     nvl(p_rec.attribute16, hr_api.g_varchar2)  or
225     nvl(per_raa_shd.g_old_rec.attribute17, hr_api.g_varchar2) <>
226     nvl(p_rec.attribute17, hr_api.g_varchar2)  or
227     nvl(per_raa_shd.g_old_rec.attribute18, hr_api.g_varchar2) <>
228     nvl(p_rec.attribute18, hr_api.g_varchar2)  or
229     nvl(per_raa_shd.g_old_rec.attribute19, hr_api.g_varchar2) <>
230     nvl(p_rec.attribute19, hr_api.g_varchar2)  or
231     nvl(per_raa_shd.g_old_rec.attribute20, hr_api.g_varchar2) <>
232     nvl(p_rec.attribute20, hr_api.g_varchar2) ))
233     or (p_rec.recruitment_activity_id is null)  then
234     --
235     -- Only execute the validation if absolutely necessary:
236     -- a) During update, the structure column value or any
237     --    of the attribute values have actually changed.
238     -- b) During insert.
239     --
240     hr_dflex_utility.ins_or_upd_descflex_attribs
241       (p_appl_short_name                 => 'PER'
242       ,p_descflex_name                   => 'PER_RECRUITMENT_ACTIVITIES'
243       ,p_attribute_category              => p_rec.attribute_category
244       ,p_attribute1_name                 => 'ATTRIBUTE1'
245       ,p_attribute1_value                => p_rec.attribute1
246       ,p_attribute2_name                 => 'ATTRIBUTE2'
247       ,p_attribute2_value                => p_rec.attribute2
248       ,p_attribute3_name                 => 'ATTRIBUTE3'
249       ,p_attribute3_value                => p_rec.attribute3
250       ,p_attribute4_name                 => 'ATTRIBUTE4'
251       ,p_attribute4_value                => p_rec.attribute4
252       ,p_attribute5_name                 => 'ATTRIBUTE5'
253       ,p_attribute5_value                => p_rec.attribute5
254       ,p_attribute6_name                 => 'ATTRIBUTE6'
255       ,p_attribute6_value                => p_rec.attribute6
256       ,p_attribute7_name                 => 'ATTRIBUTE7'
257       ,p_attribute7_value                => p_rec.attribute7
258       ,p_attribute8_name                 => 'ATTRIBUTE8'
259       ,p_attribute8_value                => p_rec.attribute8
260       ,p_attribute9_name                 => 'ATTRIBUTE9'
261       ,p_attribute9_value                => p_rec.attribute9
262       ,p_attribute10_name                => 'ATTRIBUTE10'
263       ,p_attribute10_value               => p_rec.attribute10
264       ,p_attribute11_name                => 'ATTRIBUTE11'
265       ,p_attribute11_value               => p_rec.attribute11
266       ,p_attribute12_name                => 'ATTRIBUTE12'
267       ,p_attribute12_value               => p_rec.attribute12
268       ,p_attribute13_name                => 'ATTRIBUTE13'
269       ,p_attribute13_value               => p_rec.attribute13
270       ,p_attribute14_name                => 'ATTRIBUTE14'
271       ,p_attribute14_value               => p_rec.attribute14
272       ,p_attribute15_name                => 'ATTRIBUTE15'
273       ,p_attribute15_value               => p_rec.attribute15
274       ,p_attribute16_name                => 'ATTRIBUTE16'
275       ,p_attribute16_value               => p_rec.attribute16
276       ,p_attribute17_name                => 'ATTRIBUTE17'
277       ,p_attribute17_value               => p_rec.attribute17
278       ,p_attribute18_name                => 'ATTRIBUTE18'
279       ,p_attribute18_value               => p_rec.attribute18
280       ,p_attribute19_name                => 'ATTRIBUTE19'
281       ,p_attribute19_value               => p_rec.attribute19
282       ,p_attribute20_name                => 'ATTRIBUTE20'
283       ,p_attribute20_value               => p_rec.attribute20
284       );
285   end if;
286   --
287   hr_utility.set_location(' Leaving:'||l_proc,20);
288 end chk_df;
289 --
290 -- ----------------------------------------------------------------------------
291 -- |-----------------------< chk_non_updateable_args >------------------------|
292 -- ----------------------------------------------------------------------------
293 -- {Start Of Comments}
294 --
295 -- Description:
296 --   This procedure is used to ensure that non updateable attributes have
297 --   not been updated. If an attribute has been updated an error is generated.
298 --
299 -- Pre Conditions:
300 --   g_old_rec has been populated with details of the values currently in
301 --   the database.
302 --
303 -- In Arguments:
304 --   p_rec has been populated with the updated values the user would like the
305 --   record set to.
306 --
307 -- Post Success:
308 --   Processing continues if all the non updateable attributes have not
309 --   changed.
310 --
311 -- Post Failure:
312 --   An application error is raised if any of the non updatable attributes
313 --   have been altered.
314 --
315 -- {End Of Comments}
316 -- ----------------------------------------------------------------------------
317 Procedure chk_non_updateable_args
318   (p_rec in per_raa_shd.g_rec_type
319   ) IS
320 --
321   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
322 --
323 Begin
324   --
325   -- Only proceed with the validation if a row exists for the current
326   -- record in the HR Schema.
327   --
328   if NOT per_raa_shd.api_updating
329       (p_recruitment_activity_id              => p_rec.recruitment_activity_id
330       ,p_object_version_number                => p_rec.object_version_number
331       ) THEN
332      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
333      fnd_message.set_token('PROCEDURE ', l_proc);
334      fnd_message.set_token('STEP ', '5');
335      fnd_message.raise_error;
336   END if;
337   --
338   --  Add checks to ensure non-updateable args have
339   --  not been updated.
340   if p_rec.business_group_id <> per_raa_shd.g_old_rec.business_group_id then
341      hr_api.argument_changed_error
342      (p_api_name   => l_proc
343      ,p_argument   => 'BUSINESS_GROUP_ID'
344      ,p_base_table => per_raa_shd.g_tab_nam
345      );
346   end if;
347 
348   if p_rec.recruitment_activity_id <> per_raa_shd.g_old_rec.recruitment_activity_id then
349      hr_api.argument_changed_error
350      (p_api_name   => l_proc
351      ,p_argument   => 'RECRUITMENT_ACTIVITY_ID'
352      ,p_base_table => per_raa_shd.g_tab_nam
353      );
354   end if;
355   --
356 End chk_non_updateable_args;
357 --
358 -- -----------------------------------------------------------------------------
359 -- |-------------------------------< chk_name >--------------------------------|
360 -- -----------------------------------------------------------------------------
361 --
362 -- Description:
363 --   Checks that name is mandatory
364 --
365 -- Prerequisites:
366 --
367 --
368 -- In Arguments:
369 --   p_name
370 --
371 -- Post Success:
372 --   If name is valid this procedure will end normally and processing will
373 --   continue.
374 --
375 -- Post Failure:
376 --   If authorising person id is invalid then an application error is raised
377 --   as a PL/SQL exception.
378 --
379 -- Access Status:
380 --   Internal Row Handler Use Only.
381 --
382 -- ----------------------------------------------------------------------------
383 procedure chk_name
384   (p_name in per_recruitment_activities.name%TYPE
385   ,p_recruitment_activity_id in
386        per_recruitment_activities.recruitment_activity_id%TYPE
387   ,p_object_version_number in
388        per_recruitment_activities.object_version_number%TYPE
389   ) is
390 --
391   l_proc   varchar2(72) := g_package || 'chk_name';
392   l_name     varchar2(1);
393   l_api_updating boolean;
394   cursor csr_name is
395          select null
396            from per_recruitment_activities
397           where name     = p_name;
398 --
399 begin
400   hr_utility.set_location('Entering:'||l_proc,10);
401   --
402   hr_api.mandatory_arg_error
403    (p_api_name           => l_proc
404    ,p_argument           => 'NAME'
405    ,p_argument_value     => p_name
406    );
407   --
408   l_api_updating := per_raa_shd.api_updating
409                     (p_recruitment_activity_id => p_recruitment_activity_id
410                     ,p_object_version_number   => p_object_version_number);
411   hr_utility.set_location(l_proc,20);
412   if(l_api_updating  and
413        p_name <>
414        NVL(per_raa_shd.g_old_rec.name,hr_api.g_varchar2)
415      ) or (NOT l_api_updating) then
416      hr_utility.set_location(l_proc,30);
417     open csr_name;
418     fetch csr_name into l_name;
419   --
420     if(csr_name%found) then
421       hr_utility.set_location(l_proc,40);
422       close csr_name;
423       fnd_message.set_name('PER','IRC_412123_DUPLICATE_REC_ACTIV');
424       fnd_message.raise_error;
425     end if;
426     close csr_name;
427   end if;
428   --
429   hr_utility.set_location(' Leaving:'||l_proc,50);
430   exception
431    when app_exception.application_exception then
432     if hr_multi_message.exception_add
433        (p_associated_column1 => 'PER_RECRUITMENT_ACTIVITIES.NAME'
434        ) then
435       hr_utility.set_location(' Leaving:'||l_proc,60);
436       raise;
437     end if;
438   hr_utility.set_location(' Leaving:'||l_proc,70);
439 end chk_name;
440 --
441 -- -----------------------------------------------------------------------------
442 -- |----------------------< chk_authorising_person_id >------------------------|
443 -- -----------------------------------------------------------------------------
444 --
445 -- Description:
446 --   Checks that Authorising person id exists in
447 --   PER_ALL_PEOPLE_F and system person type is EMP or CWK.
448 --
449 -- Prerequisites:
450 --  g_old_rec has been populated with details of the values currently in
451 --  the database.
452 --
453 -- In Arguments:
454 --   p_authorising_person_id
455 --   p_date_start
456 --   p_recruitment_activity_id
457 --   p_object_version_number
458 --
459 -- Post Success:
460 --   If authorising_person_id is valid this procedure will
461 --   end normally and processing will continue.
462 --
463 -- Post Failure:
464 --   If authorising person id is invalid then an application error is raised
465 --   as a PL/SQL exception.
466 --
467 -- Access Status:
468 --   Internal Row Handler Use Only.
469 --
470 -- ----------------------------------------------------------------------------
471 procedure chk_authorising_person_id
472   (p_authorising_person_id   in
473                          per_recruitment_activities.authorising_person_id%TYPE
474   ,p_date_start              in
475                          per_recruitment_activities.date_start%TYPE
476   ,p_recruitment_activity_id in
477                          per_recruitment_activities.recruitment_activity_id%TYPE
478   ,p_object_version_number   in
479                          per_recruitment_activities.object_version_number%TYPE
480  ) is
481 --
482   l_proc   varchar2(72) := g_package || 'chk_authorising_person_id';
483   l_authorising_person_id varchar2(1);
484   l_system_person_type    varchar2(1);
485   l_api_updating          boolean;
486 
487   cursor csr_authorising_person_id is
488   select null from PER_ALL_PEOPLE_F pap
489   where pap.person_id = p_authorising_person_id
490   and
491   (p_date_start between pap.effective_start_date and pap.effective_end_date);
492 
493   cursor csr_system_person_type is
494   select null from per_person_types ppt, per_person_type_usages_f ptu
495   where ptu.person_id = p_authorising_person_id
496   and p_date_start between ptu.effective_start_date and ptu.effective_end_date
497   and ptu.person_type_id = ppt.person_type_id
498   and (ppt.system_person_type = 'EMP'
499    or (ppt.system_person_type = 'CWK' and
500        nvl(fnd_profile.value('HR_TREAT_CWK_AS_EMP'), 'N') = 'Y'));
501 --
502 begin
503   hr_utility.set_location('Entering:'||l_proc,10);
504   --
505   l_api_updating  :=
506   per_raa_shd.api_updating(p_recruitment_activity_id,p_object_version_number);
507   hr_utility.set_location(l_proc,20);
508   if p_authorising_person_id is not null then
509     if (l_api_updating  and
510         p_authorising_person_id <>
511         NVL(per_raa_shd.g_old_rec.authorising_person_id,hr_api.g_number)
512        ) or (NOT l_api_updating) then
513 
514     -- check that authorising_person_id exists in per_all_people_f.
515       hr_utility.set_location(l_proc,30);
516       open csr_authorising_person_id;
517       fetch csr_authorising_person_id into l_authorising_person_id;
518       if csr_authorising_person_id%NOTFOUND then
519         close csr_authorising_person_id;
520         fnd_message.set_name('PER','PER_289429_RAA_INV_AUTH_PERSON');
521         fnd_message.raise_error;
522       end if;
523       close csr_authorising_person_id;
524     -- check that system person type is EMP or CWK.
525       hr_utility.set_location(l_proc,40);
526       open csr_system_person_type;
527       fetch csr_system_person_type into l_system_person_type;
528       if csr_system_person_type%NOTFOUND then
529         close csr_system_person_type;
530         fnd_message.set_name('PER','PER_289430_RAA_INV_PERSON_TYPE');
531         fnd_message.raise_error;
532       end if;
533       close csr_system_person_type;
534     --
535     end if;
536    end if;
537   --
538   hr_utility.set_location(' Leaving:'||l_proc,50);
539   exception
540    when app_exception.application_exception then
541     if hr_multi_message.exception_add
542      (p_associated_column1 => 'PER_RECRUITMENT_ACTIVITIES.AUTHORISING_PERSON_ID'
543      ) then
544       hr_utility.set_location(' Leaving:'||l_proc,60);
545       raise;
546     end if;
547   hr_utility.set_location(' Leaving:'||l_proc,70);
548 --
549 end chk_authorising_person_id;
550 --
551 -- -----------------------------------------------------------------------------
552 -- |--------------------< chk_run_by_organization_id >-------------------------|
553 -- -----------------------------------------------------------------------------
554 --
555 -- Description:
556 --   Checks that run_by_organization_id exists in HR_ALL_ORGANIZATION_UNITS
557 --
558 -- Prerequisites:
559 --  g_old_rec has been populated with details of the values currently in
560 --  the database.
561 --
562 -- In Arguments:
563 --   p_run_by_organization_id
564 --   p_recruitment_activity_id
565 --   p_object_version_number
566 --
567 -- Post Success:
568 --   If run_by_organization_id is valid this procedure will
569 --   end normally and processing will continue.
570 --
571 -- Post Failure:
572 --   If run_by_organization_id is invalid then an application error is raised
573 --   as a PL/SQL exception.
574 --
575 -- Access Status:
576 --   Internal Row Handler Use Only.
577 --
578 -- ----------------------------------------------------------------------------
579 procedure chk_run_by_organization_id
580   (p_run_by_organization_id  in
581                          per_recruitment_activities.run_by_organization_id%TYPE
582   ,p_recruitment_activity_id in
583                          per_recruitment_activities.recruitment_activity_id%TYPE
584   ,p_object_version_number   in
585                          per_recruitment_activities.object_version_number%TYPE
586   ) is
587 --
588   l_proc   varchar2(72) := g_package || 'chk_run_by_organization_id';
589   l_run_by_organization_id varchar2(1);
590   l_api_updating           boolean;
591 
592   cursor csr_run_by_organization_id is
593   select null from HR_ALL_ORGANIZATION_UNITS hao
594   where hao.organization_id = p_run_by_organization_id;
595 --
596 begin
597   hr_utility.set_location('Entering:'||l_proc,10);
598   --
599   l_api_updating  :=
600   per_raa_shd.api_updating(p_recruitment_activity_id,p_object_version_number);
601   hr_utility.set_location(l_proc,20);
602   if p_run_by_organization_id is not null then
603     if (l_api_updating and
604         p_run_by_organization_id <>
605         NVL(per_raa_shd.g_old_rec.run_by_organization_id,hr_api.g_number))
606        or (NOT l_api_updating) then
607 
608     -- check that run_by_organization_id exists in per_all_people_f.
609       hr_utility.set_location(l_proc,30);
610       open csr_run_by_organization_id;
611       fetch csr_run_by_organization_id into l_run_by_organization_id;
612       if csr_run_by_organization_id%NOTFOUND then
613         close csr_run_by_organization_id;
614         fnd_message.set_name('PER','PER_289431_RAA_INV_RUN_BY_ORG');
615         fnd_message.raise_error;
616       end if;
617       close csr_run_by_organization_id;
618     --
619     end if;
620     --
621   end if;
622   hr_utility.set_location(' Leaving:'||l_proc,40);
623   exception
624    when app_exception.application_exception then
625      if hr_multi_message.exception_add
626      (p_associated_column1=> 'PER_RECRUITMENT_ACTIVITIES.RUN_BY_ORGANIZATION_ID'
627      ) then
628        hr_utility.set_location(' Leaving:'||l_proc,50);
629        raise;
630      end if;
631   hr_utility.set_location(' Leaving:'||l_proc,60);
632 --
633 end chk_run_by_organization_id;
634 --
635 -- ----------------------------------------------------------------------------
636 -- |--------------------< chk_internal_contact_person_id >---------------------|
637 -- -----------------------------------------------------------------------------
638 --
639 -- Description:
640 --   Checks that internal contact person id exists in
641 --   PER_ALL_PEOPLE_F and system person type is EMP or CWK.
642 --
643 -- Prerequisites:
644 --  g_old_rec has been populated with details of the values currently in
645 --  the database.
646 --
647 -- In Arguments:
648 --   p_internal_contact_person_id
649 --   p_date_start
650 --   p_recruitment_activity_id
651 --   p_object_version_number
652 --
653 -- Post Success:
654 --   If internal_contact_person_id is valid this procedure will
655 --   end normally and processing will continue.
656 --
657 -- Post Failure:
658 --   If internal contact person id is invalid then an application error is
659 --   raised as a PL/SQL exception.
660 --
661 -- Access Status:
662 --   Internal Row Handler Use Only.
663 --
664 -- ----------------------------------------------------------------------------
665 procedure chk_internal_contact_person_id
666   (p_internal_contact_person_id in
667                      per_recruitment_activities.internal_contact_person_id%TYPE
668   ,p_date_start                 in
669                      per_recruitment_activities.date_start%TYPE
670   ,p_recruitment_activity_id    in
671                      per_recruitment_activities.recruitment_activity_id%TYPE
672   ,p_object_version_number      in
673                      per_recruitment_activities.object_version_number%TYPE
674   ) is
675 --
676   l_proc   varchar2(72) := g_package || 'chk_internal_contact_person_id';
677   l_internal_contact_person_id     varchar2(1);
678   l_system_person_type             varchar2(1);
679   l_api_updating                   boolean;
680 
681   cursor csr_internal_contact_person_id is
682   select null from PER_ALL_PEOPLE_F  pap
683   where pap.person_id = p_internal_contact_person_id
684   and
685   (p_date_start between pap.effective_start_date and pap.effective_end_date);
686 
687   cursor csr_system_person_type is
688   select null from per_person_types ppt, per_person_type_usages_f ptu
689   where ptu.person_id = p_internal_contact_person_id
690   and p_date_start between ptu.effective_start_date and ptu.effective_end_date
691   and ptu.person_type_id = ppt.person_type_id
692   and (ppt.system_person_type = 'EMP'
693    or (ppt.system_person_type = 'CWK' and
694        nvl(fnd_profile.value('HR_TREAT_CWK_AS_EMP'), 'N') = 'Y'));
695 
696   --
697 begin
698   hr_utility.set_location('Entering:'||l_proc,10);
699   --
700   l_api_updating  :=
701   per_raa_shd.api_updating(p_recruitment_activity_id,p_object_version_number);
702   hr_utility.set_location(l_proc,20);
703   if p_internal_contact_person_id is not null then
704     if (l_api_updating and
705         p_internal_contact_person_id <>
706         NVL(per_raa_shd.g_old_rec.internal_contact_person_id,hr_api.g_number))
707         or (NOT l_api_updating) then
708 
709     -- check that internal_contact_person_id exists in per_all_people_f.
710       hr_utility.set_location(l_proc,30);
711       open csr_internal_contact_person_id;
712       fetch csr_internal_contact_person_id into l_internal_contact_person_id;
713       if csr_internal_contact_person_id%NOTFOUND then
714         close csr_internal_contact_person_id;
715         fnd_message.set_name('PER','PER_289432_RAA_INV_CONT_PERSON');
716         fnd_message.raise_error;
717       end if;
718       close csr_internal_contact_person_id;
719 
720     -- check that system person type is EMP or CWK.
721       hr_utility.set_location(l_proc,40);
722       open csr_system_person_type;
723       fetch csr_system_person_type into l_system_person_type;
724       if csr_system_person_type%NOTFOUND then
725         close csr_system_person_type;
726         fnd_message.set_name('PER','PER_289430_RAA_INV_PERSON_TYPE');
727         fnd_message.raise_error;
728       end if;
729       close csr_system_person_type;
730     --
731     end if;
732   end if;
733   hr_utility.set_location(' Leaving:'||l_proc,50);
734   exception
735    when app_exception.application_exception then
736      if hr_multi_message.exception_add
737      (p_associated_column1 =>
738      'PER_RECRUITMENT_ACTIVITIES.INTERNAL_CONTACT_PERSON_ID'
739      ) then
740        hr_utility.set_location(' Leaving:'||l_proc,60);
741        raise;
742      end if;
743    hr_utility.set_location(' Leaving:'||l_proc,70);
744 --
745 end chk_internal_contact_person_id;
746 --
747 -- -----------------------------------------------------------------------------
748 -- |-------------------< chk_parent_recruitment_activit >----------------------|
749 -- -----------------------------------------------------------------------------
750 --
751 -- Description:
752 --   Checks that parent recruitment activity id exists in
753 --   PER_RECRUITMENT_ACTIVITIES.
754 --   Checks that parent_recruitment_activity_id is not equal to
755 --   recruitment_activity_id of current row.
756 --   Checks that parent_recruitment_activity_id is not equal to
757 --   recruiment_activity_id of any row for which parent_recruitment_activity_id
758 --   is equal to recruitment_id of current row.
759 --
760 -- Prerequisites:
761 --  g_old_rec has been populated with details of the values currently in
762 --  the database.
763 --
764 -- In Arguments:
765 --   p_parent_recruitment_activity
766 --   p_date_start
767 --   p_business_group_id
768 --   p_recruitment_activity_id
769 --   p_object_version_number
770 --
771 -- Post Success:
772 --   If parent_recruitment_activity_id is valid this procedure will
773 --   end normally and processing will continue.
774 --
775 -- Post Failure:
776 --   If parent_recruitment_acitivity_id is invalid then an application error is
777 --   raised as a PL/SQL exception.
778 --
779 -- Access Status:
780 --   Internal Row Handler Use Only.
781 --
782 -- ----------------------------------------------------------------------------
783 procedure chk_parent_recruitment_activit
784   (p_parent_recruitment_activity in
785                   per_recruitment_activities.parent_recruitment_activity_id%TYPE
786   ,p_date_start                  in
787                   per_recruitment_activities.date_start%TYPE
788   ,p_business_group_id           in
789                   per_recruitment_activities.business_group_id%TYPE
790   ,p_recruitment_activity_id     in
791                   per_recruitment_activities.recruitment_activity_id%TYPE
792   ,p_object_version_number       in
793                   per_recruitment_activities.object_version_number%TYPE
794   ) is
795 --
796   l_proc   varchar2(72) := g_package || 'chk_parent_recruitment_activit';
797   l_parent_recruitment_activity_  varchar2(1);
798   l_recruitment_activity_id       varchar2(1);
799   l_api_updating                  boolean;
800 --
801   cursor csr_parent_recruitment_activit is
802    select null from PER_RECRUITMENT_ACTIVITIES pra
803    where pra.recruitment_activity_id = p_parent_recruitment_activity;
804 
805   cursor csr_recruitment_activity_id is
806   select null from PER_RECRUITMENT_ACTIVITIES r1
807   where r1.business_group_id = p_business_group_id and
808   p_recruitment_activity_id <> r1.recruitment_activity_id
809   and r1.recruitment_activity_id=p_parent_recruitment_activity
810   and p_date_start between r1.date_start and nvl(r1.date_end, hr_api.g_eot)
811   and r1.recruitment_activity_id not in (select r2.recruitment_activity_id
812   from per_recruitment_activities r2 connect by
813   r2.parent_recruitment_activity_id = prior r2.recruitment_activity_id
814   start with r2.parent_recruitment_activity_id = p_recruitment_activity_id);
815 --
816 begin
817   hr_utility.set_location('Entering:'||l_proc,10);
818   --
819   l_api_updating  :=
820   per_raa_shd.api_updating(p_recruitment_activity_id,p_object_version_number);
821   hr_utility.set_location(l_proc,20);
822 
823   if p_parent_recruitment_activity is not null then
824     if (l_api_updating and
825        (p_parent_recruitment_activity <>
826        NVL(per_raa_shd.g_old_rec.parent_recruitment_activity_id,hr_api.g_number)
827        or
828        p_recruitment_activity_id <>
829        per_raa_shd.g_old_rec.recruitment_activity_id))
830        or (NOT l_api_updating) then
831 
832     -- Checks that parent recruitment activity id exists in
833     -- PER_RECRUITMENT_ACTIVITIES.
834       hr_utility.set_location(l_proc,30);
835       open csr_parent_recruitment_activit;
836       fetch csr_parent_recruitment_activit into l_parent_recruitment_activity_;
837       if csr_parent_recruitment_activit%NOTFOUND then
838         close csr_parent_recruitment_activit;
839         fnd_message.set_name('PER','PER_289433_RAA_INV_PARENT_ACTI');
840         fnd_message.raise_error;
841       end if;
842       close csr_parent_recruitment_activit;
843 
844       hr_utility.set_location(l_proc,35);
845       if p_recruitment_activity_id is not null then
846         -- Checks that parent_recruitment_activity_id is not equal to
847         -- recruitment_activity_id of current row.
848         hr_utility.set_location(l_proc,40);
849         if  p_parent_recruitment_activity = p_recruitment_activity_id then
850           fnd_message.set_name('PER','PER_289434_RAA_INV_PARENT_ACTI');
851           fnd_message.raise_error;
852         end if;
853         -- Checks that parent_recruitment_activity_id is not equal to
854         -- recruiment_activity_id of any row for which
855         -- parent_recruitment_activity_id
856         -- is equal to recruitment_id of current row.
857         hr_utility.set_location(l_proc,50);
858         open csr_recruitment_activity_id;
859         fetch csr_recruitment_activity_id into l_recruitment_activity_id;
860         if csr_recruitment_activity_id%NOTFOUND then
861           close csr_recruitment_activity_id;
862           fnd_message.set_name('PER','PER_289434_RAA_INV_PARENT_ACTI');
863           fnd_message.raise_error;
864         end if;
865         close csr_recruitment_activity_id;
866       end if;
867     --
868     end if;
869   end if;
870   --
871   hr_utility.set_location(' Leaving:'||l_proc,60);
872   exception
873    when app_exception.application_exception then
874      if hr_multi_message.exception_add
875      (p_associated_column1 =>
876      'PER_RECRUITMENT_ACTIVITIES.PARENT_RECRUITMENT_ACTIVITY_ID'
877      ) then
878        hr_utility.set_location(' Leaving:'||l_proc,70);
879        raise;
880      end if;
881    hr_utility.set_location(' Leaving:'||l_proc,80);
882 --
883 end chk_parent_recruitment_activit;
884 --
885 -- -----------------------------------------------------------------------------
886 -- |--------------------------< chk_currency_code >----------------------------|
887 -- -----------------------------------------------------------------------------
888 --
889 -- Description:
890 --   Checks that currency_code exists in FND_CURRENCIES
891 --
892 -- Prerequisites:
893 --  g_old_rec has been populated with details of the values currently in
894 --  the database.
895 --
896 -- In Arguments:
897 --   p_currency_code
898 --   p_date_start
899 --   p_recruitment_activity_id
900 --   p_object_version_number
901 --
902 -- Post Success:
903 --   If currency_code is valid this procedure will
904 --   end normally and processing will continue.
905 --
906 -- Post Failure:
907 --   If currency_code is invalid then an application error is raised
908 --   as a PL/SQL exception.
909 --
910 -- Access Status:
911 --   Internal Row Handler Use Only.
912 --
913 -- ----------------------------------------------------------------------------
914 procedure chk_currency_code
915   (p_currency_code           in
916                   per_recruitment_activities.currency_code%TYPE
917   ,p_date_start              in
918                   per_recruitment_activities.date_start%TYPE
919   ,p_recruitment_activity_id in
920                   per_recruitment_activities.recruitment_activity_id%TYPE
921   ,p_object_version_number   in
922                   per_recruitment_activities.object_version_number%TYPE
923   ) is
924 --
925   l_proc   varchar2(72) := g_package || 'chk_currency_code';
926   l_currency_code varchar2(1);
927   l_api_updating  boolean;
928 
929   cursor csr_currency_code is
930   select null from FND_CURRENCIES fc
931   where fc.currency_code = p_currency_code
932   and
933   (p_date_start between fc.start_date_active and fc.end_date_active);
934 --
935 begin
936   hr_utility.set_location('Entering:'||l_proc,10);
937   --
938   l_api_updating  :=
939   per_raa_shd.api_updating(p_recruitment_activity_id,p_object_version_number);
940   hr_utility.set_location(l_proc,20);
941   if p_currency_code is not null then
942     if (l_api_updating and
943         p_currency_code <>
944         NVL(per_raa_shd.g_old_rec.currency_code,hr_api.g_number))
945        or (NOT l_api_updating) then
946 
947       -- check that currency_code exists in FND_CURRENCIES.
948       hr_utility.set_location(l_proc,30);
949       open csr_currency_code;
950       fetch csr_currency_code into l_currency_code;
951       if csr_currency_code%NOTFOUND then
952         close csr_currency_code;
953         fnd_message.set_name('PER','PER_289435_RAA_INV_CURRENCY_CO');
954         fnd_message.raise_error;
955       end if;
956       close csr_currency_code;
957     --
958     end if;
959   end if;
960   --
961   hr_utility.set_location(' Leaving:'||l_proc,40);
962   exception
963    when app_exception.application_exception then
964      if hr_multi_message.exception_add
965      (p_associated_column1 =>
966      'PER_RECRUITMENT_ACTIVITIES.CURRENCY_CODE'
967      ) then
968        hr_utility.set_location(' Leaving:'||l_proc,50);
969        raise;
970      end if;
971    hr_utility.set_location(' Leaving:'||l_proc,60);
972 end chk_currency_code;
973 --
974 -- -----------------------------------------------------------------------------
975 -- |-------------------< chk_recruiting_site_id >------------------------------|
976 -- -----------------------------------------------------------------------------
977 --
978 -- Description:
979 --   Checks that posting_content_id exists in IRC_ALL_RECRUITING_SITES
980 --
981 -- Prerequisites:
982 --  g_old_rec has been populated with details of the values currently in
983 --  the database.
984 --
985 -- In Arguments:
986 --   p_recruiting_site_id
987 --   p_recruitment_activity_id
988 --   p_object_version_number
989 --
990 -- Post Success:
991 --   If recruiting_site_id is valid this procedure will
992 --   end normally and processing will continue.
993 --
994 -- Post Failure:
995 --   If posting_content_id is invalid then an application error is raised
996 --   as a PL/SQL exception.
997 --
998 -- Access Status:
999 --   Internal Row Handler Use Only.
1000 --
1001 -- ----------------------------------------------------------------------------
1002 procedure chk_recruiting_site_id
1003   (p_recruiting_site_id       in
1004                   per_recruitment_activities.recruiting_site_id%TYPE
1005   ,p_recruitment_activity_id  in
1006                   per_recruitment_activities.RECRUITMENT_ACTIVITY_ID%TYPE
1007   ,p_object_version_number    in
1008                   per_recruitment_activities.OBJECT_VERSION_NUMBER%TYPE
1009   ) is
1010 --
1011   l_proc   varchar2(72) := g_package || 'chk_recruiting_site_id';
1012   l_recruiting_site_id varchar2(1);
1013   l_api_updating       boolean;
1014 
1015   cursor csr_recruiting_site_id is
1016    select null from IRC_ALL_RECRUITING_SITES irs
1017    where irs.recruiting_site_id = p_recruiting_site_id;
1018 --
1019 begin
1020   hr_utility.set_location('Entering:'||l_proc,10);
1021   --
1022   l_api_updating  :=
1023   per_raa_shd.api_updating(p_recruitment_activity_id,p_object_version_number);
1024   hr_utility.set_location(l_proc,20);
1025   if p_recruiting_site_id is not null then
1026     if (l_api_updating  and
1027         p_recruiting_site_id <>
1028         NVL(per_raa_shd.g_old_rec.recruiting_site_id,hr_api.g_number)
1029        ) or (NOT l_api_updating) then
1030 
1031     -- check that recruiting_site_id exists in IRC_ALL_RECRUITING_SITES.
1032       hr_utility.set_location(l_proc,30);
1033       open csr_recruiting_site_id;
1034       fetch csr_recruiting_site_id into l_recruiting_site_id;
1035       if csr_recruiting_site_id%NOTFOUND then
1036         close csr_recruiting_site_id;
1037         fnd_message.set_name('PER','PER_289880_BAD_REC_SITE_ID');
1038         fnd_message.raise_error;
1039       end if;
1040       close csr_recruiting_site_id;
1041     end if;
1042   end if;
1043   --
1044   hr_utility.set_location(' Leaving:'||l_proc,40);
1045   exception
1046    when app_exception.application_exception then
1047      if hr_multi_message.exception_add
1048      (p_associated_column1 =>
1049      'PER_RECRUITMENT_ACTIVITIES.RECRUITING_SITE_ID'
1050      ) then
1051        hr_utility.set_location(' Leaving:'||l_proc,50);
1052        raise;
1053      end if;
1054    hr_utility.set_location(' Leaving:'||l_proc,60);
1055 end chk_recruiting_site_id;
1056 --
1057 -- -----------------------------------------------------------------------------
1058 -- |-------------------< chk_posting_content_id >------------------------------|
1059 -- -----------------------------------------------------------------------------
1060 --
1061 -- Description:
1062 --   Checks that posting_content_id exists in IRC_POSTING_CONTENTS
1063 --
1064 -- Prerequisites:
1065 --  g_old_rec has been populated with details of the values currently in
1066 --  the database.
1067 --
1068 -- In Arguments:
1069 --   p_posting_content_id
1070 --   p_recruitment_activity_id
1071 --   p_object_version_number
1072 --
1073 -- Post Success:
1074 --   If posting_content_id is valid this procedure will
1075 --   end normally and processing will continue.
1076 --
1077 -- Post Failure:
1078 --   If posting_content_id is invalid then an application error is raised
1079 --   as a PL/SQL exception.
1080 --
1081 -- Access Status:
1082 --   Internal Row Handler Use Only.
1083 --
1084 -- ----------------------------------------------------------------------------
1085 procedure chk_posting_content_id
1086   (p_posting_content_id       in
1087                   per_recruitment_activities.POSTING_CONTENT_ID%TYPE
1088   ,p_recruitment_activity_id  in
1089                   per_recruitment_activities.RECRUITMENT_ACTIVITY_ID%TYPE
1090   ,p_object_version_number    in
1091                   per_recruitment_activities.OBJECT_VERSION_NUMBER%TYPE
1092   ) is
1093 --
1094   l_proc   varchar2(72) := g_package || 'chk_posting_content_id';
1095   l_posting_content_id varchar2(1);
1096   l_api_updating       boolean;
1097 
1098   cursor csr_posting_content_id is
1099    select null from IRC_POSTING_CONTENTS ipc
1100    where ipc.posting_content_id = p_posting_content_id;
1101 --
1102 begin
1103   hr_utility.set_location('Entering:'||l_proc,10);
1104   --
1105   l_api_updating  :=
1106   per_raa_shd.api_updating(p_recruitment_activity_id,p_object_version_number);
1107   hr_utility.set_location(l_proc,20);
1108   if p_posting_content_id is not null then
1109     if (l_api_updating  and
1110         p_posting_content_id <>
1111         NVL(per_raa_shd.g_old_rec.posting_content_id,hr_api.g_number)
1112        ) or (NOT l_api_updating) then
1113 
1114     -- check that posting_content_id exists in IRC_POSTING_CONTENTS.
1115       hr_utility.set_location(l_proc,30);
1116       open csr_posting_content_id;
1117       fetch csr_posting_content_id into l_posting_content_id;
1118       if csr_posting_content_id%NOTFOUND then
1119         close csr_posting_content_id;
1120         fnd_message.set_name('PER','PER_289436_RAA_INV_PERSON_TYPE');
1121         fnd_message.raise_error;
1122       end if;
1123       close csr_posting_content_id;
1124     end if;
1125   end if;
1126   --
1127   hr_utility.set_location(' Leaving:'||l_proc,40);
1128   exception
1129    when app_exception.application_exception then
1130      if hr_multi_message.exception_add
1131      (p_associated_column1 =>
1132      'PER_RECRUITMENT_ACTIVITIES.POSTING_CONTENT_ID'
1133      ) then
1134        hr_utility.set_location(' Leaving:'||l_proc,50);
1135        raise;
1136      end if;
1137    hr_utility.set_location(' Leaving:'||l_proc,60);
1138 end chk_posting_content_id;
1139 --
1140 -- -----------------------------------------------------------------------------
1141 -- |-----------------------------< chk_dates >--------------------------------|
1142 -- -----------------------------------------------------------------------------
1143 --
1144 -- Description:
1145 --   Checks that date_start is not later then corresponding date_end
1146 --   Checks that date_start is not null.
1147 --
1148 -- Prerequisites:
1149 --  g_old_rec has been populated with details of the values currently in
1150 --  the database.
1151 --
1152 -- In Arguments:
1153 --   p_date_start
1154 --   p_date_end
1155 --   p_recruitment_activity_id
1156 --   p_object_version_number
1157 --
1158 -- Post Success:
1159 --   If date_start and date_end are valid this procedure will
1160 --   end normally and processing will continue.
1161 --
1162 -- Post Failure:
1163 --   If date_start and date_end invalid then an application error is raised
1164 --   as a PL/SQL exception.
1165 --
1166 -- Access Status:
1167 --   Internal Row Handler Use Only.
1168 --
1169 -- ----------------------------------------------------------------------------
1170 procedure chk_dates
1171   (p_date_start              in
1172                   per_recruitment_activities.DATE_START%TYPE
1173   ,p_date_end                in
1174                   per_recruitment_activities.DATE_END%TYPE
1175   ,p_recruitment_activity_id in
1176                   per_recruitment_activities.RECRUITMENT_ACTIVITY_ID%TYPE
1177   ,p_object_version_number   in
1178                   per_recruitment_activities.OBJECT_VERSION_NUMBER%TYPE
1179   ) is
1180 --
1181   l_proc            varchar2(72) := g_package || 'chk_date_start';
1182   l_api_updating    boolean;
1183 --
1184 begin
1185   hr_utility.set_location('Entering:'||l_proc,10);
1186   --
1187   l_api_updating  :=
1188   per_raa_shd.api_updating(p_recruitment_activity_id,p_object_version_number);
1189   hr_utility.set_location(l_proc,20);
1190   if  (l_api_updating and
1191        (NVL(p_date_start,hr_api.g_eot) <> per_raa_shd.g_old_rec.date_start
1192        or NVL(p_date_end,hr_api.g_eot) <>
1193        NVL(per_raa_shd.g_old_rec.date_end,hr_api.g_eot))
1194       ) or (NOT l_api_updating) then
1195     --  Checks that date_start is not null.
1196     hr_utility.set_location(l_proc,30);
1197     if p_date_start is null then
1198       fnd_message.set_name('PER','PER_289438_RAA_START_DATE_REQ');
1199       hr_multi_message.add
1200       (p_associated_column1 => 'PER_RECRUITMENT_ACTIVITIES.DATE_START'
1201       );
1202     -- Call to raise any errors on multi-message list
1203     hr_multi_message.end_validation_set;
1204     else
1205       --  Checks that date_start is not later then corresponding date_end
1206       hr_utility.set_location(l_proc,40);
1207       if p_date_start > p_date_end then
1208         fnd_message.set_name('PER','HR_6021_ALL_START_END_DATE');
1209         hr_multi_message.add
1210         (p_associated_column1 => 'PER_RECRUITMENT_ACTIVITIES.DATE_START'
1211         ,p_associated_column2 => 'PER_RECRUITMENT_ACTIVITIES.DATE_END'
1212         );
1213       end if;
1214     end if;
1215   end if;
1216   --
1217   hr_utility.set_location(' Leaving:'||l_proc,50);
1218 end chk_dates;
1219 --
1220 -- -----------------------------------------------------------------------------
1221 -- |-----------------------------< chk_type >----------------------------------|
1222 -- -----------------------------------------------------------------------------
1223 --
1224 -- Description:
1225 --   Checks that type is validated against hr_lookups.
1226 --
1227 -- Prerequisites:
1228 --  g_old_rec has been populated with details of the values currently in
1229 --  the database.
1230 --
1231 -- In Arguments:
1232 --   p_type
1233 --   p_effective_date
1234 --   p_recruitment_activity_id
1235 --   p_object_version_number
1236 --
1237 -- Post Success:
1238 --   If type is valid this procedure will
1239 --   end normally and processing will continue.
1240 --
1241 -- Post Failure:
1242 --   If type is invalid then an application error is raised
1243 --   as a PL/SQL exception.
1244 --
1245 -- Access Status:
1246 --   Internal Row Handler Use Only.
1247 --
1248 -- ----------------------------------------------------------------------------
1249 procedure chk_type
1250   (p_type                     in
1251                   per_recruitment_activities.TYPE%TYPE
1252   ,p_effective_date           in
1253                   per_recruitment_activities.DATE_START%TYPE
1254   ,p_recruitment_activity_id  in
1255                   per_recruitment_activities.RECRUITMENT_ACTIVITY_ID%TYPE
1256   ,p_object_version_number    in
1257                   per_recruitment_activities.OBJECT_VERSION_NUMBER%TYPE
1258   ) is
1259 --
1260   l_proc          varchar2(72) := g_package || 'chk_date_end';
1261   l_api_updating  boolean;
1262   l_ret           boolean;
1263 --
1264 begin
1265   hr_utility.set_location('Entering:'||l_proc,10);
1266   --
1267   l_api_updating  :=
1268   per_raa_shd.api_updating(p_recruitment_activity_id,p_object_version_number);
1269   hr_utility.set_location(l_proc,20);
1270   if p_type is not null then
1271     if (l_api_updating and
1272         p_type <> NVL(per_raa_shd.g_old_rec.type,hr_api.g_varchar2))
1273        or (NOT l_api_updating) then
1274 
1275       --  Checks that type is validated against hr_lookups.
1276        hr_utility.set_location(l_proc,30);
1277       l_ret := hr_api.not_exists_in_hr_lookups(
1278                               p_effective_date => p_effective_date
1279                              ,p_lookup_type    => 'REC_TYPE'
1280                              ,p_lookup_code    => p_type);
1281       if l_ret = true then
1282         fnd_message.set_name('PER','PER_289439_RAA_INV_CHECK_TYPE');
1283         fnd_message.raise_error;
1284       end if;
1285     end if;
1286   end if;
1287   --
1288   hr_utility.set_location(' Leaving:'||l_proc,40);
1289   exception
1290    when app_exception.application_exception then
1291      if hr_multi_message.exception_add
1292      (p_associated_column1 =>
1293      'PER_RECRUITMENT_ACTIVITIES.TYPE'
1294      ) then
1295        hr_utility.set_location(' Leaving:'||l_proc,50);
1296        raise;
1297      end if;
1298    hr_utility.set_location(' Leaving:'||l_proc,60);
1299 end chk_type;
1300 --
1301 -- -----------------------------------------------------------------------------
1302 -- |---------------------------< chk_date_closing >----------------------------|
1303 -- -----------------------------------------------------------------------------
1304 --
1305 -- Description:
1306 --   Checks that date_closing is not earlier then corresponding date_start
1307 --
1308 -- Prerequisites:
1309 --  g_old_rec has been populated with details of the values currently in
1310 --  the database.
1311 --
1312 -- In Arguments:
1313 --   p_date_closing
1314 --   p_date_start
1315 --   p_recruitment_activity_id
1316 --   p_object_version_number
1317 --
1318 -- Post Success:
1319 --   If date_closing is valid this procedure will
1320 --   end normally and processing will continue.
1321 --
1322 -- Post Failure:
1323 --   If date_closing is invalid then an application error is raised
1324 --   as a PL/SQL exception.
1325 --
1326 -- Access Status:
1327 --   Internal Row Handler Use Only.
1328 --
1329 -- ----------------------------------------------------------------------------
1330 procedure chk_date_closing
1331   (p_date_closing            in
1332                   per_recruitment_activities.DATE_CLOSING%TYPE
1333   ,p_date_start              in
1334                   per_recruitment_activities.DATE_START%TYPE
1335   ,p_recruitment_activity_id in
1336                   per_recruitment_activities.RECRUITMENT_ACTIVITY_ID%TYPE
1337   ,p_object_version_number   in
1338                   per_recruitment_activities.OBJECT_VERSION_NUMBER%TYPE
1339   ) is
1340 --
1341   l_proc            varchar2(72) := g_package || 'chk_date_closing';
1342   l_api_updating    boolean;
1343 --
1344 begin
1345   hr_utility.set_location('Entering:'||l_proc,10);
1346   --
1347   l_api_updating  :=
1348   per_raa_shd.api_updating(p_recruitment_activity_id,p_object_version_number);
1349   hr_utility.set_location(l_proc,20);
1350   if p_date_closing is not null then
1351     if (l_api_updating and
1352         (NVL(p_date_closing,hr_api.g_eot) <>
1353         NVL(per_raa_shd.g_old_rec.date_closing,hr_api.g_eot)
1354         or p_date_start <> per_raa_shd.g_old_rec.date_start))
1355         or (NOT l_api_updating) then
1356 
1357     --  Checks that date_start is not later then corresponding date_closing
1358       hr_utility.set_location(l_proc,30);
1359       if p_date_start > p_date_closing then
1360         fnd_message.set_name('PER','HR_6114_RAC_CLOSE_DATE');
1361         fnd_message.raise_error;
1362       end if;
1363     end if;
1364   end if;
1365   --
1366   hr_utility.set_location(' Leaving:'||l_proc,40);
1367   exception
1368    when app_exception.application_exception then
1369      if hr_multi_message.exception_add
1370      (p_associated_column1 =>
1371      'PER_RECRUITMENT_ACTIVITIES.DATE_CLOSING'
1372      ) then
1373        hr_utility.set_location(' Leaving:'||l_proc,50);
1374        raise;
1375      end if;
1376    hr_utility.set_location(' Leaving:'||l_proc,60);
1377 end chk_date_closing;
1378 --
1379 -- -----------------------------------------------------------------------------
1380 -- |------------------------------< chk_status >-------------------------------|
1381 -- -----------------------------------------------------------------------------
1382 --
1383 -- Description:
1384 --   Checks that status is validated against hr_lookups.
1385 --
1386 -- Prerequisites:
1387 --  g_old_rec has been populated with details of the values currently in
1388 --  the database.
1389 --
1390 -- In Arguments:
1391 --   p_status
1392 --   p_effective_date
1393 --   p_recruitment_activity_id
1394 --   p_object_version_number
1395 --
1396 -- Post Success:
1397 --   If status is valid this procedure will
1398 --   end normally and processing will continue.
1399 --
1400 -- Post Failure:
1401 --   If status is invalid then an application error is raised
1402 --   as a PL/SQL exception.
1403 --
1404 -- Access Status:
1405 --   Internal Row Handler Use Only.
1406 --
1407 -- ----------------------------------------------------------------------------
1408 procedure chk_status
1409   (p_status                  in
1410                   per_recruitment_activities.STATUS%TYPE
1411   ,p_effective_date          in
1412                   per_recruitment_activities.DATE_START%TYPE
1413   ,p_recruitment_activity_id in
1414                   per_recruitment_activities.RECRUITMENT_ACTIVITY_ID%TYPE
1415   ,p_object_version_number   in
1416                   per_recruitment_activities.OBJECT_VERSION_NUMBER%TYPE
1417   ) is
1418 --
1419   l_proc              varchar2(72) := g_package || 'chk_date_end';
1420   l_status            varchar2(1);
1421   l_api_updating      boolean;
1422   l_ret               boolean;
1423 --
1424 begin
1425   hr_utility.set_location('Entering:'||l_proc,10);
1426   --
1427   l_api_updating  :=
1428   per_raa_shd.api_updating(p_recruitment_activity_id,p_object_version_number);
1429   hr_utility.set_location(l_proc,20);
1430   if p_status  is not null then
1431     if (l_api_updating and
1432         p_status <> NVL(per_raa_shd.g_old_rec.status,hr_api.g_varchar2))
1433         or (NOT l_api_updating) then
1434 
1435     --  Checks that status is validated against hr_lookups.
1436       hr_utility.set_location(l_proc,30);
1437       l_ret := hr_api.not_exists_in_hr_lookups(
1438                                 p_effective_date => p_effective_date
1439                                ,p_lookup_type    => 'REC_STATUS'
1440                                ,p_lookup_code    => p_status);
1441       if l_ret = true then
1442         fnd_message.set_name('PER','PER_289440_RAA_INV_CHECK_STATU');
1443         fnd_message.raise_error;
1444       end if;
1445     end if;
1446   end if;
1447   --
1448   hr_utility.set_location(' Leaving:'||l_proc,40);
1449   exception
1450    when app_exception.application_exception then
1451      if hr_multi_message.exception_add
1452      (p_associated_column1 =>
1453      'PER_RECRUITMENT_ACTIVITIES.STATUS'
1454      ) then
1455        hr_utility.set_location(' Leaving:'||l_proc,50);
1456        raise;
1457      end if;
1458    hr_utility.set_location(' Leaving:'||l_proc,60);
1459 end chk_status;
1460 --
1461 -- -----------------------------------------------------------------------------
1462 -- |--------------------------< chk_actual_cost >------------------------------|
1463 -- -----------------------------------------------------------------------------
1464 --
1465 -- Description:
1466 --   Checks that actual_cost should be greater then zero.
1467 --
1468 -- Prerequisites:
1469 --  g_old_rec has been populated with details of the values currently in
1470 --  the database.
1471 --
1472 -- In Arguments:
1473 --   p_actual_cost
1474 --   p_recruitment_activity_id
1475 --   p_object_version_number
1476 --
1477 -- Post Success:
1478 --   If actual_cost is valid this procedure will
1479 --   end normally and processing will continue.
1480 --
1481 -- Post Failure:
1482 --   If actual_cost is invalid then an application error is raised
1483 --   as a PL/SQL exception.
1484 --
1485 -- Access Status:
1486 --   Internal Row Handler Use Only.
1487 --
1488 -- ----------------------------------------------------------------------------
1489 procedure chk_actual_cost
1490   (p_actual_cost             in
1491                   per_recruitment_activities.ACTUAL_COST%TYPE
1492   ,p_recruitment_activity_id in
1493                   per_recruitment_activities.RECRUITMENT_ACTIVITY_ID%TYPE
1494   ,p_object_version_number   in
1495                   per_recruitment_activities.OBJECT_VERSION_NUMBER%TYPE
1496   ) is
1497 --
1498   l_proc   varchar2(72) := g_package || 'chk_actual_cost';
1499   l_api_updating    boolean;
1500 --
1501 begin
1502   hr_utility.set_location('Entering:'||l_proc,10);
1503   --
1504   l_api_updating  :=
1505   per_raa_shd.api_updating(p_recruitment_activity_id,p_object_version_number);
1506   hr_utility.set_location(l_proc,20);
1507   if p_actual_cost is not null then
1508     if (l_api_updating and
1509         p_actual_cost <>
1510         NVL(per_raa_shd.g_old_rec.actual_cost,hr_api.g_number))
1511        or (NOT l_api_updating) then
1512 
1513     -- Checks that actual_cost is greater then zero
1514       hr_utility.set_location(l_proc,30);
1515       if p_actual_cost < 0  then
1516         fnd_message.set_name( 'PER','PAY_6779_DEF_CURR_UNIT_ZERO');
1517         fnd_message.raise_error;
1518       end if;
1519     end if;
1520   end if;
1521   --
1522   hr_utility.set_location(' Leaving:'||l_proc,40);
1523   exception
1524    when app_exception.application_exception then
1525      if hr_multi_message.exception_add
1526      (p_associated_column1 =>
1527      'PER_RECRUITMENT_ACTIVITIES.ACTUAL_COST'
1528      ) then
1529        hr_utility.set_location(' Leaving:'||l_proc,50);
1530        raise;
1531      end if;
1532    hr_utility.set_location(' Leaving:'||l_proc,60);
1533 --
1534 end chk_actual_cost;
1535 --
1536 -- -----------------------------------------------------------------------------
1537 -- |-------------------------< chk_planned_cost >------------------------------|
1538 -- -----------------------------------------------------------------------------
1539 --
1540 -- Description:
1541 --   Checks that planned_cost should be greater then zero.
1542 --
1543 -- Prerequisites:
1544 --  g_old_rec has been populated with details of the values currently in
1545 --  the database.
1546 --
1547 -- In Arguments:
1548 --   p_planned_cost
1549 --   p_recruitment_activity_id
1550 --   p_object_version_number
1551 --
1552 -- Post Success:
1553 --   If planned_cost is valid this procedure will
1554 --   end normally and processing will continue.
1555 --
1556 -- Post Failure:
1557 --   If planned_cost is invalid then an application error is raised
1558 --   as a PL/SQL exception.
1559 --
1560 -- Access Status:
1561 --   Internal Row Handler Use Only.
1562 --
1563 -- ----------------------------------------------------------------------------
1564 procedure chk_planned_cost
1565   (p_planned_cost            in
1566                   per_recruitment_activities.PLANNED_COST%TYPE
1567   ,p_recruitment_activity_id in
1568                   per_recruitment_activities.RECRUITMENT_ACTIVITY_ID%TYPE
1569   ,p_object_version_number   in
1570                   per_recruitment_activities.OBJECT_VERSION_NUMBER%TYPE
1571   ) is
1572 --
1573   l_proc   varchar2(72) := g_package || 'chk_planned_cost';
1574   l_api_updating    boolean;
1575 --
1576 begin
1577   hr_utility.set_location('Entering:'||l_proc,10);
1578   --
1579   l_api_updating  :=
1580   per_raa_shd.api_updating(p_recruitment_activity_id,p_object_version_number);
1581   hr_utility.set_location(l_proc,20);
1582   if p_planned_cost is not null then
1583     if (l_api_updating and
1584         p_planned_cost <>
1585         NVL(per_raa_shd.g_old_rec.planned_cost,hr_api.g_number))
1586        or (NOT l_api_updating) then
1587 
1588     -- Checks that planned_cost is greater then zero
1589       hr_utility.set_location(l_proc,30);
1590       if p_planned_cost < 0  then
1591         fnd_message.set_name( 'PER','PAY_6779_DEF_CURR_UNIT_ZERO');
1592         fnd_message.raise_error;
1593       end if;
1594     end if;
1595   end if;
1596   --
1597   hr_utility.set_location(' Leaving:'||l_proc,40);
1598   exception
1599    when app_exception.application_exception then
1600      if hr_multi_message.exception_add
1601      (p_associated_column1 =>
1602      'PER_RECRUITMENT_ACTIVITIES.PLANNED_COST'
1603      ) then
1604        hr_utility.set_location(' Leaving:'||l_proc,50);
1605        raise;
1606      end if;
1607    hr_utility.set_location(' Leaving:'||l_proc,60);
1608 --
1609 end chk_planned_cost;
1610 --
1611 -- ----------------------------------------------------------------------------
1612 -- |---------------------------< insert_validate >----------------------------|
1613 -- ----------------------------------------------------------------------------
1614 Procedure insert_validate
1615   (p_rec                          in per_raa_shd.g_rec_type
1616   ) is
1617 --
1618   l_proc  varchar2(72) := g_package||'insert_validate';
1619 --
1620 Begin
1621   hr_utility.set_location('Entering:'||l_proc, 5);
1622   --
1623   -- Validate Important Attributes
1624   --
1625   -- Call all supporting business operations
1626   --
1627   -- Validate Bus Grp
1628   hr_api.validate_bus_grp_id
1629      (p_business_group_id  => p_rec.business_group_id
1630      ,p_associated_column1 => per_raa_shd.g_tab_nam || '.BUSINESS_GROUP_ID'
1631       );
1632   --
1633   -- After validating the set of important attributes,
1634   -- if Mulitple message detection is enabled and at least
1635   -- one error has been found then abort further validation.
1636   --
1637   hr_utility.set_location(l_proc,6);
1638   hr_multi_message.end_validation_set;
1639   --
1640   -- Validate Dependent Attributes
1641   --
1642   hr_utility.set_location(l_proc,10);
1643   per_raa_bus.CHK_NAME(p_name => p_rec.name
1644                     ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1645                     ,p_object_version_number   => p_rec.object_version_number);
1646   --
1647   hr_utility.set_location(l_proc,12);
1648   hr_utility.set_location(l_proc,15);
1649   per_raa_bus.CHK_POSTING_CONTENT_ID(
1650                     p_posting_content_id      => p_rec.posting_content_id
1651                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1652                    ,p_object_version_number   => p_rec.object_version_number);
1653   --
1654   hr_utility.set_location(l_proc,16);
1655   per_raa_bus.CHK_recruiting_site_id(
1656                     p_recruiting_site_id      => p_rec.recruiting_site_id
1657                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1658                    ,p_object_version_number   => p_rec.object_version_number);
1659   --
1660   hr_utility.set_location(l_proc,20);
1661   per_raa_bus.CHK_DATES(
1662                     p_date_start              => p_rec.date_start
1663                    ,p_date_end                => p_rec.date_end
1664                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1665                    ,p_object_version_number   => p_rec.object_version_number);
1666   --
1667   hr_utility.set_location(l_proc,25);
1668   per_raa_bus.CHK_TYPE(
1669                     p_type                    => p_rec.type
1670                    ,p_effective_date          => p_rec.date_start
1671                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1672                    ,p_object_version_number   => p_rec.object_version_number);
1673   --
1674   hr_utility.set_location(l_proc,40);
1675   per_raa_bus.CHK_DATE_CLOSING(
1676                     p_date_closing            => p_rec.date_closing
1677                    ,p_date_start              => p_rec.date_start
1678                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1679                    ,p_object_version_number   => p_rec.object_version_number);
1680   --
1681   hr_utility.set_location(l_proc,45);
1682   per_raa_bus.CHK_STATUS(
1683                     p_status                  => p_rec.status
1684                    ,p_effective_date          => p_rec.date_start
1685                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1686                    ,p_object_version_number   => p_rec.object_version_number);
1687   --
1688   hr_utility.set_location(l_proc,50);
1689   per_raa_bus.CHK_AUTHORISING_PERSON_ID(
1690                     p_authorising_person_id   => p_rec.authorising_person_id
1691                    ,p_date_start              => p_rec.date_start
1692                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1693                    ,p_object_version_number   => p_rec.object_version_number);
1694   --
1695   hr_utility.set_location(l_proc,55);
1696   per_raa_bus.CHK_RUN_BY_ORGANIZATION_ID(
1697                     p_run_by_organization_id  => p_rec.run_by_organization_id
1698                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1699                    ,p_object_version_number   => p_rec.object_version_number);
1700   --
1701   hr_utility.set_location(l_proc,60);
1702   per_raa_bus.CHK_INTERNAL_CONTACT_PERSON_ID(
1703                     p_internal_contact_person_id =>
1704                                                p_rec.internal_contact_person_id
1705                    ,p_date_start              => p_rec.date_start
1706                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1707                    ,p_object_version_number   => p_rec.object_version_number);
1708   --
1709   hr_utility.set_location(l_proc,65);
1710   per_raa_bus.CHK_PARENT_RECRUITMENT_ACTIVIT(
1711                     p_parent_recruitment_activity
1712                                          => p_rec.parent_recruitment_activity_id
1713                    ,p_date_start              => p_rec.date_start
1714                    ,p_business_group_id       => p_rec.business_group_id
1715                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1716                    ,p_object_version_number   => p_rec.object_version_number);
1717   --
1718   hr_utility.set_location(l_proc,70);
1719   per_raa_bus.CHK_CURRENCY_CODE(
1720                     p_currency_code           => p_rec.currency_code
1721                    ,p_date_start              => p_rec.date_start
1722                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1723                    ,p_object_version_number   => p_rec.object_version_number);
1724   --
1725   hr_utility.set_location(l_proc,75);
1726   per_raa_bus.CHK_ACTUAL_COST(
1727                     p_actual_cost             => p_rec.actual_cost
1728                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1729                    ,p_object_version_number   => p_rec.object_version_number);
1730   --
1731   hr_utility.set_location(l_proc,80);
1732   per_raa_bus.CHK_PLANNED_COST(
1733                     p_planned_cost            => p_rec.planned_cost
1734                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1735                    ,p_object_version_number   => p_rec.object_version_number);
1736   --
1737   hr_utility.set_location(l_proc,85);
1738   per_raa_bus.chk_df(p_rec => p_rec);
1739   --
1740   hr_utility.set_location(' Leaving:'||l_proc, 90);
1741 End insert_validate;
1742 --
1743 -- ----------------------------------------------------------------------------
1744 -- |---------------------------< update_validate >----------------------------|
1745 -- ----------------------------------------------------------------------------
1746 Procedure update_validate
1747   (p_rec                          in per_raa_shd.g_rec_type
1748   ) is
1749 --
1750   l_proc  varchar2(72) := g_package||'update_validate';
1751 --
1752 Begin
1753   hr_utility.set_location('Entering:'||l_proc, 5);
1754     --
1755   -- Validate Important Attributes
1756   --
1757   -- Call all supporting business operations
1758   --
1759   -- Validate Bus Grp
1760   hr_api.validate_bus_grp_id(
1761       p_business_group_id  => p_rec.business_group_id
1762      ,p_associated_column1 => per_raa_shd.g_tab_nam || '.BUSINESS_GROUP_ID'
1763       );
1764   --
1765   -- After validating the set of important attributes,
1766   -- if Mulitple message detection is enabled and at least
1767   -- one error has been found then abort further validation.
1768   --
1769   hr_utility.set_location(l_proc,6);
1770   hr_multi_message.end_validation_set;
1771   --
1772   -- Validate Dependent Attributes
1773   --
1774   hr_utility.set_location(l_proc,7);
1775   chk_non_updateable_args
1776     (p_rec              => p_rec
1777     );
1778   --
1779   hr_utility.set_location(l_proc,10);
1780   per_raa_bus.CHK_NAME(p_name => p_rec.name
1781                     ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1782                     ,p_object_version_number   => p_rec.object_version_number);
1783   --
1784   hr_utility.set_location(l_proc,12);
1785   --
1786   hr_utility.set_location(l_proc,15);
1787   per_raa_bus.CHK_POSTING_CONTENT_ID(
1788                     p_posting_content_id      => p_rec.posting_content_id
1789                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1790                    ,p_object_version_number   => p_rec.object_version_number);
1791   --
1792   hr_utility.set_location(l_proc,16);
1793   per_raa_bus.CHK_recruiting_site_id(
1794                     p_recruiting_site_id      => p_rec.recruiting_site_id
1795                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1796                    ,p_object_version_number   => p_rec.object_version_number);
1797   hr_utility.set_location(l_proc,20);
1798   per_raa_bus.CHK_DATES(
1799                     p_date_start              => p_rec.date_start
1800                    ,p_date_end                => p_rec.date_end
1801                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1802                    ,p_object_version_number   => p_rec.object_version_number);
1803   --
1804   hr_utility.set_location(l_proc,25);
1805   per_raa_bus.CHK_TYPE(
1806                     p_type                    => p_rec.type
1807                    ,p_effective_date          => p_rec.date_start
1808                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1809                    ,p_object_version_number   => p_rec.object_version_number);
1810   --
1811   hr_utility.set_location(l_proc,40);
1812   per_raa_bus.CHK_DATE_CLOSING(
1813                     p_date_closing            => p_rec.date_closing
1814                    ,p_date_start              => p_rec.date_start
1815                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1816                    ,p_object_version_number   => p_rec.object_version_number);
1817   --
1818   hr_utility.set_location(l_proc,45);
1819   per_raa_bus.CHK_STATUS(
1820                     p_status                  => p_rec.status
1821                    ,p_effective_date          => p_rec.date_start
1822                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1823                    ,p_object_version_number   => p_rec.object_version_number);
1824   --
1825   hr_utility.set_location(l_proc,50);
1826   per_raa_bus.CHK_AUTHORISING_PERSON_ID(
1827                     p_authorising_person_id   => p_rec.authorising_person_id
1828                    ,p_date_start              => p_rec.date_start
1829                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1830                    ,p_object_version_number   => p_rec.object_version_number);
1831   --
1832   hr_utility.set_location(l_proc,55);
1833   per_raa_bus.CHK_RUN_BY_ORGANIZATION_ID(
1834                     p_run_by_organization_id  => p_rec.run_by_organization_id
1835                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1836                    ,p_object_version_number   => p_rec.object_version_number);
1837   --
1838   hr_utility.set_location(l_proc,60);
1839   per_raa_bus.CHK_INTERNAL_CONTACT_PERSON_ID(
1840                     p_internal_contact_person_id =>
1841                                                p_rec.internal_contact_person_id
1842                    ,p_date_start              => p_rec.date_start
1843                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1844                    ,p_object_version_number   => p_rec.object_version_number);
1845   --
1846   hr_utility.set_location(l_proc,65);
1847   per_raa_bus.CHK_PARENT_RECRUITMENT_ACTIVIT(
1848                     p_parent_recruitment_activity
1849                                               =>
1850                                             p_rec.parent_recruitment_activity_id
1851                    ,p_date_start              => p_rec.date_start
1852                    ,p_business_group_id       =>
1853                                          per_raa_shd.g_old_rec.business_group_id
1854                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1855                    ,p_object_version_number   => p_rec.object_version_number);
1856   --
1857   hr_utility.set_location(l_proc,70);
1858   per_raa_bus.CHK_CURRENCY_CODE(
1859                     p_currency_code           => p_rec.currency_code
1860                    ,p_date_start              => p_rec.date_start
1861                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1862                    ,p_object_version_number   => p_rec.object_version_number);
1863   --
1864   hr_utility.set_location(l_proc,75);
1865   per_raa_bus.CHK_ACTUAL_COST(
1866                     p_actual_cost             => p_rec.actual_cost
1867                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1868                    ,p_object_version_number   => p_rec.object_version_number);
1869   --
1870   hr_utility.set_location(l_proc,80);
1871   per_raa_bus.CHK_PLANNED_COST(
1872                     p_planned_cost            => p_rec.planned_cost
1873                    ,p_recruitment_activity_id => p_rec.recruitment_activity_id
1874                    ,p_object_version_number   => p_rec.object_version_number);
1875   --
1876   hr_utility.set_location(l_proc,85);
1877   per_raa_bus.chk_df(p_rec => p_rec);
1878   --
1879   hr_utility.set_location(' Leaving:'||l_proc, 90);
1880 End update_validate;
1881 --
1882 -- ----------------------------------------------------------------------------
1883 -- |---------------------------< delete_validate >----------------------------|
1884 -- ----------------------------------------------------------------------------
1885 Procedure delete_validate
1886   (p_rec                          in per_raa_shd.g_rec_type
1887   ) is
1888 --
1889   l_proc  varchar2(72) := g_package||'delete_validate';
1890 --
1891 Begin
1892   hr_utility.set_location('Entering:'||l_proc, 5);
1893   --
1894   -- Call all supporting business operations
1895   --
1896   hr_utility.set_location(' Leaving:'||l_proc, 10);
1897 End delete_validate;
1898 --
1899 end per_raa_bus;