DBA Data[Home] [Help]

PACKAGE BODY: APPS.PE_PEI_BUS

Source


1 Package Body pe_pei_bus as
2 /* $Header: pepeirhi.pkb 120.1 2005/07/25 05:01:42 jpthomas noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pe_pei_bus.';  -- Global package name
9 --
10 -- The following two global variables are only to be used by the
11 -- return_legislation_code function.
12 --
13 g_person_extra_info_id number        default null;
14 g_legislation_code     varchar2(150) default null;
15 --
16 --  ---------------------------------------------------------------------------
17 --  |---------------------< return_legislation_code >-------------------------|
18 --  ---------------------------------------------------------------------------
19 --
20 function return_legislation_code
21   (p_person_extra_info_id in number
22   ) return varchar2 is
23   --
24   -- Declare cursor
25   --
26   cursor csr_leg_code is
27     select pbg.legislation_code
28       from per_business_groups   pbg
29           ,per_people_extra_info pei
30           ,per_all_people_f      per
31      where pei.person_extra_info_id = p_person_extra_info_id
32        and per.person_id            = pei.person_id
33        and pbg.business_group_id    = per.business_group_id;
34   --
35   -- Declare local variables
36   --
37   l_legislation_code  varchar2(150);
38   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
39 begin
40   hr_utility.set_location('Entering:'|| l_proc, 10);
41   --
42   -- Ensure that all the mandatory parameters are not null
43   --
44   hr_api.mandatory_arg_error
45     (p_api_name       => l_proc
46     ,p_argument       => 'person_extra_info_id'
47     ,p_argument_value => p_person_extra_info_id);
48   --
49   if nvl(g_person_extra_info_id, hr_api.g_number) = p_person_extra_info_id then
50     --
51     -- The legislation code has already been found with a previous
52     -- call to this function. Just return the value in the global
53     -- variable.
54     --
55     l_legislation_code := g_legislation_code;
56     hr_utility.set_location(l_proc, 20);
57   else
58     --
59     -- The ID is different to the last call to this function
60     -- or this is the first call to this function.
61     --
62     open csr_leg_code;
63     fetch csr_leg_code into l_legislation_code;
64     if csr_leg_code%notfound then
65       close csr_leg_code;
66       --
67       -- The primary key is invalid therefore we must error
68       --
69       hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
70       hr_utility.raise_error;
71     end if;
72     --
73     close csr_leg_code;
74     hr_utility.set_location(' Leaving:'|| l_proc, 20);
75     --
76     g_person_extra_info_id := p_person_extra_info_id;
77     g_legislation_code     := l_legislation_code;
78   end if;
79   --
80   hr_utility.set_location(' Leaving:'|| l_proc, 25);
81   --
82   return l_legislation_code;
83 end return_legislation_code;
84 --
85 -- ----------------------------------------------------------------------------
86 -- |-----------------------< chk_non_updateable_args >------------------------|
87 -- ----------------------------------------------------------------------------
88 -- {Start Of Comments}
89 --
90 -- Description:
91 --   Verify that the non updateable arguments not changed.
92 --   For the PERSON_EXTRA_INFO table neither of the FK's can be updated
93 --   i.e. PERSON_ID and INFORMATION_TYPE
94 --
95 -- Pre Conditions:
96 --   None
97 --
98 -- In Parameters:
99 --   p_rec
100 --
101 -- Post Success:
102 --   Processing continues.
103 --
104 -- Post Failure:
105 --   An application error will be raised and processing is terminated.
106 --
107 -- Developer Implementation Notes:
108 --   None
109 --
110 -- Access Status:
111 --   Internal Row Handler Use Only.
112 --
113 -- {End Of Comments}
114 -- ----------------------------------------------------------------------------
115 --
116 Procedure chk_non_updateable_args(p_rec in pe_pei_shd.g_rec_type) is
117 --
118   l_proc        varchar2(72) := g_package||'chk_non_updateable_args';
119   l_error       exception;
120   l_argument    varchar2(30);
121 --
122 Begin
123   --
124   hr_utility.set_location('Entering:'|| l_proc,10);
125   --
126   -- Only proceed with validation if a row exists for
127   -- the current record in the HR Schema.
128   if not pe_pei_shd.api_updating
129    (p_person_extra_info_id  => p_rec.person_extra_info_id
130    ,p_object_version_number => p_rec.object_version_number
131    ) then
132     hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
133     hr_utility.set_message_token('PROCEDURE', l_proc);
134     hr_utility.set_message_token('STEP', '20');
135   end if;
136   --
137   hr_utility.set_location (l_proc, 30);
138   --
139   if nvl(p_rec.person_id,hr_api.g_number)
140         <> nvl(pe_pei_shd.g_old_rec.person_id,hr_api.g_number) then
141      l_argument := 'person_id';
142      raise l_error;
143   end if;
144   --
145   if nvl(p_rec.information_type,hr_api.g_varchar2)
146         <> nvl(pe_pei_shd.g_old_rec.information_type,hr_api.g_varchar2) then
147      l_argument := 'information_type';
148      raise l_error;
149   end if;
150   --
151   hr_utility.set_location(' Leaving : '|| l_proc, 40);
152   --
153   exception
154     when l_error then
155        hr_api.argument_changed_error
156          (p_api_name => l_proc
157          ,p_argument => l_argument);
158     when others then
159        raise;
160 end chk_non_updateable_args;
161 --
162 --  ---------------------------------------------------------------------------
163 --  |------------------------------< chk_person_id >---------------------------|
164 --  ---------------------------------------------------------------------------
165 --
166 --  Desciption:
167 --    This procedures validates that the person id exists on the PER_PERSON_F
168 --    table. Note: It does not check if they exists at a given time such as
169 --    p_effective_date
170 --
171 --  Pre-conditions :
172 --    None
173 --
174 --  In Parameters :
175 --    p_person_id
176 --
177 --  Post Success :
178 --    Processing continues if the person id is valid
179 --
180 --  Post Failure :
181 --    An application error will be raised and processing is terminated if the
182 --    person id is invalid
183 --
184 --  Access Status :
185 --    Internal Row Handler Use only.
186 --
187 -- {End of Comments}
188 --
189 -- ---------------------------------------------------------------------------
190 procedure chk_person_id
191   (p_person_id    in  per_people_extra_info.person_id%TYPE
192   --  ,p_effective_date  in  date
193     )	is
194   --
195   l_proc         varchar2(72) := g_package||'chk_person_id';
196   l_person_found boolean := false;
197   --
198   cursor csr_person_id is
199     SELECT 1
200     FROM   per_all_people_f per                    -- Bug 4508101
201     WHERE  per.person_id = p_person_id;
202 --
203 begin
204   hr_utility.set_location('Entering:'||l_proc, 10);
205   --
206   -- Check mandatory parameters have been set
207   --
208   hr_api.mandatory_arg_error
209     (
210      p_api_name         => l_proc,
211      p_argument         => 'person_id',
212      p_argument_value   => p_person_id
213     );
214   --
215   hr_utility.set_location(l_proc, 20);
216   --
217   -- Now check to see if the person exists
218   --
219   for csr_person_id_rec in csr_person_id loop
220     --
221     hr_utility.set_location(l_proc, 30);
222     --
223     l_person_found := true;
224     exit;
225   end loop;
226   --
227   hr_utility.set_location(l_proc, 40);
228   --
229   if not l_person_found then
230     --
231     hr_utility.set_location(l_proc, 50);
232     --
233     hr_utility.set_message(800, 'HR_INV_PERSON');
234     hr_utility.raise_error;
235   end if;
236   --
237   hr_utility.set_location(' Leaving:'||l_proc, 60);
238   --
239 end chk_person_id;
240 --
241 -- ----------------------------------------------------------------------------
242 -- |-------------------------< chk_information_type >--------------------------|
243 -- ----------------------------------------------------------------------------
244 --
245 --  Desciption:
246 --    This procedures validates that the information type is active on the
247 --    PER_PEOPLE_INFO_TYPE table
248 --
249 --  Pre-conditions :
250 --    p_person_id is valid
251 --
252 --  In Parameters :
253 --    p_information_type
254 --    p_person_id
255 --
256 --  Post Success :
257 --    Processing continues if the information type is active. It will also
258 --    continue if the information type does not allow multiple occurrences and
259 --    there doesn't a record for the given information type and person.
260 --
261 --  Post Failure :
262 --    An application error will be raised and processing is terminated if the
263 --    information type is not active.
264 --    An application error will also be raised and processing is terminated if
265 --    the information type doe not allow multiple occurrences and there already
266 --    exists a record for that information type and person.
267 --
268 --  Access Status :
269 --    Internal Row Handler Use only.
270 --
271 -- {End of Comments}
272 --
273 -- ---------------------------------------------------------------------------
274 Procedure chk_information_type
275  (p_information_type in  per_people_extra_info.information_type%TYPE
276  ,p_person_id        in  per_people_extra_info.person_id%TYPE) is
277   --
278   -- Declare local variables
279   --
280   l_proc                   varchar2(72) := g_package||'chk_information_type';
281   --
282   CURSOR csr_info_type IS
283     SELECT pit.multiple_occurences_flag
284           ,pit.active_inactive_flag
285     FROM   per_people_info_types  pit
286     WHERE  pit.information_type = p_information_type;
287   --
288   CURSOR csr_extra_info IS
289     SELECT 1
290     FROM   per_people_extra_info pei
291     WHERE  pei.information_type = p_information_type
292     AND    pei.person_id        = p_person_id ;
293 --
294 Begin
295   hr_utility.set_location('Entering:'||l_proc, 5);
296   --
297   -- Check mandatory parameters have been set
298   --
299   hr_api.mandatory_arg_error
300     (
301      p_api_name         => l_proc,
302      p_argument         => 'information_type',
303      p_argument_value   => p_information_type
304     );
305   --
306   hr_utility.set_location(l_proc, 7);
307   --
308   for csr_info_type_rec in csr_info_type loop
309     --
310     hr_utility.set_location(l_proc, 10);
311     --
312     -- We would only come here if the information type was valid if it is not
313     -- valid then we do not want to do the following checks. We will leave the FK
314     -- to be checked by the constraint PER_PEOPLE_EXTRA_INFO_FK1 at DML time
315     -- Also leave the check it is mandatory to the database
316     --
317     -- Check to see the info type is still active
318     --
319     if csr_info_type_rec.active_inactive_flag = 'N' then
320       --
321       hr_utility.set_location(l_proc, 15);
322       --
323       hr_utility.set_message(800, 'HR_INACTIVE_INFO_TYPE');
324       hr_utility.raise_error;
325     end if;
326     --
327     -- If multiple ocurrences flag says N(o) then there is not allowed to be a
328     -- record already on the EXTRA_INFO table
329     --
330     hr_utility.set_location(l_proc, 20);
331     --
332     if csr_info_type_rec.multiple_occurences_flag = 'N' THEN
333       --
334       hr_utility.set_location(l_proc, 25);
335       --
336       for csr_extra_info_rec in csr_extra_info loop
337         --
338         hr_utility.set_location(l_proc, 30);
339         --
340         -- If we are here the multiple ocurrences flag is N and there
341         -- already exists a record on the EXTRA_INFO table for the given
342         -- person and info type
343         --
344         -- Fix for WWBUG 1621849. Provide a better error message.
345         --
346         if p_information_type = 'PER_US_ADDITIONAL_DETAILS' then
347           --
348           fnd_message.set_name('PER','HR_289377_VISA_ADD_DETAILS');
349           fnd_message.raise_error;
350           --
351         end if;
352         --
353         -- Otherwise let the generic message be raised.
354         --
355         hr_utility.set_message(800, 'HR_PEI_MORE_THAN_1_RECORD');
356         hr_utility.raise_error;
357         --
358       end loop;
359       --
360     end if;
361     --
362   end loop;
363   --
364   hr_utility.set_location(' Leaving:'||l_proc, 10);
365   --
366 End chk_information_type;
367 --
368 -- -----------------------------------------------------------------------
369 -- |------------------------------< chk_df >-----------------------------|
370 -- -----------------------------------------------------------------------
371 --
372 -- Description:
373 --   Validates the all Descriptive Flexfield values.
374 --
375 -- Pre-conditions:
376 --   All other columns have been validated. Must be called as the
377 --   last step from insert_validate and update_validate.
378 --
379 -- In Arguments:
380 --   p_rec
381 --
382 -- Post Success:
383 --   If the Descriptive Flexfield structure column and data values are
384 --   all valid this procedure will end normally and processing will
385 --   continue.
386 --
387 -- Post Failure:
388 --   If the Descriptive Flexfield structure column value or any of
389 --   the data values are invalid then an application error is raised as
390 --   a PL/SQL exception.
391 --
392 -- Access Status:
393 --   Internal Row Handler Use Only.
394 --
395 procedure chk_df
396   (p_rec in pe_pei_shd.g_rec_type) is
397 --
398   l_proc    varchar2(72) := g_package||'chk_df';
399 --
400 begin
401   hr_utility.set_location('Entering:'||l_proc, 10);
402   --
403   if ((p_rec.person_extra_info_id is not null) and (
404      nvl(pe_pei_shd.g_old_rec.pei_attribute_category, hr_api.g_varchar2) <>
405      nvl(p_rec.pei_attribute_category, hr_api.g_varchar2) or
406      nvl(pe_pei_shd.g_old_rec.pei_attribute1, hr_api.g_varchar2) <>
407      nvl(p_rec.pei_attribute1, hr_api.g_varchar2) or
408      nvl(pe_pei_shd.g_old_rec.pei_attribute2, hr_api.g_varchar2) <>
409      nvl(p_rec.pei_attribute2, hr_api.g_varchar2) or
410      nvl(pe_pei_shd.g_old_rec.pei_attribute3, hr_api.g_varchar2) <>
411      nvl(p_rec.pei_attribute3, hr_api.g_varchar2) or
412      nvl(pe_pei_shd.g_old_rec.pei_attribute4, hr_api.g_varchar2) <>
413      nvl(p_rec.pei_attribute4, hr_api.g_varchar2) or
414      nvl(pe_pei_shd.g_old_rec.pei_attribute5, hr_api.g_varchar2) <>
415      nvl(p_rec.pei_attribute5, hr_api.g_varchar2) or
416      nvl(pe_pei_shd.g_old_rec.pei_attribute6, hr_api.g_varchar2) <>
417      nvl(p_rec.pei_attribute6, hr_api.g_varchar2) or
418      nvl(pe_pei_shd.g_old_rec.pei_attribute7, hr_api.g_varchar2) <>
419      nvl(p_rec.pei_attribute7, hr_api.g_varchar2) or
420      nvl(pe_pei_shd.g_old_rec.pei_attribute8, hr_api.g_varchar2) <>
421      nvl(p_rec.pei_attribute8, hr_api.g_varchar2) or
422      nvl(pe_pei_shd.g_old_rec.pei_attribute9, hr_api.g_varchar2) <>
423      nvl(p_rec.pei_attribute9, hr_api.g_varchar2) or
424      nvl(pe_pei_shd.g_old_rec.pei_attribute10, hr_api.g_varchar2) <>
425      nvl(p_rec.pei_attribute10, hr_api.g_varchar2) or
426      nvl(pe_pei_shd.g_old_rec.pei_attribute11, hr_api.g_varchar2) <>
427      nvl(p_rec.pei_attribute11, hr_api.g_varchar2) or
428      nvl(pe_pei_shd.g_old_rec.pei_attribute12, hr_api.g_varchar2) <>
429      nvl(p_rec.pei_attribute12, hr_api.g_varchar2) or
430      nvl(pe_pei_shd.g_old_rec.pei_attribute13, hr_api.g_varchar2) <>
431      nvl(p_rec.pei_attribute13, hr_api.g_varchar2) or
432      nvl(pe_pei_shd.g_old_rec.pei_attribute14, hr_api.g_varchar2) <>
433      nvl(p_rec.pei_attribute14, hr_api.g_varchar2) or
434      nvl(pe_pei_shd.g_old_rec.pei_attribute15, hr_api.g_varchar2) <>
435      nvl(p_rec.pei_attribute15, hr_api.g_varchar2) or
436      nvl(pe_pei_shd.g_old_rec.pei_attribute16, hr_api.g_varchar2) <>
437      nvl(p_rec.pei_attribute16, hr_api.g_varchar2) or
438      nvl(pe_pei_shd.g_old_rec.pei_attribute17, hr_api.g_varchar2) <>
439      nvl(p_rec.pei_attribute17, hr_api.g_varchar2) or
440      nvl(pe_pei_shd.g_old_rec.pei_attribute18, hr_api.g_varchar2) <>
441      nvl(p_rec.pei_attribute18, hr_api.g_varchar2) or
442      nvl(pe_pei_shd.g_old_rec.pei_attribute19, hr_api.g_varchar2) <>
443      nvl(p_rec.pei_attribute19, hr_api.g_varchar2) or
444      nvl(pe_pei_shd.g_old_rec.pei_attribute20, hr_api.g_varchar2) <>
445      nvl(p_rec.pei_attribute20, hr_api.g_varchar2)))
446      or
447      (p_rec.person_extra_info_id is null) then
448     --
449     -- Only execute the validation if absolutely necessary:
450     -- a) During update, the structure column value or any
451     --    of the attribute values have actually changed.
452     -- b) During insert.
453     --
454     hr_dflex_utility.ins_or_upd_descflex_attribs
455       (p_appl_short_name    => 'PER'
456       ,p_descflex_name      => 'PER_PEOPLE_EXTRA_INFO'
457       ,p_attribute_category => p_rec.pei_attribute_category
458       ,p_attribute1_name    => 'PEI_ATTRIBUTE1'
459       ,p_attribute1_value   => p_rec.pei_attribute1
460       ,p_attribute2_name    => 'PEI_ATTRIBUTE2'
461       ,p_attribute2_value   => p_rec.pei_attribute2
462       ,p_attribute3_name    => 'PEI_ATTRIBUTE3'
463       ,p_attribute3_value   => p_rec.pei_attribute3
464       ,p_attribute4_name    => 'PEI_ATTRIBUTE4'
465       ,p_attribute4_value   => p_rec.pei_attribute4
466       ,p_attribute5_name    => 'PEI_ATTRIBUTE5'
467       ,p_attribute5_value   => p_rec.pei_attribute5
468       ,p_attribute6_name    => 'PEI_ATTRIBUTE6'
469       ,p_attribute6_value   => p_rec.pei_attribute6
470       ,p_attribute7_name    => 'PEI_ATTRIBUTE7'
471       ,p_attribute7_value   => p_rec.pei_attribute7
472       ,p_attribute8_name    => 'PEI_ATTRIBUTE8'
473       ,p_attribute8_value   => p_rec.pei_attribute8
474       ,p_attribute9_name    => 'PEI_ATTRIBUTE9'
475       ,p_attribute9_value   => p_rec.pei_attribute9
476       ,p_attribute10_name   => 'PEI_ATTRIBUTE10'
477       ,p_attribute10_value  => p_rec.pei_attribute10
478       ,p_attribute11_name   => 'PEI_ATTRIBUTE11'
479       ,p_attribute11_value  => p_rec.pei_attribute11
480       ,p_attribute12_name   => 'PEI_ATTRIBUTE12'
481       ,p_attribute12_value  => p_rec.pei_attribute12
482       ,p_attribute13_name   => 'PEI_ATTRIBUTE13'
483       ,p_attribute13_value  => p_rec.pei_attribute13
484       ,p_attribute14_name   => 'PEI_ATTRIBUTE14'
485       ,p_attribute14_value  => p_rec.pei_attribute14
486       ,p_attribute15_name   => 'PEI_ATTRIBUTE15'
487       ,p_attribute15_value  => p_rec.pei_attribute15
488       ,p_attribute16_name   => 'PEI_ATTRIBUTE16'
489       ,p_attribute16_value  => p_rec.pei_attribute16
490       ,p_attribute17_name   => 'PEI_ATTRIBUTE17'
491       ,p_attribute17_value  => p_rec.pei_attribute17
492       ,p_attribute18_name   => 'PEI_ATTRIBUTE18'
493       ,p_attribute18_value  => p_rec.pei_attribute18
494       ,p_attribute19_name   => 'PEI_ATTRIBUTE19'
495       ,p_attribute19_value  => p_rec.pei_attribute19
496       ,p_attribute20_name   => 'PEI_ATTRIBUTE20'
497       ,p_attribute20_value  => p_rec.pei_attribute20);
498   end if;
499   --
500   hr_utility.set_location(' Leaving:'||l_proc, 20);
501 end chk_df;
502 --
503 -- -----------------------------------------------------------------------
504 -- |------------------------------< chk_ddf >----------------------------|
505 -- -----------------------------------------------------------------------
506 --
507 -- Description:
508 --   Validates the all Developer Descriptive Flexfield values.
509 --
510 -- Pre-conditions:
511 --   All other columns have been validated. Must be called as the
512 --   second last step from insert_validate and update_validate.
513 --   Before any Descriptive Flexfield (chk_df) calls.
514 --
515 -- In Arguments:
516 --   p_rec
517 --
518 -- Post Success:
519 --   If the Developer Descriptive Flexfield structure column and data
520 --   values are all valid this procedure will end normally and
521 --   processing will continue.
522 --
523 -- Post Failure:
524 --   If the DDF structure column value or any of the data values
525 --   are invalid then an application error is raised as
526 --   a PL/SQL exception.
527 --
528 -- Access Status:
529 --   Internal Row Handler Use Only.
530 --
531 -- {End Of Comments}
532 -- ----------------------------------------------------------------------------
533 --
534 procedure chk_ddf
535   (p_rec in pe_pei_shd.g_rec_type) is
536 --
537   l_proc       varchar2(72) := g_package||'chk_ddf';
538   l_error      exception;
539 --
540 Begin
541   hr_utility.set_location('Entering:'||l_proc, 5);
542   --
543   -- Check if the row is being inserted or updated and a
544   -- value has changed
545   --
546   if (p_rec.person_extra_info_id is null)
547     or ((p_rec.person_extra_info_id is not null)
548     and
549     nvl(pe_pei_shd.g_old_rec.pei_attribute_category, hr_api.g_varchar2) <>
550     nvl(p_rec.pei_information_category, hr_api.g_varchar2) or
551     nvl(pe_pei_shd.g_old_rec.pei_information1, hr_api.g_varchar2) <>
552     nvl(p_rec.pei_information1, hr_api.g_varchar2) or
553     nvl(pe_pei_shd.g_old_rec.pei_information2, hr_api.g_varchar2) <>
554     nvl(p_rec.pei_information2, hr_api.g_varchar2) or
555     nvl(pe_pei_shd.g_old_rec.pei_information3, hr_api.g_varchar2) <>
556     nvl(p_rec.pei_information3, hr_api.g_varchar2) or
557     nvl(pe_pei_shd.g_old_rec.pei_information4, hr_api.g_varchar2) <>
558     nvl(p_rec.pei_information4, hr_api.g_varchar2) or
559     nvl(pe_pei_shd.g_old_rec.pei_information5, hr_api.g_varchar2) <>
560     nvl(p_rec.pei_information5, hr_api.g_varchar2) or
561     nvl(pe_pei_shd.g_old_rec.pei_information6, hr_api.g_varchar2) <>
562     nvl(p_rec.pei_information6, hr_api.g_varchar2) or
563     nvl(pe_pei_shd.g_old_rec.pei_information7, hr_api.g_varchar2) <>
564     nvl(p_rec.pei_information7, hr_api.g_varchar2) or
565     nvl(pe_pei_shd.g_old_rec.pei_information8, hr_api.g_varchar2) <>
566     nvl(p_rec.pei_information8, hr_api.g_varchar2) or
567     nvl(pe_pei_shd.g_old_rec.pei_information9, hr_api.g_varchar2) <>
568     nvl(p_rec.pei_information9, hr_api.g_varchar2) or
569     nvl(pe_pei_shd.g_old_rec.pei_information10, hr_api.g_varchar2) <>
570     nvl(p_rec.pei_information10, hr_api.g_varchar2) or
571     nvl(pe_pei_shd.g_old_rec.pei_information11, hr_api.g_varchar2) <>
572     nvl(p_rec.pei_information11, hr_api.g_varchar2) or
573     nvl(pe_pei_shd.g_old_rec.pei_information12, hr_api.g_varchar2) <>
574     nvl(p_rec.pei_information12, hr_api.g_varchar2) or
575     nvl(pe_pei_shd.g_old_rec.pei_information13, hr_api.g_varchar2) <>
576     nvl(p_rec.pei_information13, hr_api.g_varchar2) or
577     nvl(pe_pei_shd.g_old_rec.pei_information14, hr_api.g_varchar2) <>
578     nvl(p_rec.pei_information14, hr_api.g_varchar2) or
579     nvl(pe_pei_shd.g_old_rec.pei_information15, hr_api.g_varchar2) <>
580     nvl(p_rec.pei_information15, hr_api.g_varchar2) or
581     nvl(pe_pei_shd.g_old_rec.pei_information16, hr_api.g_varchar2) <>
582     nvl(p_rec.pei_information16, hr_api.g_varchar2) or
583     nvl(pe_pei_shd.g_old_rec.pei_information17, hr_api.g_varchar2) <>
584     nvl(p_rec.pei_information17, hr_api.g_varchar2) or
585     nvl(pe_pei_shd.g_old_rec.pei_information18, hr_api.g_varchar2) <>
586     nvl(p_rec.pei_information18, hr_api.g_varchar2) or
587     nvl(pe_pei_shd.g_old_rec.pei_information19, hr_api.g_varchar2) <>
588     nvl(p_rec.pei_information19, hr_api.g_varchar2) or
589     nvl(pe_pei_shd.g_old_rec.pei_information20, hr_api.g_varchar2) <>
590     nvl(p_rec.pei_information20, hr_api.g_varchar2) or
591     nvl(pe_pei_shd.g_old_rec.pei_information21, hr_api.g_varchar2) <>
592     nvl(p_rec.pei_information21, hr_api.g_varchar2) or
593     nvl(pe_pei_shd.g_old_rec.pei_information22, hr_api.g_varchar2) <>
594     nvl(p_rec.pei_information22, hr_api.g_varchar2) or
595     nvl(pe_pei_shd.g_old_rec.pei_information23, hr_api.g_varchar2) <>
596     nvl(p_rec.pei_information23, hr_api.g_varchar2) or
597     nvl(pe_pei_shd.g_old_rec.pei_information24, hr_api.g_varchar2) <>
598     nvl(p_rec.pei_information24, hr_api.g_varchar2) or
599     nvl(pe_pei_shd.g_old_rec.pei_information25, hr_api.g_varchar2) <>
600     nvl(p_rec.pei_information25, hr_api.g_varchar2) or
601     nvl(pe_pei_shd.g_old_rec.pei_information26, hr_api.g_varchar2) <>
602     nvl(p_rec.pei_information26, hr_api.g_varchar2) or
603     nvl(pe_pei_shd.g_old_rec.pei_information27, hr_api.g_varchar2) <>
604     nvl(p_rec.pei_information27, hr_api.g_varchar2) or
605     nvl(pe_pei_shd.g_old_rec.pei_information28, hr_api.g_varchar2) <>
606     nvl(p_rec.pei_information28, hr_api.g_varchar2) or
607     nvl(pe_pei_shd.g_old_rec.pei_information29, hr_api.g_varchar2) <>
608     nvl(p_rec.pei_information29, hr_api.g_varchar2) or
609     nvl(pe_pei_shd.g_old_rec.pei_information30, hr_api.g_varchar2) <>
610     nvl(p_rec.pei_information30, hr_api.g_varchar2))
611   then
612     --
613     hr_dflex_utility.ins_or_upd_descflex_attribs
614       (p_appl_short_name    => 'PER'
615       ,p_descflex_name      => 'Extra Person Info DDF'
616       ,p_attribute_category => p_rec.pei_information_category
617       ,p_attribute1_name    => 'PEI_INFORMATION1'
618       ,p_attribute1_value   => p_rec.pei_information1
619       ,p_attribute2_name    => 'PEI_INFORMATION2'
620       ,p_attribute2_value   => p_rec.pei_information2
621       ,p_attribute3_name    => 'PEI_INFORMATION3'
622       ,p_attribute3_value   => p_rec.pei_information3
623       ,p_attribute4_name    => 'PEI_INFORMATION4'
624       ,p_attribute4_value   => p_rec.pei_information4
625       ,p_attribute5_name    => 'PEI_INFORMATION5'
626       ,p_attribute5_value   => p_rec.pei_information5
627       ,p_attribute6_name    => 'PEI_INFORMATION6'
628       ,p_attribute6_value   => p_rec.pei_information6
629       ,p_attribute7_name    => 'PEI_INFORMATION7'
630       ,p_attribute7_value   => p_rec.pei_information7
631       ,p_attribute8_name    => 'PEI_INFORMATION8'
632       ,p_attribute8_value   => p_rec.pei_information8
633       ,p_attribute9_name    => 'PEI_INFORMATION9'
634       ,p_attribute9_value   => p_rec.pei_information9
635       ,p_attribute10_name   => 'PEI_INFORMATION10'
636       ,p_attribute10_value  => p_rec.pei_information10
637       ,p_attribute11_name   => 'PEI_INFORMATION11'
638       ,p_attribute11_value  => p_rec.pei_information11
639       ,p_attribute12_name   => 'PEI_INFORMATION12'
640       ,p_attribute12_value  => p_rec.pei_information12
641       ,p_attribute13_name   => 'PEI_INFORMATION13'
642       ,p_attribute13_value  => p_rec.pei_information13
643       ,p_attribute14_name   => 'PEI_INFORMATION14'
644       ,p_attribute14_value  => p_rec.pei_information14
645       ,p_attribute15_name   => 'PEI_INFORMATION15'
646       ,p_attribute15_value  => p_rec.pei_information15
647       ,p_attribute16_name   => 'PEI_INFORMATION16'
648       ,p_attribute16_value  => p_rec.pei_information16
649       ,p_attribute17_name   => 'PEI_INFORMATION17'
650       ,p_attribute17_value  => p_rec.pei_information17
651       ,p_attribute18_name   => 'PEI_INFORMATION18'
652       ,p_attribute18_value  => p_rec.pei_information18
653       ,p_attribute19_name   => 'PEI_INFORMATION19'
654       ,p_attribute19_value  => p_rec.pei_information19
655       ,p_attribute20_name   => 'PEI_INFORMATION20'
656       ,p_attribute20_value  => p_rec.pei_information20
657       ,p_attribute21_name   => 'PEI_INFORMATION21'
658       ,p_attribute21_value  => p_rec.pei_information21
659       ,p_attribute22_name   => 'PEI_INFORMATION22'
660       ,p_attribute22_value  => p_rec.pei_information22
661       ,p_attribute23_name   => 'PEI_INFORMATION23'
662       ,p_attribute23_value  => p_rec.pei_information23
663       ,p_attribute24_name   => 'PEI_INFORMATION24'
664       ,p_attribute24_value  => p_rec.pei_information24
665       ,p_attribute25_name   => 'PEI_INFORMATION25'
666       ,p_attribute25_value  => p_rec.pei_information25
667       ,p_attribute26_name   => 'PEI_INFORMATION26'
668       ,p_attribute26_value  => p_rec.pei_information26
669       ,p_attribute27_name   => 'PEI_INFORMATION27'
670       ,p_attribute27_value  => p_rec.pei_information27
671       ,p_attribute28_name   => 'PEI_INFORMATION28'
672       ,p_attribute28_value  => p_rec.pei_information28
673       ,p_attribute29_name   => 'PEI_INFORMATION29'
674       ,p_attribute29_value  => p_rec.pei_information29
675       ,p_attribute30_name   => 'PEI_INFORMATION30'
676       ,p_attribute30_value  => p_rec.pei_information30
677       );
678     --
679   end if;
680   --
681   hr_utility.set_location(' Leaving:'||l_proc, 10);
682 end chk_ddf;
683 --
684 -- ----------------------------------------------------------------------------
685 -- |---------------------------< insert_validate >----------------------------|
686 -- ----------------------------------------------------------------------------
687 Procedure insert_validate(p_rec in pe_pei_shd.g_rec_type) is
688 --
689   l_proc  varchar2(72) := g_package||'insert_validate';
690 --
691 Begin
692   hr_utility.set_location('Entering:'||l_proc, 5);
693   --
694   per_per_bus.set_security_group_id
695    (
696     p_person_id => p_rec.person_id
697    );
698   --
699   hr_utility.set_location('Entering:'||l_proc, 7);
700   --
701   -- Call all supporting business operations
702   --
703   -- 1) Check person id
704   --
705   pe_pei_bus.chk_person_id
706     (p_person_id => p_rec.person_id);
707   --
708   hr_utility.set_location(l_proc, 10);
709   --
710   -- 2) Check information type
711   --
712   pe_pei_bus.chk_information_type
713     (p_information_type => p_rec.information_type
714     ,p_person_id        => p_rec.person_id);
715   --
716   hr_utility.set_location(l_proc, 15);
717   --
718   -- 3) Call ddf procedure to validation Developer Descriptive Flexfields
719   --
720   pe_pei_bus.chk_ddf(p_rec => p_rec);
721   --
722   -- Call df procedure to validation Descriptive Flexfields
723   --
724   pe_pei_bus.chk_df(p_rec => p_rec);
725   --
726   hr_utility.set_location(' Leaving:'||l_proc, 30);
727 --
728 End insert_validate;
729 --
730 -- ----------------------------------------------------------------------------
731 -- |---------------------------< update_validate >----------------------------|
732 -- ----------------------------------------------------------------------------
733 Procedure update_validate(p_rec in pe_pei_shd.g_rec_type) is
734 --
735   l_proc  varchar2(72) := g_package||'update_validate';
736 --
737 Begin
738   hr_utility.set_location('Entering:'||l_proc, 5);
739   --
740   per_per_bus.set_security_group_id
741    (
742     p_person_id => p_rec.person_id
743    );
744   --
745   hr_utility.set_location('Entering:'||l_proc, 7);
746   --
747   -- Call all supporting business operations
748   --
749   -- 1) Check those columns which cannot be updated have not changed.
750   --
751   hr_utility.set_location(l_proc, 10);
752   --
753   pe_pei_bus.chk_non_updateable_args (p_rec => p_rec);
754   --
755   -- 2) Call ddf procedure to validation Developer Descriptive Flexfields
756   --
757   pe_pei_bus.chk_ddf(p_rec => p_rec);
758   --
759   -- Call df procedure to validation Descriptive Flexfields
760   --
761   pe_pei_bus.chk_df(p_rec => p_rec);
762   --
763   hr_utility.set_location(' Leaving:'||l_proc, 30);
764 End update_validate;
765 --
766 -- ----------------------------------------------------------------------------
767 -- |---------------------------< delete_validate >----------------------------|
768 -- ----------------------------------------------------------------------------
769 Procedure delete_validate(p_rec in pe_pei_shd.g_rec_type) is
770 --
771   l_proc  varchar2(72) := g_package||'delete_validate';
772 --
773 Begin
774   hr_utility.set_location('Entering:'||l_proc, 5);
775   --
776   -- Call all supporting business operations
777   --
778   hr_utility.set_location(' Leaving:'||l_proc, 10);
779 End delete_validate;
780 --
781 end pe_pei_bus;