DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_CHK_BUS

Source


1 Package Body per_chk_bus as
2 /* $Header: pechkrhi.pkb 115.7 2002/12/04 12:17:45 pkakar noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  per_chk_bus.';  -- Global package name
9 --
10 --
11 --
12 -- The following two global variables are only to be
13 -- used by the return_legislation_code function.
14 --
15 g_legislation_code            varchar2(150)  default null;
16 g_checklist_item_id           number         default null;
17 --
18 --  ---------------------------------------------------------------------------
19 --  |----------------------< set_security_group_id >--------------------------|
20 --  ---------------------------------------------------------------------------
21 --
22 Procedure set_security_group_id
23   (p_checklist_item_id                    in number
24   ) is
25   --
26   cursor csr_sec_grp is
27     select pbg.security_group_id
28       from per_business_groups pbg
29          , per_checklist_items chk
30          , per_all_people_f peo
31      where chk.checklist_item_id = p_checklist_item_id
32      and chk.person_id = peo.person_id
33      and pbg.business_group_id = peo.business_group_id;
34   --
38   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
35   -- Declare local variables
36   --
37   l_security_group_id number;
39   --
40 begin
41   --
42   hr_utility.set_location('Entering:'|| l_proc, 10);
43   --
44   -- Ensure that all the mandatory parameter are not null
45   --
46   hr_api.mandatory_arg_error
47     (p_api_name           => l_proc
48     ,p_argument           => 'checklist_item_id'
49     ,p_argument_value     => p_checklist_item_id
50     );
51   --
52   open csr_sec_grp;
53   fetch csr_sec_grp into l_security_group_id;
54   --
55   if csr_sec_grp%notfound then
56      --
57      close csr_sec_grp;
58      --
59      -- The primary key is invalid therefore we must error
60      --
61      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
62      fnd_message.raise_error;
63      --
64   end if;
65   close csr_sec_grp;
66   --
67   -- Set the security_group_id in CLIENT_INFO
68   --
69   hr_api.set_security_group_id
70     (p_security_group_id => l_security_group_id
71     );
72   --
73   hr_utility.set_location(' Leaving:'|| l_proc, 20);
74   --
75 end set_security_group_id;
76 --
77 --  ---------------------------------------------------------------------------
78 --  |---------------------< return_legislation_code >-------------------------|
79 --  ---------------------------------------------------------------------------
80 --
81 Function return_legislation_code
82   (p_checklist_item_id                    in     number
83   )
84   Return Varchar2 Is
85   --
86   cursor csr_leg_code is
87     select pbg.legislation_code
88       from per_business_groups     pbg
89          , per_checklist_items chk
90          , per_all_people_f peo
91      where chk.checklist_item_id = p_checklist_item_id
92      and chk.person_id = peo.person_id
93      and pbg.business_group_id = peo.business_group_id;
94   --
95   -- Declare local variables
96   --
97   l_legislation_code  varchar2(150);
98   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
99   --
100 Begin
101   --
102   hr_utility.set_location('Entering:'|| l_proc, 10);
103   --
104   -- Ensure that all the mandatory parameter are not null
105   --
106   hr_api.mandatory_arg_error
107     (p_api_name           => l_proc
108     ,p_argument           => 'checklist_item_id'
109     ,p_argument_value     => p_checklist_item_id
110     );
111   --
112   if ( nvl(per_chk_bus.g_checklist_item_id, hr_api.g_number)
113        = p_checklist_item_id) then
114     --
115     -- The legislation code has already been found with a previous
116     -- call to this function. Just return the value in the global
117     -- variable.
118     --
119     l_legislation_code := per_chk_bus.g_legislation_code;
120     hr_utility.set_location(l_proc, 20);
121   else
122     --
123     -- The ID is different to the last call to this function
124     -- or this is the first call to this function.
125     --
126     open csr_leg_code;
127     fetch csr_leg_code into l_legislation_code;
128     --
129     if csr_leg_code%notfound then
130       --
131       -- The primary key is invalid therefore we must error
132       --
133       close csr_leg_code;
134       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
135       fnd_message.raise_error;
136     end if;
137     hr_utility.set_location(l_proc,30);
138     --
139     -- Set the global variables so the values are
140     -- available for the next call to this function.
141     --
142     close csr_leg_code;
143     per_chk_bus.g_checklist_item_id := p_checklist_item_id;
144     per_chk_bus.g_legislation_code  := l_legislation_code;
145   end if;
146   hr_utility.set_location(' Leaving:'|| l_proc, 40);
147   return l_legislation_code;
148 end return_legislation_code;
149 --
150 --
151 -- ----------------------------------------------------------------------------
152 -- |----------------------< chk_non_updateable_args >-----------------------|
153 -- ----------------------------------------------------------------------------
154 -- {Start Of Comments}
155 --
156 -- Description:
157 --   This procedure is used to ensure that non updatetable attributes have
158 --   not been updated. If an attribute has been updated an error is generated.
159 --
160 -- Pre Conditions:
161 --   g_old_rec has been populated with details of the values currently in
162 --   the database.
163 --
164 -- In Arguments:
165 --   p_rec has been populated with the updated values the user would like the
166 --
167 -- Post Success:
168 --   Processing continues if all the non updateable attributes have not
169 --   changed.
170 --
171 -- Post Failure:
172 --   An application error is raised if any of the non updatable attributes
173 --   (person_id, item_code, item, checklist_item_id)  have been altered.
174 --
175 -- Access Status:
176 --   Internal Table Handler Use Only.
177 --
178 Procedure chk_non_updateable_args( p_effective_date in date
179                                    ,p_rec in per_chk_shd.g_rec_type) is
180 --
181   l_proc     varchar2(72) := g_package||'chk_non_updateable_args';
182   l_error    exception;
183   l_argument varchar2(30);
184 --
185 Begin
186   hr_utility.set_location('Entering:'||l_proc, 5);
187   --
188   -- Only proceed with validation if a row exists for
189   -- the current record in the HR Schema
190   --
194     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
191   if not per_chk_shd.api_updating
192     (p_checklist_item_id           => p_rec.checklist_item_id,
193      p_object_version_number       => p_rec.object_version_number) then
195     fnd_message.set_token('PROCEDURE', l_proc);
196     fnd_message.set_token('STEP', '5');
197   end if;
198   --
199   hr_utility.set_location(l_proc, 6);
200   --
201   if nvl(p_rec.checklist_item_id,hr_api.g_number)
202      <> nvl(per_chk_shd.g_old_rec.checklist_item_id,hr_api.g_number) then
203      l_argument := 'checklist_item_id';
204      raise l_error;
205   end if;
206   hr_utility.set_location(l_proc, 7);
207   --
208   if nvl(p_rec.person_id,hr_api.g_number)
209      <>  nvl(per_chk_shd.g_old_rec.person_id,hr_api.g_number) then
210      l_argument := 'person_id';
211      raise l_error;
212   end if;
213   hr_utility.set_location(l_proc, 8);
214   --
215   if nvl(p_rec.item_code,hr_api.g_varchar2)
216      <>  nvl(per_chk_shd.g_old_rec.item_code,hr_api.g_varchar2) then
217      l_argument := 'item_code';
218      raise l_error;
219   end if;
220   hr_utility.set_location(l_proc, 9);
221   --
222   exception
223     when l_error then
224        hr_api.argument_changed_error
225          (p_api_name => l_proc
226          ,p_argument => l_argument);
227     when others then
228        raise;
229   hr_utility.set_location(' Leaving:'||l_proc, 14);
230 end chk_non_updateable_args;
231 --
232 --
233 -- ----------------------------------------------------------------------------
234 -- |------< chk_is_person_valid >------|
235 -- ----------------------------------------------------------------------------
236 --
237 -- Description
238 --   This procedure is used to check that person id is valid and not null
239 --
240 -- Pre Conditions
241 --   None.
242 --
243 -- In Parameters
244 --   Status
245 -- Post Success
246 --   Processing continues
247 --
248 -- Post Failure
249 --   Errors handled by the procedure
250 --
251 -- Access Status
252 --   Internal table handler use only.
253 --
254 Procedure chk_is_person_valid(p_effective_date    in date,
255                               p_person_id in per_checklist_items.person_id%type) IS
256   --
257   l_proc         varchar2(72) := g_package||'chk_is_person_valid';
258   --
259   CURSOR chk_valid_person
260   IS
261   SELECT person_id
262   FROM per_all_people_f
263   WHERE person_id = p_person_id;
264 
265   l_person_id per_checklist_items.person_id%TYPE;
266 
267 Begin
268   --
269   hr_utility.set_location('Entering:'||l_proc, 5);
270   --
271   --
272   hr_utility.set_location('At:'||l_proc, 30);
273 
274   OPEN chk_valid_person ;
275   FETCH chk_valid_person into l_person_id;
276   IF chk_valid_person%NOTFOUND THEN
277     CLOSE chk_valid_person;
278     -- Error Message  : Invalid person id
279     fnd_message.set_name('PER', 'HR_52783_CHK_INVALID_PER');
280     fnd_message.raise_error;
281   END IF;
282 
283   CLOSE chk_valid_person;
284 
285   hr_utility.set_location('Leaving:'||l_proc, 10);
286   --
287 End chk_is_person_valid;
288 --
289 -- ----------------------------------------------------------------------------
290 -- |------< chk_is_status_valid >------|
291 -- ----------------------------------------------------------------------------
292 --
293 -- Description
294 --   This procedure is used to check that status is valid and not null
295 --
296 -- Pre Conditions
297 --   None.
298 --
299 -- In Parameters
300 --   Status
301 -- Post Success
302 --   Processing continues
303 --
304 -- Post Failure
305 --   Errors handled by the procedure
306 --
307 -- Access Status
308 --   Internal table handler use only.
309 --
310 Procedure chk_is_status_valid(p_effective_date in date,
311                               p_checklist_item_id in number,
312                               p_status in per_checklist_items.status%type )
313 is
314   --
315   l_proc         varchar2(72) := g_package||'chk_is_status_valid';
316   --
317 Begin
318   --
319   hr_utility.set_location('Entering:'||l_proc, 5);
320   --
321   if (p_checklist_item_id is not null and p_status is not null and
322           (nvl(per_chk_shd.g_old_rec.status,hr_api.g_varchar2)
323              <> nvl(p_status,hr_api.g_varchar2)))
324   or ( p_checklist_item_id is null and p_status is not null)
325   then
326 
327      IF hr_api.not_exists_in_hr_lookups( p_effective_date => p_effective_date,
328                                          p_lookup_type    => 'CHECKLIST_STATUS',
329                                          p_lookup_code    => p_status ) THEN
330         -- Error Message  : Invalid checklist status
331         fnd_message.set_name('PER', 'HR_52781_CHK_INVALID_STATUS');
332         fnd_message.raise_error;
333      END IF;
334 
335   end if;
336     --
337   hr_utility.set_location('Leaving:'||l_proc, 10);
338   --
339 End chk_is_status_valid;
340 --
341 -- ----------------------------------------------------------------------------
342 -- |------< chk_is_itemcode_valid >------|
343 -- ----------------------------------------------------------------------------
344 --
345 -- Description
346 --   This procedure is used to check whether the primary code entered for
347 --   a person is unique.
348 --
349 -- Pre Conditions
350 --   None.
351 --
352 -- In Parameters
356 --   checklist_item_id of the check list item
353 --   item_code of record being inserted or updated.
354 --   object_version_number Object version number of record being
355 --                         inserted or updated.
357 --
358 -- Post Success
359 --   Processing continues
360 --
361 -- Post Failure
362 --   Errors handled by the procedure
363 --
364 -- Access Status
365 --   Internal table handler use only.
366 --
367 Procedure chk_is_itemcode_valid(p_effective_date in date,
368                                 p_item_code in per_checklist_items.item_code%type) IS
369   --
370   l_proc         varchar2(72) := g_package||'chk_is_itemcode_valid';
371 
372 Begin
373   --
374   hr_utility.set_location('Entering:'||l_proc, 10);
375 
376     -- Checking to see if the item code is valid
377    IF hr_api.not_exists_in_hr_lookups( p_effective_date => p_effective_date,
378                                        p_lookup_type    => 'CHECKLIST_ITEM',
379                                        p_lookup_code    => p_item_code ) THEN
380       -- Error Message - Invalid Checklist value
381       fnd_message.set_name('PER', 'HR_52778_CHK_INVALID_ITEM');
382       fnd_message.raise_error;
383    END IF;
384 
385 
386    -- Checking to see it the item code entered is unique for that
387    -- person
388    -- This check will be done during the insert_dml
389    -- PER_CHECKLIST_ITEMS_U1
390 
391   --
392   hr_utility.set_location('Leaving:'||l_proc, 10);
393   --
394 End chk_is_itemcode_valid;
395 --
396 -- -----------------------------------------------------------------------
397 -- |------------------------------< chk_df >-----------------------------|
398 -- -----------------------------------------------------------------------
399 --
400 -- Description:
401 --   Validates the all Descriptive Flexfield values.
402 --
403 -- Pre-conditions:
404 --   All other columns have been validated. Must be called as the
405 --   last step from insert_validate and update_validate.
406 --
407 -- In Arguments:
408 --   p_rec
409 --
410 -- Post Success:
411 --   If the Descriptive Flexfield structure column and data values are
412 --   all valid this procedure will end normally and processing will
413 --   continue.
414 --
415 -- Post Failure:
416 --   If the Descriptive Flexfield structure column value or any of
417 --   the data values are invalid then an application error is raised as
418 --   a PL/SQL exception.
419 --
420 -- Access Status:
421 --   Internal Row Handler Use Only.
422 --
423 -- ---------------------------------------------------------------------------
424 procedure chk_df
425   (p_rec              in per_chk_shd.g_rec_type
426   ,p_validate_df_flex in boolean default true) is
427 --
428   l_proc     varchar2(72) := g_package||'chk_df';
429 --
430 begin
431   --
432     hr_utility.set_location('Entering:'||l_proc, 10);
433     --
434     -- if inserting and not required to validate flex data
435     -- then ensure all flex data passed is null
436     --
437       If ((p_rec.checklist_item_id is null) and
438           (not p_validate_df_flex)) then
439            --
440            --
441              If (not ( (p_rec.attribute_category is null) and
442                        (p_rec.attribute1         is null) and
443                        (p_rec.attribute2         is null) and
444                        (p_rec.attribute3         is null) and
445                        (p_rec.attribute4         is null) and
446                        (p_rec.attribute5         is null) and
447                        (p_rec.attribute6         is null) and
448                        (p_rec.attribute7         is null) and
449                        (p_rec.attribute8         is null) and
450                        (p_rec.attribute9         is null) and
451                        (p_rec.attribute10        is null) and
452                        (p_rec.attribute11        is null) and
453                        (p_rec.attribute12        is null) and
454                        (p_rec.attribute13        is null) and
455                        (p_rec.attribute14        is null) and
456                        (p_rec.attribute15        is null) and
457                        (p_rec.attribute16        is null) and
458                        (p_rec.attribute17        is null) and
459                        (p_rec.attribute18        is null) and
460                        (p_rec.attribute19        is null) and
461                        (p_rec.attribute20        is null) and
462                        (p_rec.attribute21        is null) and
463                        (p_rec.attribute22        is null) and
464                        (p_rec.attribute23        is null) and
465                        (p_rec.attribute24        is null) and
466                        (p_rec.attribute25        is null) and
467                        (p_rec.attribute26        is null) and
468                        (p_rec.attribute27        is null) and
469                        (p_rec.attribute28        is null) and
470                        (p_rec.attribute29        is null) and
471                        (p_rec.attribute30        is null) ) )
472                  then
473                    fnd_message.set_name('PER','HR_6153_ALL_PROCEDURE_FAIL');
474                    fnd_message.set_token('PROCEDURE','chk_df');
475                    fnd_message.set_token('STEP',1);
476                    fnd_message.raise_error;
477              End if;
478       End if;
479       --
480       --
481       -- if   (    updating and flex data has changed
482       --        OR updating and all flex segments are NULL)
486       --
483       --   OR ( inserting and required to validate flexdata)
484       -- then validate flex data.
485       --
487       If (  (p_rec.checklist_item_id is not null)
488              and
489          (  (nvl(per_chk_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
490              nvl(p_rec.attribute_category, hr_api.g_varchar2) or
491              nvl(per_chk_shd.g_old_rec.attribute1, hr_api.g_varchar2)  <>
492              nvl(p_rec.attribute1, hr_api.g_varchar2) or
493              nvl(per_chk_shd.g_old_rec.attribute2, hr_api.g_varchar2)  <>
494              nvl(p_rec.attribute2, hr_api.g_varchar2) or
495              nvl(per_chk_shd.g_old_rec.attribute3, hr_api.g_varchar2)  <>
496              nvl(p_rec.attribute3, hr_api.g_varchar2) or
497              nvl(per_chk_shd.g_old_rec.attribute4, hr_api.g_varchar2)  <>
498              nvl(p_rec.attribute4, hr_api.g_varchar2) or
499              nvl(per_chk_shd.g_old_rec.attribute5, hr_api.g_varchar2)  <>
500              nvl(p_rec.attribute5, hr_api.g_varchar2) or
501              nvl(per_chk_shd.g_old_rec.attribute6, hr_api.g_varchar2)  <>
502              nvl(p_rec.attribute6, hr_api.g_varchar2) or
503              nvl(per_chk_shd.g_old_rec.attribute7, hr_api.g_varchar2)  <>
504              nvl(p_rec.attribute7, hr_api.g_varchar2) or
505              nvl(per_chk_shd.g_old_rec.attribute8, hr_api.g_varchar2)  <>
506              nvl(p_rec.attribute8, hr_api.g_varchar2) or
507              nvl(per_chk_shd.g_old_rec.attribute9, hr_api.g_varchar2)  <>
508              nvl(p_rec.attribute9, hr_api.g_varchar2) or
509              nvl(per_chk_shd.g_old_rec.attribute10, hr_api.g_varchar2) <>
510              nvl(p_rec.attribute10, hr_api.g_varchar2) or
511              nvl(per_chk_shd.g_old_rec.attribute11, hr_api.g_varchar2) <>
512              nvl(p_rec.attribute11, hr_api.g_varchar2) or
513              nvl(per_chk_shd.g_old_rec.attribute12, hr_api.g_varchar2) <>
514              nvl(p_rec.attribute12, hr_api.g_varchar2) or
515              nvl(per_chk_shd.g_old_rec.attribute13, hr_api.g_varchar2) <>
516              nvl(p_rec.attribute13, hr_api.g_varchar2) or
517              nvl(per_chk_shd.g_old_rec.attribute14, hr_api.g_varchar2) <>
518              nvl(p_rec.attribute14, hr_api.g_varchar2) or
519              nvl(per_chk_shd.g_old_rec.attribute15, hr_api.g_varchar2) <>
520              nvl(p_rec.attribute15, hr_api.g_varchar2) or
521              nvl(per_chk_shd.g_old_rec.attribute16, hr_api.g_varchar2) <>
522              nvl(p_rec.attribute16, hr_api.g_varchar2) or
523              nvl(per_chk_shd.g_old_rec.attribute17, hr_api.g_varchar2) <>
524              nvl(p_rec.attribute17, hr_api.g_varchar2) or
525              nvl(per_chk_shd.g_old_rec.attribute18, hr_api.g_varchar2) <>
526              nvl(p_rec.attribute18, hr_api.g_varchar2) or
527              nvl(per_chk_shd.g_old_rec.attribute19, hr_api.g_varchar2) <>
528              nvl(p_rec.attribute19, hr_api.g_varchar2) or
529              nvl(per_chk_shd.g_old_rec.attribute20, hr_api.g_varchar2) <>
530              nvl(p_rec.attribute20, hr_api.g_varchar2) or
531              nvl(per_chk_shd.g_old_rec.attribute21, hr_api.g_varchar2) <>
532              nvl(p_rec.attribute21, hr_api.g_varchar2) or
533              nvl(per_chk_shd.g_old_rec.attribute22, hr_api.g_varchar2) <>
534              nvl(p_rec.attribute22, hr_api.g_varchar2) or
535              nvl(per_chk_shd.g_old_rec.attribute23, hr_api.g_varchar2) <>
536              nvl(p_rec.attribute23, hr_api.g_varchar2) or
537              nvl(per_chk_shd.g_old_rec.attribute24, hr_api.g_varchar2) <>
538              nvl(p_rec.attribute24, hr_api.g_varchar2) or
539              nvl(per_chk_shd.g_old_rec.attribute25, hr_api.g_varchar2) <>
540              nvl(p_rec.attribute25, hr_api.g_varchar2) or
541              nvl(per_chk_shd.g_old_rec.attribute26, hr_api.g_varchar2) <>
542              nvl(p_rec.attribute26, hr_api.g_varchar2) or
543              nvl(per_chk_shd.g_old_rec.attribute27, hr_api.g_varchar2) <>
544              nvl(p_rec.attribute27, hr_api.g_varchar2) or
545              nvl(per_chk_shd.g_old_rec.attribute28, hr_api.g_varchar2) <>
546              nvl(p_rec.attribute28, hr_api.g_varchar2) or
547              nvl(per_chk_shd.g_old_rec.attribute29, hr_api.g_varchar2) <>
548              nvl(p_rec.attribute29, hr_api.g_varchar2) or
549              nvl(per_chk_shd.g_old_rec.attribute30, hr_api.g_varchar2) <>
550              nvl(p_rec.attribute30, hr_api.g_varchar2)
551             )
552           or
553             (
554               (p_rec.attribute_category is null) and
555               (p_rec.attribute1         is null) and
556               (p_rec.attribute2         is null) and
557               (p_rec.attribute3         is null) and
558               (p_rec.attribute4         is null) and
559               (p_rec.attribute5         is null) and
560               (p_rec.attribute6         is null) and
561               (p_rec.attribute7         is null) and
562               (p_rec.attribute8         is null) and
563               (p_rec.attribute9         is null) and
564               (p_rec.attribute10        is null) and
565               (p_rec.attribute11        is null) and
566               (p_rec.attribute12        is null) and
567               (p_rec.attribute13        is null) and
568               (p_rec.attribute14        is null) and
569               (p_rec.attribute15        is null) and
570               (p_rec.attribute16        is null) and
571               (p_rec.attribute17        is null) and
572               (p_rec.attribute18        is null) and
573               (p_rec.attribute19        is null) and
574               (p_rec.attribute20        is null) and
575               (p_rec.attribute21        is null) and
576               (p_rec.attribute22        is null) and
577               (p_rec.attribute23        is null) and
578               (p_rec.attribute24        is null) and
579               (p_rec.attribute25        is null) and
583               (p_rec.attribute29        is null) and
580               (p_rec.attribute26        is null) and
581               (p_rec.attribute27        is null) and
582               (p_rec.attribute28        is null) and
584               (p_rec.attribute30        is null)
585             )
586           ))
587         --  or inserting and required to validate flex
588         or
589           ((p_rec.checklist_item_id is null) and
590            (p_validate_df_flex))
591            then
592 --
593 --           validate flex segment values
594 --
595     hr_dflex_utility.ins_or_upd_descflex_attribs(
596          p_appl_short_name      => 'PER'
597         ,p_descflex_name        => 'PER_CHECKLIST_ITEMS'
598         ,p_attribute_category   => p_rec.attribute_category
599         ,p_attribute1_name      => 'ATTRIBUTE1'
600         ,p_attribute1_value     => p_rec.attribute1
601         ,p_attribute2_name      => 'ATTRIBUTE2'
602         ,p_attribute2_value     => p_rec.attribute2
603         ,p_attribute3_name      => 'ATTRIBUTE3'
604         ,p_attribute3_value     => p_rec.attribute3
605         ,p_attribute4_name      => 'ATTRIBUTE4'
606         ,p_attribute4_value     => p_rec.attribute4
607         ,p_attribute5_name      => 'ATTRIBUTE5'
608         ,p_attribute5_value     => p_rec.attribute5
609         ,p_attribute6_name      => 'ATTRIBUTE6'
610         ,p_attribute6_value     => p_rec.attribute6
611         ,p_attribute7_name      => 'ATTRIBUTE7'
612         ,p_attribute7_value     => p_rec.attribute7
613         ,p_attribute8_name      => 'ATTRIBUTE8'
614         ,p_attribute8_value     => p_rec.attribute8
615         ,p_attribute9_name      => 'ATTRIBUTE9'
616         ,p_attribute9_value     => p_rec.attribute9
617         ,p_attribute10_name     => 'ATTRIBUTE10'
618         ,p_attribute10_value    => p_rec.attribute10
619         ,p_attribute11_name     => 'ATTRIBUTE11'
620         ,p_attribute11_value    => p_rec.attribute11
621         ,p_attribute12_name     => 'ATTRIBUTE12'
622         ,p_attribute12_value    => p_rec.attribute12
623         ,p_attribute13_name     => 'ATTRIBUTE13'
624         ,p_attribute13_value    => p_rec.attribute13
625         ,p_attribute14_name     => 'ATTRIBUTE14'
626         ,p_attribute14_value    => p_rec.attribute14
627         ,p_attribute15_name     => 'ATTRIBUTE15'
628         ,p_attribute15_value    => p_rec.attribute15
629         ,p_attribute16_name     => 'ATTRIBUTE16'
630         ,p_attribute16_value    => p_rec.attribute16
631         ,p_attribute17_name     => 'ATTRIBUTE17'
632         ,p_attribute17_value    => p_rec.attribute17
633         ,p_attribute18_name     => 'ATTRIBUTE18'
634         ,p_attribute18_value    => p_rec.attribute18
635         ,p_attribute19_name     => 'ATTRIBUTE19'
636         ,p_attribute19_value    => p_rec.attribute19
637         ,p_attribute20_name     => 'ATTRIBUTE20'
638         ,p_attribute20_value    => p_rec.attribute20
639         ,p_attribute21_name     => 'ATTRIBUTE21'
640         ,p_attribute21_value    => p_rec.attribute21
641         ,p_attribute22_name     => 'ATTRIBUTE22'
642         ,p_attribute22_value    => p_rec.attribute22
643         ,p_attribute23_name     => 'ATTRIBUTE23'
644         ,p_attribute23_value    => p_rec.attribute23
645         ,p_attribute24_name     => 'ATTRIBUTE24'
646         ,p_attribute24_value    => p_rec.attribute24
647         ,p_attribute25_name     => 'ATTRIBUTE25'
648         ,p_attribute25_value    => p_rec.attribute25
649         ,p_attribute26_name     => 'ATTRIBUTE26'
650         ,p_attribute26_value    => p_rec.attribute26
651         ,p_attribute27_name     => 'ATTRIBUTE27'
652         ,p_attribute27_value    => p_rec.attribute27
653         ,p_attribute28_name     => 'ATTRIBUTE28'
654         ,p_attribute28_value    => p_rec.attribute28
655         ,p_attribute29_name     => 'ATTRIBUTE29'
656         ,p_attribute29_value    => p_rec.attribute29
657         ,p_attribute30_name     => 'ATTRIBUTE30'
658         ,p_attribute30_value    => p_rec.attribute30
659         );
660   End if;
661   --
662   hr_utility.set_location('  Leaving:'||l_proc, 20);
663 --
664 end chk_df;
665 --
666 -- ----------------------------------------------------------------------------
667 -- |---------------------------< insert_validate >----------------------------|
668 -- ----------------------------------------------------------------------------
669 Procedure insert_validate(p_effective_date in date,
670                           p_rec in per_chk_shd.g_rec_type) is
671 --
672   l_proc  varchar2(72) := g_package||'insert_validate';
673 --
674 Begin
675   hr_utility.set_location('Entering:'||l_proc, 5);
676   --
677   -- Check mandatory arguments have been set
678   --
679   hr_api.mandatory_arg_error
680     (p_api_name                     => l_proc
681     ,p_argument                     => 'effective_date'
682     ,p_argument_value               => p_effective_date
683     );
684 
685   hr_api.mandatory_arg_error
686     (p_api_name                     => l_proc
687     ,p_argument                     => 'person_id'
688     ,p_argument_value               => p_rec.person_id
689     );
690 
691   hr_api.mandatory_arg_error
692     (p_api_name                     => l_proc
693     ,p_argument                     => 'item_code'
694     ,p_argument_value               => p_rec.item_code
695     );
696 
697   -- Checking whether the person id is valid
698   hr_utility.set_location('At:'||l_proc, 6);
699 
700   chk_is_person_valid
701   (p_effective_date        => p_effective_date,
702    p_person_id             => p_rec.person_id);
703 
704   --
705   -- Setting the security group
706   --
707   per_per_bus.set_security_group_id
708    (
709     p_person_id => p_rec.person_id
710    );
711   --
712   -- Call all supporting business operations
713   --
714 
715   -- Checking whether the item code for that particular person
716   -- is unique , not null and valid
717 
718   hr_utility.set_location('At :'||l_proc, 10);
719 
720   chk_is_itemcode_valid
721   (p_effective_date        => p_effective_date,
722    p_item_code             => p_rec.item_code);
723 
724 -- Checking whether the status code is valid and not null
725 
726   hr_utility.set_location('At :'||l_proc, 15);
727 
728   chk_is_status_valid(p_effective_date => p_effective_date,
729                       p_checklist_item_id => p_rec.checklist_item_id,
730                       p_status     => p_rec.status );
731 
732 -- Validating the desc flex values
733 
734   hr_utility.set_location('At :'||l_proc, 20);
735 
736    chk_df(p_rec               => p_rec
737          ,p_validate_df_flex  => TRUE);
738 
739   hr_utility.set_location(' Leaving:'||l_proc, 30);
740 
741 End insert_validate;
742 --
743 -- ----------------------------------------------------------------------------
744 -- |---------------------------< update_validate >----------------------------|
745 -- ----------------------------------------------------------------------------
746 Procedure update_validate(p_effective_date in date,
747                           p_rec in per_chk_shd.g_rec_type) is
748 --
749   l_proc  varchar2(72) := g_package||'update_validate';
750 --
751 Begin
752   hr_utility.set_location('Entering:'||l_proc, 5);
753   --
754   -- Check mandatory arguments have been set
755   --
756   hr_api.mandatory_arg_error
757     (p_api_name                     => l_proc
758     ,p_argument                     => 'effective_date'
759     ,p_argument_value               => p_effective_date
760     );
761 
762   hr_api.mandatory_arg_error
763     (p_api_name                     => l_proc
764     ,p_argument                     => 'person_id'
765     ,p_argument_value               => p_rec.person_id
766     );
767 
768   hr_api.mandatory_arg_error
769     (p_api_name                     => l_proc
770     ,p_argument                     => 'item_code'
771     ,p_argument_value               => p_rec.item_code
772     );
773 
774   --
775   -- Call all supporting business operations
776   --
777   chk_non_updateable_args(p_effective_date => p_effective_date,
778                           p_rec => p_rec);
779   --
780   -- Setting the security group
781   --
782   per_per_bus.set_security_group_id
783    (
784     p_person_id => p_rec.person_id
785    );
786 -- Checking whether the status code is valid and not null
787 
788   hr_utility.set_location('At :'||l_proc, 20);
789 
790   chk_is_status_valid(p_effective_date => p_effective_date,
791                       p_checklist_item_id => p_rec.checklist_item_id,
792                       p_status     => p_rec.status );
793 
794 -- Validating the desc flex values
795 
796   hr_utility.set_location('At :'||l_proc, 25);
797 
798    chk_df(p_rec               => p_rec
799          ,p_validate_df_flex  => TRUE);
800   --
801   hr_utility.set_location(' Leaving:'||l_proc, 30);
802 End update_validate;
803 --
804 -- ----------------------------------------------------------------------------
805 -- |---------------------------< delete_validate >----------------------------|
806 -- ----------------------------------------------------------------------------
807 Procedure delete_validate(p_rec in per_chk_shd.g_rec_type) is
808 --
809   l_proc  varchar2(72) := g_package||'delete_validate';
810 --
811 Begin
812   hr_utility.set_location('Entering:'||l_proc, 5);
813   hr_utility.set_location(' Leaving:'||l_proc, 10);
814 End delete_validate;
815 --
816 end per_chk_bus;