DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_CTK_BUS

Source


1 Package Body per_ctk_bus as
2 /* $Header: pectkrhi.pkb 120.7 2006/09/11 20:45:03 sturlapa noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_ctk_bus.';  -- Global package name
9    g_debug boolean := hr_utility.debug_enabled;
10 --
11 -- The following two global variables are only to be
12 -- used by the return_legislation_code function.
13 --
14 g_legislation_code            varchar2(150)  default null;
15 g_task_in_checklist_id        number         default null;
16 --
17 --  ---------------------------------------------------------------------------
18 --  |----------------------< set_security_group_id >--------------------------|
19 --  ---------------------------------------------------------------------------
20 --
21 Procedure set_security_group_id
22   (p_task_in_checklist_id                 in number
23   ,p_associated_column1                   in varchar2 default null
24   ) is
25   --
26   -- Declare cursor
27   --
28   cursor csr_sec_grp is
29     select pbg.security_group_id,
30            pbg.legislation_code
31       from per_business_groups_perf pbg
32          , per_tasks_in_checklist   tic
33          , per_checklists           ckl
34      where tic.task_in_checklist_id = p_task_in_checklist_id
35        and tic.checklist_id         = ckl.checklist_id
36        and pbg.business_group_id    = ckl.business_group_id;
37   --
38   -- Declare local variables
39   --
40   l_security_group_id number;
41   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
42   l_legislation_code  varchar2(150);
43   --
44 begin
45   --
46   hr_utility.set_location('Entering:'|| l_proc, 10);
47   --
48   -- Ensure that all the mandatory parameter are not null
49   --
50   hr_api.mandatory_arg_error
51     (p_api_name           => l_proc
52     ,p_argument           => 'task_in_checklist_id'
53     ,p_argument_value     => p_task_in_checklist_id
54     );
55   --
56   open csr_sec_grp;
57   fetch csr_sec_grp into l_security_group_id
58                        , l_legislation_code;
59   --
60   if csr_sec_grp%notfound then
61      --
62      close csr_sec_grp;
63      --
64      -- The primary key is invalid therefore we must error
65      --
66      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
67      hr_multi_message.add
68        (p_associated_column1
69         => nvl(p_associated_column1,'TASK_IN_CHECKLIST_ID')
70        );
71      --
72   else
73     close csr_sec_grp;
74     --
75     -- Set the security_group_id in CLIENT_INFO
76     --
77     hr_api.set_security_group_id
78       (p_security_group_id => l_security_group_id
79       );
80     --
81     -- Set the sessions legislation context in HR_SESSION_DATA
82     --
83     hr_api.set_legislation_context(l_legislation_code);
84   end if;
85   --
86   hr_utility.set_location(' Leaving:'|| l_proc, 20);
87   --
88 end set_security_group_id;
89 --
90 --  ---------------------------------------------------------------------------
91 --  |---------------------< return_legislation_code >-------------------------|
92 --  ---------------------------------------------------------------------------
93 --
94 Function return_legislation_code
95   (p_task_in_checklist_id                 in     number
96   )
97   Return Varchar2 Is
98   --
99   -- Declare cursor
100   --
101   cursor csr_leg_code is
102     select pbg.legislation_code
103       from per_business_groups_perf pbg
104          , per_tasks_in_checklist   tic
105          , per_checklists           ckl
106      where tic.task_in_checklist_id = p_task_in_checklist_id
107        and tic.checklist_id         = ckl.checklist_id
108        and pbg.business_group_id    = ckl.business_group_id;
109 
110   --
111   -- Declare local variables
112   --
113   l_legislation_code  varchar2(150);
114   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
115   --
116 Begin
117   --
118   hr_utility.set_location('Entering:'|| l_proc, 10);
119   --
120   -- Ensure that all the mandatory parameter are not null
121   --
122   hr_api.mandatory_arg_error
123     (p_api_name           => l_proc
124     ,p_argument           => 'task_in_checklist_id'
125     ,p_argument_value     => p_task_in_checklist_id
126     );
127   --
128   if ( nvl(per_ctk_bus.g_task_in_checklist_id, hr_api.g_number)
129        = p_task_in_checklist_id) then
130     --
131     -- The legislation code has already been found with a previous
132     -- call to this function. Just return the value in the global
133     -- variable.
134     --
135     l_legislation_code := per_ctk_bus.g_legislation_code;
136     hr_utility.set_location(l_proc, 20);
137   else
138     --
139     -- The ID is different to the last call to this function
140     -- or this is the first call to this function.
141     --
142     open csr_leg_code;
143     fetch csr_leg_code into l_legislation_code;
144     --
145     if csr_leg_code%notfound then
146       --
147       -- The primary key is invalid therefore we must error
148       --
149       close csr_leg_code;
150       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
151       fnd_message.raise_error;
152     end if;
153     hr_utility.set_location(l_proc,30);
154     --
155     -- Set the global variables so the values are
156     -- available for the next call to this function.
157     --
158     close csr_leg_code;
159     per_ctk_bus.g_task_in_checklist_id        := p_task_in_checklist_id;
160     per_ctk_bus.g_legislation_code  := l_legislation_code;
161   end if;
162   hr_utility.set_location(' Leaving:'|| l_proc, 40);
163   return l_legislation_code;
164 end return_legislation_code;
165 --
166 --  ---------------------------------------------------------------------------
167 --  |---------------------------< chk_checklist_id >--------------------------|
168 --  ---------------------------------------------------------------------------
169 --
170 procedure chk_checklist_id
171   (p_checklist_id       in    per_tasks_in_checklist.checklist_id%TYPE
172    ) is
173   --
174   -- Declare local variables
175   --
176   l_proc  varchar2(72) := g_package||'chk_checklist_id';
177   l_dummy number;
178   --
179   -- Declare cursor to check name is unique.
180   --
181   cursor csr_ckl_id is
182     select null
183     from per_checklists ckl
184     where ckl.checklist_id = p_checklist_id;
185   --
186 begin
187    IF g_debug THEN hr_utility.set_location('Entering:'||l_proc, 10); END IF;
188 
189     --
190     hr_api.mandatory_arg_error
191             (p_api_name       => l_proc
192             ,p_argument       => 'p_checklist_id'
193             ,p_argument_value => p_checklist_id
194             );
195    IF g_debug THEN hr_utility.set_location('Entering:'||l_proc, 20); END IF;
196   --
197   -- Check mandatory checklist_id exists and is valid
198   --
199        open csr_ckl_id;
200        fetch csr_ckl_id into l_dummy;
201        if csr_ckl_id%notfound then
202           close csr_ckl_id;
203           --
204           fnd_message.set_name('PER', 'PER_449665_CKL_INV_CKL_ID');
205           fnd_message.raise_error;
206           --
207        end if;
208        close csr_ckl_id;
209   --
210   IF g_debug THEN hr_utility.set_location('Leaving:'||l_proc, 50); END IF;
211   --
212   exception when app_exception.application_exception then
213         IF hr_multi_message.exception_add
214                  (p_associated_column1      => 'PER_TASKS_INCHECKLIST.CHECKLIST_ID'
215                  ) then
216               hr_utility.set_location(' Leaving:'|| l_proc, 60);
217               raise;
218             end if;
219         IF g_debug THEN  hr_utility.set_location(' Leaving:'|| l_proc, 70);  END IF;
220 end chk_checklist_id;
221 --
222 --
223 --  ---------------------------------------------------------------------------
224 --  |----------------------------< chk_task_name >----------------------------|
225 --  ---------------------------------------------------------------------------
226 --
227 procedure chk_task_name
228   (p_checklist_task_name    in    per_tasks_in_checklist.checklist_task_name%TYPE
229   ,p_task_in_checklist_id   in    per_tasks_in_checklist.task_in_checklist_id%TYPE
230   ,p_checklist_id           in    per_tasks_in_checklist.checklist_id%TYPE
231   ,p_object_version_number  in    per_tasks_in_checklist.object_version_number%type
232    ) is
233   --
234   -- Declare local variables
235   --
236   l_proc  varchar2(72) := g_package||'chk_checklist_task_name';
237   l_tsk_exists varchar2(10);
238   l_api_updating boolean;
239   --
240   -- Declare cursor to check name is unique.
241   --
242   cursor csr_ckltsk is
243     select 'X'
244       from per_tasks_in_checklist tic
245      where tic.checklist_task_name  = p_checklist_task_name
246        and tic.checklist_id         = p_checklist_id;
247   --
248 begin
249   if g_debug then
250     hr_utility.set_location('Entering:'||l_proc, 1);
251   end if;
252   --
253   --  Only proceed with validation if:
254   --  a) The current g_old_rec is current and
255   --  b) The party value has changed
256   --  c) a record is being inserted
257   --
258   l_api_updating := per_ctk_shd.api_updating
259     (p_task_in_checklist_id  => p_task_in_checklist_id
260     ,p_object_version_number => p_object_version_number
261     );
262   IF (l_api_updating
263       and nvl(per_ctk_shd.g_old_rec.checklist_task_name, hr_api.g_varchar2)
264       = nvl(p_checklist_task_name,hr_api.g_varchar2))
265   THEN
266       RETURN;
267   END IF;
268   --
269     if g_debug then  hr_utility.set_location(l_proc, 40);  end if;
270     --
271     -- Check mandatory checklist_task_name exists
272     --
273     if p_checklist_task_name is not null then
274          open csr_ckltsk;
275          fetch csr_ckltsk into l_tsk_exists;
276          if csr_ckltsk%found then
277             close csr_ckltsk;
278             --
279             fnd_message.set_name('PER', 'PER_449670_CKL_TSK_NAME_UNQ');
280             fnd_message.set_token('TASK_NAME', p_checklist_task_name);
281             fnd_message.raise_error;
282             --
283          end if;
284          close csr_ckltsk;
285     else
286       --
287       -- Since task_name is mandatory need to error
288       --
289        fnd_message.set_name('PER','PER_449679_CKL_TASK_NAME_REQD');
290        fnd_message.raise_error;
291     end if;
292     --
293     if g_debug then hr_utility.set_location(l_proc, 5);  end if;
294     --
295   exception when app_exception.application_exception then
296         if hr_multi_message.exception_add
297                  (p_associated_column1      => 'PER_TASKS_INCHECKLIST.NAME'
298                  ) then
299               hr_utility.set_location(' Leaving:'|| l_proc, 60);
300               raise;
301             end if;
302             hr_utility.set_location(' Leaving:'|| l_proc, 70);
303 end chk_task_name;
304 --
305 --  ---------------------------------------------------------------------------
306 --  |----------------------------< chk_duration_uom >-------------------------|
307 --  ---------------------------------------------------------------------------
308 --
309 procedure chk_duration_uom
310   (p_target_duration        in    per_tasks_in_checklist.target_duration%TYPE
311   ,p_target_duration_uom    in    per_tasks_in_checklist.target_duration_uom%TYPE
312   ,p_task_in_checklist_id   in    per_tasks_in_checklist.task_in_checklist_id%TYPE
313   ,p_object_version_number  in    per_tasks_in_checklist.object_version_number%type
314   ,p_effective_date         in    date
315    ) is
316   --
317   -- Declare local variables
318   --
319   l_proc  varchar2(72) := g_package||'chk_duration_uom';
320   l_tsk_exists varchar2(10);
321   l_api_updating boolean;
322   --
323 begin
324 
325   IF g_debug then hr_utility.set_location('Entering:'||l_proc, 10);  END IF;
326   --
327   --  Only proceed with validation if:
328   --  a) The current g_old_rec is current and
329   --  b) The duration_units or duration_units_uom values are changed
330   --
331   l_api_updating := per_ctk_shd.api_updating
332          (p_task_in_checklist_id  => p_task_in_checklist_id
333          ,p_object_version_number => p_object_version_number
334          );
335   --
336   IF (l_api_updating
337        and ( (nvl(per_ctk_shd.g_old_rec.target_duration, hr_api.g_number) = nvl(p_target_duration,hr_api.g_number))
338              AND
339              (nvl(per_ctk_shd.g_old_rec.target_duration_UOM, hr_api.g_varchar2) = nvl(p_target_duration_uom,hr_api.g_varchar2))
340            )
341      )
342   THEN
343       RETURN;
344   END IF;
345   --
346     IF g_debug then  hr_utility.set_location(l_proc, 40);  END IF;
347 
348     --
349     -- Checks that the target_duration_uom is valid
350     --
351     IF (nvl(p_target_duration_uom,'ZZ') <> 'ZZ') THEN
352     --
353       IF hr_api.not_exists_in_hrstanlookups
354            (p_effective_date        => p_effective_date
355            ,p_lookup_type           => 'QUALIFYING_UNITS'
356            ,p_lookup_code           => p_target_duration_uom
357            ) then
358         --  Error: Invalid Group
359         fnd_message.set_name('PER', 'PER_449680_CKL_UNITS_UOM_INV');
360         fnd_message.raise_error;
361         --
362       ELSE
363         --
364         -- Checks that the target_duration_uom is valid for Checklists
365         --
366         IF (p_target_duration_uom <> 'D' and
367             p_target_duration_uom <> 'W' and
368             p_target_duration_uom <> 'M')
369         THEN
370           fnd_message.set_name('PER', 'PER_449680_CKL_UNITS_UOM_INV');
371           fnd_message.raise_error;
372         END IF;
373         --
374       END IF;
375       --
376     END IF;
377     --
378     -- Check if target_duration has some value, then target_duration_uom is mandatory
379     --
380     IF ( nvl(p_target_duration,-1) <> -1 AND
381          nvl(p_target_duration_uom,'ZZ') ='ZZ'
382        )
383     THEN
384       fnd_message.set_name('PER', 'PER_449680_CKL_UNITS_UOM_INV');
385       fnd_message.raise_error;
386     END IF;
387     --
388     IF g_debug then hr_utility.set_location(l_proc, 5);  END IF;
389     --
390   EXCEPTION when app_exception.application_exception then
391         if hr_multi_message.exception_add
392                  (p_associated_column1      => 'PER_TASKS_INCHECKLIST.TARGET_DURATION_UOM'
393                  ) then
394               hr_utility.set_location(' Leaving:'|| l_proc, 60);
395               raise;
396             end if;
397             hr_utility.set_location(' Leaving:'|| l_proc, 70);
398 end chk_duration_uom;
399 --
400 /*
401 --  ---------------------------------------------------------------------------
402 --  |--------------------------< chk_ckl_tsk_uinique >------------------------|
403 --  ---------------------------------------------------------------------------
404 --
405 procedure chk_ckl_tsk_unique
406   (p_checklist_id         in    per_tasks_in_checklist.checklist_id%TYPE
407   ,p_checklist_task_name  in    per_tasks_in_checklist.checklist_task_name%TYPE
408    ) is
409   --
410   -- Declare local variables
411   --
412   l_proc  varchar2(72) := g_package||'chk_ckl_tsk_unique';
413   l_dummy number;
414   --
415   -- Declare cursor to check name is unique.
416   --
417   cursor csr_ckl_tsk is
418     select null
419     from per_tasks_in_checklist tic
420     where tic.checklist_id        = p_checklist_id
421     and   tic.checklist_task_name = p_checklist_task_name;
422 
423   --
424 begin
425   hr_utility.set_location('Entering:'||l_proc, 1);
426   --
427   -- 	Check mandatory checklist_id exists if not null
428   --
429        open csr_ckl_tsk;
430        fetch csr_ckl_tsk into l_dummy;
431        if csr_ckl_tsk%found then
432           close csr_ckl_tsk;
433           hr_utility.set_message(800, 'HR_XXXX_CKL_TSK_INV_UNQ');
434           hr_utility.raise_error;
435        end if;
436        close csr_ckl_tsk;
437   --
438   hr_utility.set_location(l_proc, 5);
439   --
440 end chk_ckl_tsk_unique;
441 --
442 
443 --  ---------------------------------------------------------------------------
444 --  |---------------------------< CHK_ELIG_PRFL_ID >--------------------------|
445 --  ---------------------------------------------------------------------------
446 --
447 procedure chk_elig_prfl_id
448   (p_eligibility_profile_id       in    per_tasks_in_checklist.eligibility_profile_id%TYPE
449   ,p_business_group_id  in    per_checklists.business_group_id%TYPE
450   ,p_effective_date     in    date
451    ) is
452   --
453   -- Declare local variables
454   --
455   l_proc  varchar2(72) := g_package||'chk_elig_prfl_id';
456   l_dummy number;
457   --
458   -- Declare cursor to check name is unique.
459   --
460   cursor csr_elg_prf is
461     select null
462     from ben_eligy_prfl_f
463     where eligy_prfl_id      = p_eligibility_profile_id
464     and   business_group_id  = p_business_group_id
465     and   p_effective_date between effective_start_date
466                            and   effective_end_date;
467 
468 
469   --
470 begin
471   hr_utility.set_location('Entering:'||l_proc, 1);
472   --
473   -- 	Check mandatory checklist_id exists if not null
474   --
475        open csr_elg_prf;
476        fetch csr_elg_prf into l_dummy;
477        if csr_elg_prf%notfound then
478           close csr_elg_prf;
479           hr_utility.set_message(800, 'HR_XXXX_CKL_TSK_INV_UNQ');
480           hr_utility.raise_error;
481        end if;
482        close csr_elg_prf;
483   --
484   hr_utility.set_location(l_proc, 5);
485   --
486 end chk_elig_prfl_id;
487 --
488 --  ---------------------------------------------------------------------------
489 --  |---------------------------< CHK_ELIG_OBJ_ID >--------------------------|
490 --  ---------------------------------------------------------------------------
491 --
492 procedure chk_elig_obj_id
493   (p_elig_obj_id       in    per_tasks_inchecklist.eligibility_profile_id%TYPE
494   ,p_business_group_id  in    per_checklists.business_group_id%TYPE
495   ,p_effective_date     in    date
496    ) is
497   --
498   -- Declare local variables
499   --
500   l_proc  varchar2(72) := g_package||'chk_elig_obj_id';
501   l_dummy number;
502   --
503   -- Declare cursor to check name is unique.
504   --
505   cursor csr_ben_obj is
506     select null
507     from ben_elig_obj_f beo
508     where beo.elig_obj_id        = p_elig_obj_id
509     and   beo.business_group_id  = p_business_group_id
510     and   p_effective_date between beo.effective_start_date
511     and   beo.effective_end_date;
512 
513   --
514 begin
515   hr_utility.set_location('Entering:'||l_proc, 1);
516   --
517   -- 	Check mandatory checklist_id exists if not null
518   --
519        open csr_ben_obj;
520        fetch csr_ben_obj into l_dummy;
521        if csr_ben_obj%notfound then
522           close csr_ben_obj;
523           hr_utility.set_message(800, 'HR_XXXX_CKL_TSK_INV_UNQ');
524           hr_utility.raise_error;
525        end if;
526        close csr_ben_obj;
527   --
528   hr_utility.set_location(l_proc, 5);
529   --
530 end chk_elig_obj_id;
531 */
532 --
533 -- ----------------------------------------------------------------------------
534 -- |-----------------------------< chk_ddf >----------------------------------|
535 -- ----------------------------------------------------------------------------
536 --
537 -- Description:
538 --   Validates all the Developer Descriptive Flexfield values.
539 --
540 -- Prerequisites:
541 --   All other columns have been validated.  Must be called as the
542 --   last step from insert_validate and update_validate.
543 --
544 -- In Arguments:
545 --   p_rec
546 --
547 -- Post Success:
548 --   If the Developer Descriptive Flexfield structure column and data values
549 --   are all valid this procedure will end normally and processing will
550 --   continue.
551 --
552 -- Post Failure:
553 --   If the Developer Descriptive Flexfield structure column value or any of
554 --   the data values are invalid then an application error is raised as
555 --   a PL/SQL exception.
556 --
557 -- Access Status:
558 --   Internal Row Handler Use Only.
559 --
560 -- ----------------------------------------------------------------------------
561 procedure chk_ddf
562   (p_rec in per_ctk_shd.g_rec_type
563   ) is
564 --
565   l_proc   varchar2(72) := g_package || 'chk_ddf';
566 --
567 begin
568   hr_utility.set_location('Entering:'||l_proc,10);
569   --
570   if ((p_rec.task_in_checklist_id is not null)  and (
571     nvl(per_ctk_shd.g_old_rec.information_category, hr_api.g_varchar2) <>
572     nvl(p_rec.information_category, hr_api.g_varchar2)  or
573     nvl(per_ctk_shd.g_old_rec.information1, hr_api.g_varchar2) <>
574     nvl(p_rec.information1, hr_api.g_varchar2)  or
575     nvl(per_ctk_shd.g_old_rec.information2, hr_api.g_varchar2) <>
576     nvl(p_rec.information2, hr_api.g_varchar2)  or
577     nvl(per_ctk_shd.g_old_rec.information3, hr_api.g_varchar2) <>
578     nvl(p_rec.information3, hr_api.g_varchar2)  or
579     nvl(per_ctk_shd.g_old_rec.information4, hr_api.g_varchar2) <>
580     nvl(p_rec.information4, hr_api.g_varchar2)  or
581     nvl(per_ctk_shd.g_old_rec.information5, hr_api.g_varchar2) <>
582     nvl(p_rec.information5, hr_api.g_varchar2)  or
583     nvl(per_ctk_shd.g_old_rec.information6, hr_api.g_varchar2) <>
584     nvl(p_rec.information6, hr_api.g_varchar2)  or
585     nvl(per_ctk_shd.g_old_rec.information7, hr_api.g_varchar2) <>
586     nvl(p_rec.information7, hr_api.g_varchar2)  or
587     nvl(per_ctk_shd.g_old_rec.information8, hr_api.g_varchar2) <>
588     nvl(p_rec.information8, hr_api.g_varchar2)  or
589     nvl(per_ctk_shd.g_old_rec.information9, hr_api.g_varchar2) <>
590     nvl(p_rec.information9, hr_api.g_varchar2)  or
591     nvl(per_ctk_shd.g_old_rec.information10, hr_api.g_varchar2) <>
592     nvl(p_rec.information10, hr_api.g_varchar2)  or
593     nvl(per_ctk_shd.g_old_rec.information11, hr_api.g_varchar2) <>
594     nvl(p_rec.information11, hr_api.g_varchar2)  or
595     nvl(per_ctk_shd.g_old_rec.information12, hr_api.g_varchar2) <>
596     nvl(p_rec.information12, hr_api.g_varchar2)  or
597     nvl(per_ctk_shd.g_old_rec.information13, hr_api.g_varchar2) <>
598     nvl(p_rec.information13, hr_api.g_varchar2)  or
599     nvl(per_ctk_shd.g_old_rec.information14, hr_api.g_varchar2) <>
600     nvl(p_rec.information14, hr_api.g_varchar2)  or
601     nvl(per_ctk_shd.g_old_rec.information15, hr_api.g_varchar2) <>
602     nvl(p_rec.information15, hr_api.g_varchar2)  or
603     nvl(per_ctk_shd.g_old_rec.information16, hr_api.g_varchar2) <>
604     nvl(p_rec.information16, hr_api.g_varchar2)  or
605     nvl(per_ctk_shd.g_old_rec.information17, hr_api.g_varchar2) <>
606     nvl(p_rec.information17, hr_api.g_varchar2)  or
607     nvl(per_ctk_shd.g_old_rec.information18, hr_api.g_varchar2) <>
608     nvl(p_rec.information18, hr_api.g_varchar2)  or
609     nvl(per_ctk_shd.g_old_rec.information19, hr_api.g_varchar2) <>
610     nvl(p_rec.information19, hr_api.g_varchar2)  or
611     nvl(per_ctk_shd.g_old_rec.information20, hr_api.g_varchar2) <>
612     nvl(p_rec.information20, hr_api.g_varchar2) ))
613     or (p_rec.task_in_checklist_id is null)  then
614     --
615     -- Only execute the validation if absolutely necessary:
616     -- a) During update, the structure column value or any
617     --    of the attribute values have actually changed.
618     -- b) During insert.
619     --
620     hr_dflex_utility.ins_or_upd_descflex_attribs
621       (p_appl_short_name                 => 'PER'
622       ,p_descflex_name                   => 'EDIT_HERE: Enter descflex name'
623       ,p_attribute_category              => p_rec.information_category
624       ,p_attribute1_name                 => 'INFORMATION1'
625       ,p_attribute1_value                => p_rec.information1
626       ,p_attribute2_name                 => 'INFORMATION2'
627       ,p_attribute2_value                => p_rec.information2
628       ,p_attribute3_name                 => 'INFORMATION3'
629       ,p_attribute3_value                => p_rec.information3
630       ,p_attribute4_name                 => 'INFORMATION4'
631       ,p_attribute4_value                => p_rec.information4
632       ,p_attribute5_name                 => 'INFORMATION5'
633       ,p_attribute5_value                => p_rec.information5
634       ,p_attribute6_name                 => 'INFORMATION6'
635       ,p_attribute6_value                => p_rec.information6
636       ,p_attribute7_name                 => 'INFORMATION7'
637       ,p_attribute7_value                => p_rec.information7
638       ,p_attribute8_name                 => 'INFORMATION8'
639       ,p_attribute8_value                => p_rec.information8
640       ,p_attribute9_name                 => 'INFORMATION9'
641       ,p_attribute9_value                => p_rec.information9
642       ,p_attribute10_name                => 'INFORMATION10'
643       ,p_attribute10_value               => p_rec.information10
644       ,p_attribute11_name                => 'INFORMATION11'
645       ,p_attribute11_value               => p_rec.information11
646       ,p_attribute12_name                => 'INFORMATION12'
647       ,p_attribute12_value               => p_rec.information12
648       ,p_attribute13_name                => 'INFORMATION13'
649       ,p_attribute13_value               => p_rec.information13
650       ,p_attribute14_name                => 'INFORMATION14'
651       ,p_attribute14_value               => p_rec.information14
652       ,p_attribute15_name                => 'INFORMATION15'
653       ,p_attribute15_value               => p_rec.information15
654       ,p_attribute16_name                => 'INFORMATION16'
655       ,p_attribute16_value               => p_rec.information16
656       ,p_attribute17_name                => 'INFORMATION17'
657       ,p_attribute17_value               => p_rec.information17
658       ,p_attribute18_name                => 'INFORMATION18'
659       ,p_attribute18_value               => p_rec.information18
660       ,p_attribute19_name                => 'INFORMATION19'
661       ,p_attribute19_value               => p_rec.information19
662       ,p_attribute20_name                => 'INFORMATION20'
663       ,p_attribute20_value               => p_rec.information20
664       );
665   end if;
666   --
667   hr_utility.set_location(' Leaving:'||l_proc,20);
668 end chk_ddf;
669 --
670 -- ----------------------------------------------------------------------------
671 -- |------------------------------< chk_df >----------------------------------|
672 -- ----------------------------------------------------------------------------
673 --
674 -- Description:
675 --   Validates all the Descriptive Flexfield values.
676 --
677 -- Prerequisites:
678 --   All other columns have been validated.  Must be called as the
679 --   last step from insert_validate and update_validate.
680 --
681 -- In Arguments:
682 --   p_rec
683 --
684 -- Post Success:
685 --   If the Descriptive Flexfield structure column and data values are
686 --   all valid this procedure will end normally and processing will
687 --   continue.
688 --
689 -- Post Failure:
690 --   If the Descriptive Flexfield structure column value or any of
691 --   the data values are invalid then an application error is raised as
692 --   a PL/SQL exception.
693 --
694 -- Access Status:
695 --   Internal Row Handler Use Only.
696 --
697 -- ----------------------------------------------------------------------------
698 procedure chk_df
699   (p_rec in per_ctk_shd.g_rec_type
700   ) is
701 --
702   l_proc   varchar2(72) := g_package || 'chk_df';
703 --
704 begin
705   hr_utility.set_location('Entering:'||l_proc,10);
706   --
707   if ((p_rec.task_in_checklist_id is not null)  and (
708     nvl(per_ctk_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
709     nvl(p_rec.attribute_category, hr_api.g_varchar2)  or
710     nvl(per_ctk_shd.g_old_rec.attribute1, hr_api.g_varchar2) <>
711     nvl(p_rec.attribute1, hr_api.g_varchar2)  or
712     nvl(per_ctk_shd.g_old_rec.attribute2, hr_api.g_varchar2) <>
713     nvl(p_rec.attribute2, hr_api.g_varchar2)  or
714     nvl(per_ctk_shd.g_old_rec.attribute3, hr_api.g_varchar2) <>
715     nvl(p_rec.attribute3, hr_api.g_varchar2)  or
716     nvl(per_ctk_shd.g_old_rec.attribute4, hr_api.g_varchar2) <>
717     nvl(p_rec.attribute4, hr_api.g_varchar2)  or
718     nvl(per_ctk_shd.g_old_rec.attribute5, hr_api.g_varchar2) <>
719     nvl(p_rec.attribute5, hr_api.g_varchar2)  or
720     nvl(per_ctk_shd.g_old_rec.attribute6, hr_api.g_varchar2) <>
721     nvl(p_rec.attribute6, hr_api.g_varchar2)  or
722     nvl(per_ctk_shd.g_old_rec.attribute7, hr_api.g_varchar2) <>
723     nvl(p_rec.attribute7, hr_api.g_varchar2)  or
724     nvl(per_ctk_shd.g_old_rec.attribute8, hr_api.g_varchar2) <>
725     nvl(p_rec.attribute8, hr_api.g_varchar2)  or
726     nvl(per_ctk_shd.g_old_rec.attribute9, hr_api.g_varchar2) <>
727     nvl(p_rec.attribute9, hr_api.g_varchar2)  or
728     nvl(per_ctk_shd.g_old_rec.attribute10, hr_api.g_varchar2) <>
729     nvl(p_rec.attribute10, hr_api.g_varchar2)  or
730     nvl(per_ctk_shd.g_old_rec.attribute11, hr_api.g_varchar2) <>
731     nvl(p_rec.attribute11, hr_api.g_varchar2)  or
732     nvl(per_ctk_shd.g_old_rec.attribute12, hr_api.g_varchar2) <>
733     nvl(p_rec.attribute12, hr_api.g_varchar2)  or
734     nvl(per_ctk_shd.g_old_rec.attribute13, hr_api.g_varchar2) <>
735     nvl(p_rec.attribute13, hr_api.g_varchar2)  or
736     nvl(per_ctk_shd.g_old_rec.attribute14, hr_api.g_varchar2) <>
737     nvl(p_rec.attribute14, hr_api.g_varchar2)  or
738     nvl(per_ctk_shd.g_old_rec.attribute15, hr_api.g_varchar2) <>
739     nvl(p_rec.attribute15, hr_api.g_varchar2)  or
740     nvl(per_ctk_shd.g_old_rec.attribute16, hr_api.g_varchar2) <>
741     nvl(p_rec.attribute16, hr_api.g_varchar2)  or
742     nvl(per_ctk_shd.g_old_rec.attribute17, hr_api.g_varchar2) <>
743     nvl(p_rec.attribute17, hr_api.g_varchar2)  or
744     nvl(per_ctk_shd.g_old_rec.attribute18, hr_api.g_varchar2) <>
745     nvl(p_rec.attribute18, hr_api.g_varchar2)  or
746     nvl(per_ctk_shd.g_old_rec.attribute19, hr_api.g_varchar2) <>
747     nvl(p_rec.attribute19, hr_api.g_varchar2)  or
748     nvl(per_ctk_shd.g_old_rec.attribute20, hr_api.g_varchar2) <>
749     nvl(p_rec.attribute20, hr_api.g_varchar2) ))
750     or (p_rec.task_in_checklist_id is null)  then
751     --
752     -- Only execute the validation if absolutely necessary:
753     -- a) During update, the structure column value or any
754     --    of the attribute values have actually changed.
755     -- b) During insert.
756     --
757     hr_dflex_utility.ins_or_upd_descflex_attribs
758       (p_appl_short_name                 => 'PER'
759       ,p_descflex_name                   => 'EDIT_HERE: Enter descflex name'
760       ,p_attribute_category              => p_rec.attribute_category
761       ,p_attribute1_name                 => 'ATTRIBUTE1'
762       ,p_attribute1_value                => p_rec.attribute1
763       ,p_attribute2_name                 => 'ATTRIBUTE2'
764       ,p_attribute2_value                => p_rec.attribute2
765       ,p_attribute3_name                 => 'ATTRIBUTE3'
766       ,p_attribute3_value                => p_rec.attribute3
767       ,p_attribute4_name                 => 'ATTRIBUTE4'
768       ,p_attribute4_value                => p_rec.attribute4
769       ,p_attribute5_name                 => 'ATTRIBUTE5'
770       ,p_attribute5_value                => p_rec.attribute5
771       ,p_attribute6_name                 => 'ATTRIBUTE6'
772       ,p_attribute6_value                => p_rec.attribute6
773       ,p_attribute7_name                 => 'ATTRIBUTE7'
774       ,p_attribute7_value                => p_rec.attribute7
775       ,p_attribute8_name                 => 'ATTRIBUTE8'
776       ,p_attribute8_value                => p_rec.attribute8
777       ,p_attribute9_name                 => 'ATTRIBUTE9'
778       ,p_attribute9_value                => p_rec.attribute9
779       ,p_attribute10_name                => 'ATTRIBUTE10'
780       ,p_attribute10_value               => p_rec.attribute10
781       ,p_attribute11_name                => 'ATTRIBUTE11'
782       ,p_attribute11_value               => p_rec.attribute11
783       ,p_attribute12_name                => 'ATTRIBUTE12'
784       ,p_attribute12_value               => p_rec.attribute12
785       ,p_attribute13_name                => 'ATTRIBUTE13'
786       ,p_attribute13_value               => p_rec.attribute13
787       ,p_attribute14_name                => 'ATTRIBUTE14'
788       ,p_attribute14_value               => p_rec.attribute14
789       ,p_attribute15_name                => 'ATTRIBUTE15'
790       ,p_attribute15_value               => p_rec.attribute15
791       ,p_attribute16_name                => 'ATTRIBUTE16'
792       ,p_attribute16_value               => p_rec.attribute16
793       ,p_attribute17_name                => 'ATTRIBUTE17'
794       ,p_attribute17_value               => p_rec.attribute17
795       ,p_attribute18_name                => 'ATTRIBUTE18'
796       ,p_attribute18_value               => p_rec.attribute18
797       ,p_attribute19_name                => 'ATTRIBUTE19'
798       ,p_attribute19_value               => p_rec.attribute19
799       ,p_attribute20_name                => 'ATTRIBUTE20'
800       ,p_attribute20_value               => p_rec.attribute20
801       );
802   end if;
803   --
804   hr_utility.set_location(' Leaving:'||l_proc,20);
805 end chk_df;
806 --
807 -- ----------------------------------------------------------------------------
808 -- |-----------------------< chk_non_updateable_args >------------------------|
809 -- ----------------------------------------------------------------------------
810 -- {Start Of Comments}
811 --
812 -- Description:
813 --   This procedure is used to ensure that non updateable attributes have
814 --   not been updated. If an attribute has been updated an error is generated.
815 --
816 -- Pre Conditions:
817 --   g_old_rec has been populated with details of the values currently in
818 --   the database.
819 --
820 -- In Arguments:
821 --   p_rec has been populated with the updated values the user would like the
822 --   record set to.
823 --
824 -- Post Success:
825 --   Processing continues if all the non updateable attributes have not
826 --   changed.
827 --
828 -- Post Failure:
829 --   An application error is raised if any of the non updatable attributes
830 --   have been altered.
831 --
832 -- {End Of Comments}
833 -- ----------------------------------------------------------------------------
834 Procedure chk_non_updateable_args
835   (p_effective_date               in date
836   ,p_rec in per_ctk_shd.g_rec_type
837   ) IS
838 --
839   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
840 --
841 Begin
842   --
843   -- Only proceed with the validation if a row exists for the current
844   -- record in the HR Schema.
845   --
846   IF NOT per_ctk_shd.api_updating
847       (p_task_in_checklist_id              => p_rec.task_in_checklist_id
848       ,p_object_version_number             => p_rec.object_version_number
849       ) THEN
850      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
851      fnd_message.set_token('PROCEDURE ', l_proc);
852      fnd_message.set_token('STEP ', '5');
853      fnd_message.raise_error;
854   END IF;
855   --
856 
857 End chk_non_updateable_args;
858 --
859 -- ----------------------------------------------------------------------------
860 -- |---------------------------< insert_validate >----------------------------|
861 -- ----------------------------------------------------------------------------
862 Procedure insert_validate
863   (p_effective_date               in date
864   ,p_rec                          in per_ctk_shd.g_rec_type
865   ) is
866 --
867   l_proc  varchar2(72) := g_package||'insert_validate';
868 --
869 Begin
870   hr_utility.set_location('Entering:'||l_proc, 5);
871   --
872   -- Call all supporting business operations
873   --
874   per_ckl_bus.set_security_group_id
875     (p_checklist_id    => p_rec.checklist_id);
876 
877   --
878   -- Validate Dependent Attributes
879   --
880 
881   per_ctk_bus.chk_checklist_id
882   (p_checklist_id       => p_rec.checklist_id
883    );
884   --
885   --
886   --  Check task_name
887   --
888   per_ctk_bus.chk_task_name
889   (p_checklist_task_name   => p_rec.checklist_task_name
890   ,p_task_in_checklist_id  => p_rec.task_in_checklist_id
891   ,p_checklist_id          => p_rec.checklist_id
892   ,p_object_version_number => p_rec.object_version_number
893    );
894   --
895   --  Check Duration and duration uom
896   --
897   per_ctk_bus.chk_duration_uom
898   (p_target_duration        => p_rec.target_duration
899   ,p_target_duration_uom    => p_rec.target_duration_uom
900   ,p_task_in_checklist_id   => p_rec.task_in_checklist_id
901   ,p_object_version_number  => p_rec.object_version_number
902   ,p_effective_date         => p_effective_date
903    );
904   --
905 /*
906   --
907   per_ctk_bus.chk_ckl_tsk_unique
908   (p_checklist_id        => p_rec.checklist_id
909   ,p_checklist_task_name => p_rec.checklist_task_name
910    );
911   --
912 
913   per_ctk_bus.chk_elig_prfl_id
914   (p_eligibility_profile_id   => p_rec.p_task_in_checklist_id
915   ,p_business_group_id  in    => p_rec.p_task_in_checklist_id
916   ,p_effective_date     in    date
917    );
918 
919 
920   --
921   per_ctk_bus.chk_elig_obj_id
922   (p_elig_obj_id          => p_rec.p_task_in_checklist_id
923   ,p_business_group_id    => p_rec.p_task_in_checklist_id
924   ,p_effective_date     in    date
925    );
926   --
927   --
928   per_ctk_bus.chk_ddf(p_rec);
929   --
930   per_ctk_bus.chk_df(p_rec);
931   --
932 */
933   --
934   hr_utility.set_location(' Leaving:'||l_proc, 10);
935 End insert_validate;
936 --
937 -- ----------------------------------------------------------------------------
938 -- |---------------------------< update_validate >----------------------------|
939 -- ----------------------------------------------------------------------------
940 Procedure update_validate
941   (p_effective_date               in date
942   ,p_rec                          in per_ctk_shd.g_rec_type
943   ) is
944 --
945   l_proc  varchar2(72) := g_package||'update_validate';
946 --
947 Begin
948   hr_utility.set_location('Entering:'||l_proc, 5);
949   --
950   -- Call all supporting business operations
951   --
952     per_ckl_bus.set_security_group_id
953     (p_checklist_id    => p_rec.checklist_id);
954   --
955   -- Validate Dependent Attributes
956   --
957   chk_non_updateable_args
958     (p_effective_date              => p_effective_date
959       ,p_rec              => p_rec
960     );
961   --
962   per_ctk_bus.chk_checklist_id
963   (p_checklist_id       => p_rec.checklist_id
964    );
965   --
966   --
967   --  Check task_name
968   --
969   per_ctk_bus.chk_task_name
970   (p_checklist_task_name   => p_rec.checklist_task_name
971   ,p_task_in_checklist_id  => p_rec.task_in_checklist_id
972   ,p_checklist_id          => p_rec.checklist_id
973   ,p_object_version_number => p_rec.object_version_number
974    );
975   --
976   --  Check Duration and duration uom
977   --
978   per_ctk_bus.chk_duration_uom
979   (p_target_duration        => p_rec.target_duration
980   ,p_target_duration_uom    => p_rec.target_duration_uom
981   ,p_task_in_checklist_id   => p_rec.task_in_checklist_id
982   ,p_object_version_number  => p_rec.object_version_number
983   ,p_effective_date         => p_effective_date
984    );
985   --
986 /*
987   --
988   per_ctk_bus.chk_ckl_tsk_unique
989   (p_checklist_id        => p_rec.checklist_id
990   ,p_checklist_task_name => p_rec.checklist_task_name
991    );
992   --
993 
994   per_ctk_bus.chk_elig_prfl_id
995   (p_eligibility_profile_id   => p_rec.p_task_in_checklist_id
996   ,p_business_group_id  in    => p_rec.p_task_in_checklist_id
997   ,p_effective_date     in    date
998    );
999 
1000 
1001   --
1002   per_ctk_bus.chk_elig_obj_id
1003   (p_elig_obj_id          => p_rec.p_task_in_checklist_id
1004   ,p_business_group_id    => p_rec.p_task_in_checklist_id
1005   ,p_effective_date     in    date
1006    );
1007   --
1008   --
1009   per_ctk_bus.chk_ddf(p_rec);
1010   --
1011   per_ctk_bus.chk_df(p_rec);
1012   --
1013 */
1014   --
1015   hr_utility.set_location(' Leaving:'||l_proc, 10);
1016 End update_validate;
1017 --
1018 -- ----------------------------------------------------------------------------
1019 -- |---------------------------< delete_validate >----------------------------|
1020 -- ----------------------------------------------------------------------------
1021 Procedure delete_validate
1022   (p_rec                          in per_ctk_shd.g_rec_type
1023   ) is
1024 --
1025   l_proc  varchar2(72) := g_package||'delete_validate';
1026 --
1027 Begin
1028   hr_utility.set_location('Entering:'||l_proc, 5);
1029   --
1030   -- Call all supporting business operations
1031   --
1032   hr_utility.set_location(' Leaving:'||l_proc, 10);
1033 End delete_validate;
1034 --
1035 end per_ctk_bus;