DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_ORD_BUS

Source


1 Package Body hr_ord_bus as
2 /* $Header: hrordrhi.pkb 115.7 2002/12/04 06:20:03 hjonnala noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  hr_ord_bus.';  -- Global package name
9 --
10 -- The following two global variables are only to be
11 -- used by the return_legislation_code function.
12 --
13 g_legislation_code            varchar2(150)  default null;
14 g_organization_link_id        number         default null;
15 --
16 -- ----------------------------------------------------------------------------
17 -- |                     Private Cursor Definitions                           |
18 -- ----------------------------------------------------------------------------
19 --
20 cursor c_valid_org_for_bg_and_date
21   (p_effective_date    in date
22   ,p_business_group_id in number
23   ,p_organization_id   in number) is
24   select org.organization_id
28     and  p_effective_date between org.date_from and nvl(org.date_to, to_date('31/12/4712', 'DD/MM/YYYY'));
25   from   hr_organization_units org
26   where  org.organization_id   = p_organization_id
27     and  org.business_group_id = p_business_group_id
29 --
30 --  ---------------------------------------------------------------------------
31 --  |----------------------< set_security_group_id >--------------------------|
32 --  ---------------------------------------------------------------------------
33 --
34 Procedure set_security_group_id
35   (p_organization_link_id                 in number
36   ) is
37   --
38   -- Declare cursor
39   --
40   cursor csr_sec_grp is
41     select pbg.security_group_id
42       from per_business_groups pbg
43          , hr_de_organization_links ord
44      where ord.organization_link_id = p_organization_link_id
45        and pbg.business_group_id = ord.business_group_id;
46   --
47   -- Declare local variables
48   --
49   l_security_group_id number;
50   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
51   --
52 begin
53   --
54   hr_utility.set_location('Entering:'|| l_proc, 10);
55   --
56   -- Ensure that all the mandatory parameter are not null
57   --
58   hr_api.mandatory_arg_error
59     (p_api_name           => l_proc
60     ,p_argument           => 'organization_link_id'
61     ,p_argument_value     => p_organization_link_id
62     );
63   --
64   open csr_sec_grp;
65   fetch csr_sec_grp into l_security_group_id;
66   --
67   if csr_sec_grp%notfound then
68      --
69      close csr_sec_grp;
70      --
71      -- The primary key is invalid therefore we must error
72      --
73      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
74      fnd_message.raise_error;
75      --
76   end if;
77   close csr_sec_grp;
78   --
79   -- Set the security_group_id in CLIENT_INFO
80   --
81   hr_api.set_security_group_id
82     (p_security_group_id => l_security_group_id
83     );
84   --
85   hr_utility.set_location(' Leaving:'|| l_proc, 20);
86   --
87 end set_security_group_id;
88 --
89 --  ---------------------------------------------------------------------------
90 --  |---------------------< return_legislation_code >-------------------------|
91 --  ---------------------------------------------------------------------------
92 --
93 Function return_legislation_code
94   (p_organization_link_id                 in     number
95   )
96   Return Varchar2 Is
97   --
98   -- Declare cursor
99   --
100  cursor csr_leg_code is
101     select pbg.legislation_code
102       from per_business_groups pbg
103          , hr_de_organization_links ord
104      where ord.organization_link_id = p_organization_link_id
105        and pbg.business_group_id = ord.business_group_id;
106   --
107   -- Declare local variables
108   --
109   l_legislation_code  varchar2(150);
110   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
111   --
112 Begin
113   --
114   hr_utility.set_location('Entering:'|| l_proc, 10);
115   --
116   -- Ensure that all the mandatory parameter are not null
117   --
118   hr_api.mandatory_arg_error
119     (p_api_name           => l_proc
120     ,p_argument           => 'organization_link_id'
121     ,p_argument_value     => p_organization_link_id
122     );
123   --
124   if ( nvl(hr_ord_bus.g_organization_link_id, hr_api.g_number)
125        = p_organization_link_id) then
126     --
127     -- The legislation code has already been found with a previous
128     -- call to this function. Just return the value in the global
129     -- variable.
130     --
131     l_legislation_code := hr_ord_bus.g_legislation_code;
132     hr_utility.set_location(l_proc, 20);
133   else
134     --
135     -- The ID is different to the last call to this function
136     -- or this is the first call to this function.
137     --
138     open csr_leg_code;
139     fetch csr_leg_code into l_legislation_code;
140     --
141     if csr_leg_code%notfound then
142       --
143       -- The primary key is invalid therefore we must error
144       --
145       close csr_leg_code;
146       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
147       fnd_message.raise_error;
148     end if;
149     hr_utility.set_location(l_proc,30);
150     --
151     -- Set the global variables so the values are
152     -- available for the next call to this function.
153     --
154     close csr_leg_code;
155     hr_ord_bus.g_organization_link_id := p_organization_link_id;
156     hr_ord_bus.g_legislation_code  := l_legislation_code;
157   end if;
158   hr_utility.set_location(' Leaving:'|| l_proc, 40);
159   return l_legislation_code;
160 end return_legislation_code;
161 --
162 --  ---------------------------------------------------------------------------
163 --  |-------------------< chk_parent_organization_id >------------------------|
164 --  ---------------------------------------------------------------------------
165 --
166 --  Description:
167 --    Check the following parent organization rules...
168 --
169 --    1. It is mandatory.
170 --    2. It belongs to the business group.
171 --    3. It exists at the effective date.
172 --    4. It is classified as a HR Organization and it is currently enabled.
173 --
174 --  Pre-conditions:
175 --    None
176 --
177 --  In Arguments:
178 --    p_effective_date
179 --    p_business_group_id
180 --    p_parent_organization_id
181 --
182 --  Post Success:
183 --    Continue processing.
184 --
185 --  Post Failure:
186 --    Application error is raised and processing is terminated.
187 --
188 --  Access Status:
189 --    Internal Row Handler Use Only.
190 --
191 procedure chk_parent_organization_id
192 (p_effective_date         in date
193 ,p_business_group_id      in number
194 ,p_parent_organization_id in number) is
195   --
196   --
197   -- Local Cursors.
198   --
199   cursor c_valid_hr_org
200     (p_organization_id in number) is
201     select organization_id
202     from   hr_organization_information
203     where  organization_id         = p_organization_id
204       and  org_information_context = 'CLASS'
205       and  org_information1        = 'HR_ORG'
206       and  org_information2        = 'Y';
207   --
208   --
209   -- Local Variables.
210   --
211   l_proc   varchar2(72) :=  g_package || 'chk_parent_organization_id';
212   l_org_id number;
213 begin
214   hr_utility.set_location('Entering:'|| l_proc, 10);
215   --
216   --
217   -- Check mandatory parameters have been set
218   --
219   hr_api.mandatory_arg_error
220     (p_api_name       => l_proc
221     ,p_argument       => 'parent_organization_id'
222     ,p_argument_value => p_parent_organization_id);
223   --
224   hr_utility.set_location(l_proc, 20);
225   --
226   --
227   -- Check that the organization is valid on the effective date and it is valid
228   -- for the business group.
229   --
230   open c_valid_org_for_bg_and_date
231     (p_effective_date    => p_effective_date
232     ,p_business_group_id => p_business_group_id
233     ,p_organization_id   => p_parent_organization_id);
234   fetch c_valid_org_for_bg_and_date into l_org_id;
235   if c_valid_org_for_bg_and_date%notfound then
236     close c_valid_org_for_bg_and_date;
237     fnd_message.set_name('PER', 'HR_DE_ORG_BUS_GRP_CHK');
238     fnd_message.raise_error;
239   else
240     close c_valid_org_for_bg_and_date;
241   end if;
242   --
243   hr_utility.set_location(l_proc, 30);
244   --
245   --
246   -- Check that the organization is classified as a HR Organization and it is
247   -- currently enabled.
248   --
249   open c_valid_hr_org
250     (p_organization_id => p_parent_organization_id);
251   fetch c_valid_hr_org into l_org_id;
252   if c_valid_hr_org%notfound then
253     close c_valid_hr_org;
254     fnd_message.set_name('PER', 'HR_DE_ORG_HR_CHK');
255     fnd_message.raise_error;
256   else
257     close c_valid_hr_org;
258   end if;
259   --
260   hr_utility.set_location(' Leaving:'|| l_proc, 40);
261 end chk_parent_organization_id;
262 --
263 --  ---------------------------------------------------------------------------
264 --  |--------------------< chk_child_organization_id >------------------------|
265 --  ---------------------------------------------------------------------------
266 --
267 --  Description:
268 --    Check the following child organization rules...
269 --
270 --    1. It is mandatory.
271 --    2. It belongs to the business group.
272 --    3. It exists at the effective date.
273 --    4. It is classified correctly according to the rules held in the
274 --       HR_DE_ORG_LINK_TYPES_MAPPING table.
275 --
276 --  Pre-conditions:
277 --    None
278 --
279 --  In Arguments:
280 --    p_effective_date
281 --    p_business_group_id
282 --    p_org_link_type
283 --    p_child_organization_id
284 --
285 --  Post Success:
286 --    Continue processing.
287 --
288 --  Post Failure:
289 --    Application error is raised and processing is terminated.
290 --
291 --  Access Status:
292 --    Internal Row Handler Use Only.
293 --
294 procedure chk_child_organization_id
295 (p_effective_date        in date
296 ,p_business_group_id     in number
297 ,p_org_link_type         in varchar2
298 ,p_child_organization_id in number) is
299   --
300   --
301   -- Local Cursors.
302   --
303   cursor c_valid_org_class
304     (p_organization_id in number
305     ,p_org_link_type   in varchar2) is
306     select organization_id
307     from   hr_organization_information  inf
308           ,hr_de_org_link_types_mapping map
309     where  inf.organization_id         = p_organization_id
310       and  inf.org_information_context = 'CLASS'
311       and  inf.org_information2        = 'Y'
312       and  inf.org_information1        = map.org_class
313       and  map.org_link_type           = p_org_link_type;
314   --
315   --
316   -- Local Variables.
317   --
318   l_proc   varchar2(72) :=  g_package || 'chk_child_organization_id';
319   l_org_id number;
320 begin
321   hr_utility.set_location('Entering:'|| l_proc, 10);
322   --
323   --
324   -- Check mandatory parameters have been set
325   --
326   hr_api.mandatory_arg_error
327     (p_api_name       => l_proc
328     ,p_argument       => 'child_organization_id'
329     ,p_argument_value => p_child_organization_id);
330   --
331   hr_utility.set_location(l_proc, 20);
332   --
333   --
334   -- Check that the organization is valid on the effective date and it is valid
335   -- for the business group.
336   --
337   open c_valid_org_for_bg_and_date
338     (p_effective_date    => p_effective_date
339     ,p_business_group_id => p_business_group_id
340     ,p_organization_id   => p_child_organization_id);
341   fetch c_valid_org_for_bg_and_date into l_org_id;
342   if c_valid_org_for_bg_and_date%notfound then
343     close c_valid_org_for_bg_and_date;
344     fnd_message.set_name('PER', 'HR_DE_ORG_CHILD_BUS_GRP_CHK');
345     fnd_message.raise_error;
346   else
347     close c_valid_org_for_bg_and_date;
348   end if;
349   --
350   hr_utility.set_location(l_proc, 30);
351   --
352   --
353   -- Check that the organization is classified correctly as per the rules held in the
354   -- table HR_DE_ORG_LINK_TYPES_MAPPING and it is currently enabled.
355   --
356   open c_valid_org_class
357     (p_organization_id => p_child_organization_id
358     ,p_org_link_type   => p_org_link_type);
359   fetch c_valid_org_class into l_org_id;
360   if c_valid_org_class%notfound then
361     close c_valid_org_class;
362     fnd_message.set_name('PER', 'HR_DE_ORG_CHILD_CLASS_CHK');
363     fnd_message.raise_error;
364   else
365     close c_valid_org_class;
366   end if;
367   --
368   hr_utility.set_location(' Leaving:'|| l_proc, 40);
369 end chk_child_organization_id;
370 --
371 --  ---------------------------------------------------------------------------
372 --  |-----------------------< chk_org_link_type >-----------------------------|
373 --  ---------------------------------------------------------------------------
374 --
375 --  Description:
376 --    Check the following org link type rules...
377 --
378 --    1. It is mandatory.
379 --    2. It is valid value from the lookup type 'DE_LINK_TYPE'.
380 --
381 --  Pre-conditions:
382 --    None
383 --
384 --  In Arguments:
385 --    p_effective_date
386 --    p_org_link_type
387 --
388 --  Post Success:
389 --    Continue processing.
390 --
391 --  Post Failure:
392 --    Application error is raised and processing is terminated.
393 --
394 --  Access Status:
395 --    Internal Row Handler Use Only.
396 --
397 procedure chk_org_link_type
398 (p_effective_date in     date
399 ,p_org_link_type  in varchar2) is
400   --
401   --
402   -- Local variables.
403   --
404   l_proc varchar2(72) := g_package || 'chk_org_link_type';
405 begin
406   hr_utility.set_location('Entering:'|| l_proc, 10);
407   --
408   --
409   -- Check mandatory parameters have been set
410   --
411   hr_api.mandatory_arg_error
412     (p_api_name       => l_proc
413     ,p_argument       => 'org_link_type'
414     ,p_argument_value => p_org_link_type);
415   --
416   hr_utility.set_location(l_proc, 20);
417   --
418   --
419   -- Check that the org link type exists in hr_lookups for the
420   -- lookup type 'DE_LINK_TYPE'.
421   --
422   if hr_api.not_exists_in_hr_lookups
423        (p_effective_date => p_effective_date
424        ,p_lookup_type    => 'DE_LINK_TYPE'
425        ,p_lookup_code    => p_org_link_type) then
426     hr_utility.set_message(800, 'HR_DE_LINK_TYPE_CHK');
427     hr_utility.raise_error;
428   end if;
429   --
430   hr_utility.set_location(' Leaving:'|| l_proc, 30);
431 end chk_org_link_type;
432 --
433 --  ---------------------------------------------------------------------------
434 --  |--------------------< chk_parent_child_org_ids >-------------------------|
435 --  ---------------------------------------------------------------------------
436 --
437 --  Description:
438 --    Check the following parent / child organization rules...
439 --
440 --    1. The parent and child organization cannot be the same organization.
441 --
442 --  Pre-conditions:
443 --    None
444 --
445 --  In Arguments:
446 --    p_parent_organization_id
447 --    p_child_organization_id
448 --
449 --  Post Success:
450 --    Continue processing.
451 --
452 --  Post Failure:
453 --    Application error is raised and processing is terminated.
454 --
455 --  Access Status:
456 --    Internal Row Handler Use Only.
457 --
458 procedure chk_parent_child_org_ids
459 (p_parent_organization_id in number
460 ,p_child_organization_id  in number) is
461   --
462   --
463   -- Local variables.
464   --
465   l_proc varchar2(72) := g_package || 'chk_parent_child_org_ids';
466 begin
467   hr_utility.set_location('Entering:'|| l_proc, 10);
468   --
469   --
470   -- Check that the organizations are not the same.
471   --
472   if p_parent_organization_id = p_child_organization_id THEN
473     hr_utility.set_message(800, 'HR_DE_ORG_SAME_CHK');
474     hr_utility.raise_error;
475   end if;
476   --
477   hr_utility.set_location(' Leaving:'|| l_proc, 30);
478 end chk_parent_child_org_ids;
479 --
480 --  ---------------------------------------------------------------------------
481 --  |--------------------< chk_localisation_installed >-----------------------|
482 --  ---------------------------------------------------------------------------
483 --
484 --  Description:
485 --    Check the following installation rules...
486 --
487 --    1. The German HR localisation must have been installed.
488 --    2. The business group must have a legislation code of 'DE'.
489 --
490 --  Pre-conditions:
491 --    None
492 --
493 --  In Arguments:
494 --    p_business_group_id
495 --
496 --  Post Success:
497 --    Continue processing.
498 --
499 --  Post Failure:
500 --    Application error is raised and processing is terminated.
501 --
502 --  Access Status:
503 --    Internal Row Handler Use Only.
504 --
505 procedure chk_localisation_installed
506 (p_business_group_id in number) is
507   --
508   --
509   -- Local Cursors.
510   --
511   cursor c_valid_legislation
512     (p_business_group_id in number) is
513     select null
514     from   per_business_groups
515     where  business_group_id = p_business_group_id
516       and  legislation_code  = 'DE';
517   --
518   --
519   -- Local variables.
520   --
521   l_proc  varchar2(72) := g_package || 'chk_localisation_installed';
522   l_dummy varchar2(2000);
523 begin
524   hr_utility.set_location('Entering:'|| l_proc, 10);
525   --
526   --
527   -- Check that the German HR localisation has been installed.
528   --
529   if not hr_utility.chk_product_install('Oracle Human Resources', 'DE') then
530     hr_utility.set_message(800, 'HR_DE_LOC_INSTALL_CHK');
531     hr_utility.raise_error;
532   end if;
533   --
534   hr_utility.set_location(l_proc, 20);
535   --
536   --
537   -- Check that the business group has a legislation code of 'DE' ie. Germany.
538   --
539   open c_valid_legislation
540     (p_business_group_id => p_business_group_id);
541   fetch c_valid_legislation into l_dummy;
542   if c_valid_legislation%notfound then
543     close c_valid_legislation;
544     fnd_message.set_name('PER', 'HR_DE_BUS_GRP_LEG_CHK');
545     fnd_message.raise_error;
546   else
547     close c_valid_legislation;
548   end if;
549   --
550   hr_utility.set_location(' Leaving:'|| l_proc, 30);
551 end chk_localisation_installed;
552 --
553 --  ---------------------------------------------------------------------------
554 --  |--------------------< chk_org_link_info_category >-----------------------|
555 --  ---------------------------------------------------------------------------
556 --
557 --  Description:
558 --    Check the following org link info category rules...
559 --
560 --    1. If the information category is not null then it must match the link type.
561 --    2. If the link type is either 'DE_SOCIAL_INSURANCE' or 'DE_LIABILITY_INSURANCE'
562 --       then the information category must match it.
563 --
564 --  Pre-conditions:
565 --    None
566 --
567 --  In Arguments:
568 --    p_org_link_type
569 --    p_org_link_info_category
570 --
571 --  Post Success:
572 --    Continue processing.
573 --
574 --  Post Failure:
575 --    Application error is raised and processing is terminated.
576 --
577 --  Access Status:
578 --    Internal Row Handler Use Only.
579 --
580 procedure chk_org_link_info_category
581 (p_org_link_type          in varchar2
582 ,p_org_link_info_category in varchar2) is
583   --
584   --
585   -- Local variables.
586   --
587   l_proc varchar2(72) := g_package || 'chk_org_link_info_category';
588 begin
589   hr_utility.set_location('Entering:'|| l_proc, 10);
590   --
591   --
592   -- If the information category is not null then check that the information category
593   -- matches the link type.
594   --
595   if p_org_link_info_category is not null then
596     if not (p_org_link_info_category = p_org_link_type) then
597       fnd_message.set_name('PER', 'HR_DE_LINK_TYPE_ORG_INFO_CHK');
598       fnd_message.raise_error;
599     end if;
600   end if;
601   --
602   hr_utility.set_location(l_proc, 20);
603   --
604   --
605   -- Check that the information category matches the link type if the link type is either
606   -- 'DE_SOCIAL_INSURANCE' or 'DE_LIABILITY_INSURANCE'.
607   --
608   if p_org_link_type in ('DE_SOCIAL_INSURANCE', 'DE_LIABILITY_INSURANCE') then
609     if not (nvl(p_org_link_info_category, hr_api.g_varchar2) = p_org_link_type) then
610       fnd_message.set_name('PER', 'HR_DE_LINK_TYPE_MAN_CHK');
611       fnd_message.raise_error;
612     end if;
613   end if;
614   --
615   hr_utility.set_location(' Leaving:'|| l_proc, 50);
616 end chk_org_link_info_category;
617 --
618 --  ---------------------------------------------------------------------------
619 --  |-------------------< chk_organization_link_delete >----------------------|
620 --  ---------------------------------------------------------------------------
621 --
622 --  Description:
623 --    Check the following delete rules...
624 --
625 --    1. Cannot delete the record if the link type is 'DE_LIABILITY_INSURANCE'.
626 --
627 --  Pre-conditions:
628 --    None
629 --
630 --  In Arguments:
631 --    p_org_link_type
632 --
633 --  Post Success:
634 --    Continue processing.
635 --
636 --  Post Failure:
637 --    Application error is raised and processing is terminated.
638 --
639 --  Access Status:
640 --    Internal Row Handler Use Only.
641 --
642 procedure chk_organization_link_delete
643 (p_org_link_type in varchar2) is
644   --
645   --
646   -- Local variables.
647   --
648   l_proc varchar2(72) := g_package || 'chk_organization_link_delete';
649 begin
650   hr_utility.set_location('Entering:'|| l_proc, 10);
651   --
652   --
653   -- Cannot delete the record when it is for a liability insurance provider.
654   --
655   if p_org_link_type = 'DE_LIABILITY_INSURANCE' then
656     fnd_message.set_name('PER', 'HR_DE_CANT_DEL_LIABILITY_INS');
657     fnd_message.raise_error;
658   end if;
659   --
660   hr_utility.set_location(' Leaving:'|| l_proc, 20);
661 end chk_organization_link_delete;
662 --
666 --
663 -- ----------------------------------------------------------------------------
664 -- |-----------------------------< chk_ddf >----------------------------------|
665 -- ----------------------------------------------------------------------------
667 -- Description:
668 --   Validates all the Developer Descriptive Flexfield values.
669 --
670 -- Prerequisites:
671 --   All other columns have been validated.  Must be called as the
672 --   last step from insert_validate and update_validate.
673 --
674 -- In Arguments:
675 --   p_rec
676 --
677 -- Post Success:
678 --   If the Developer Descriptive Flexfield structure column and data values
679 --   are all valid this procedure will end normally and processing will
680 --   continue.
681 --
682 -- Post Failure:
683 --   If the Developer Descriptive Flexfield structure column value or any of
684 --   the data values are invalid then an application error is raised as
685 --   a PL/SQL exception.
686 --
687 -- Access Status:
688 --   Internal Row Handler Use Only.
689 --
690 -- ----------------------------------------------------------------------------
691 procedure chk_ddf
692   (p_rec in hr_ord_shd.g_rec_type
693   ) is
694 --
695   l_proc   varchar2(72) := g_package || 'chk_ddf';
696 --
697 begin
698   hr_utility.set_location('Entering:'||l_proc,10);
699   --
700   if ((p_rec.organization_link_id is not null)  and (
701     nvl(hr_ord_shd.g_old_rec.org_link_information_category, hr_api.g_varchar2) <>
702     nvl(p_rec.org_link_information_category, hr_api.g_varchar2)  or
703     nvl(hr_ord_shd.g_old_rec.org_link_information1, hr_api.g_varchar2) <>
704     nvl(p_rec.org_link_information1, hr_api.g_varchar2)  or
705     nvl(hr_ord_shd.g_old_rec.org_link_information2, hr_api.g_varchar2) <>
706     nvl(p_rec.org_link_information2, hr_api.g_varchar2)  or
707     nvl(hr_ord_shd.g_old_rec.org_link_information3, hr_api.g_varchar2) <>
708     nvl(p_rec.org_link_information3, hr_api.g_varchar2)  or
709     nvl(hr_ord_shd.g_old_rec.org_link_information4, hr_api.g_varchar2) <>
710     nvl(p_rec.org_link_information4, hr_api.g_varchar2)  or
711     nvl(hr_ord_shd.g_old_rec.org_link_information5, hr_api.g_varchar2) <>
712     nvl(p_rec.org_link_information5, hr_api.g_varchar2)  or
713     nvl(hr_ord_shd.g_old_rec.org_link_information6, hr_api.g_varchar2) <>
714     nvl(p_rec.org_link_information6, hr_api.g_varchar2)  or
715     nvl(hr_ord_shd.g_old_rec.org_link_information7, hr_api.g_varchar2) <>
716     nvl(p_rec.org_link_information7, hr_api.g_varchar2)  or
717     nvl(hr_ord_shd.g_old_rec.org_link_information8, hr_api.g_varchar2) <>
718     nvl(p_rec.org_link_information8, hr_api.g_varchar2)  or
719     nvl(hr_ord_shd.g_old_rec.org_link_information9, hr_api.g_varchar2) <>
720     nvl(p_rec.org_link_information9, hr_api.g_varchar2)  or
721     nvl(hr_ord_shd.g_old_rec.org_link_information10, hr_api.g_varchar2) <>
722     nvl(p_rec.org_link_information10, hr_api.g_varchar2)  or
723     nvl(hr_ord_shd.g_old_rec.org_link_information11, hr_api.g_varchar2) <>
724     nvl(p_rec.org_link_information11, hr_api.g_varchar2)  or
725     nvl(hr_ord_shd.g_old_rec.org_link_information12, hr_api.g_varchar2) <>
726     nvl(p_rec.org_link_information12, hr_api.g_varchar2)  or
727     nvl(hr_ord_shd.g_old_rec.org_link_information13, hr_api.g_varchar2) <>
728     nvl(p_rec.org_link_information13, hr_api.g_varchar2)  or
729     nvl(hr_ord_shd.g_old_rec.org_link_information14, hr_api.g_varchar2) <>
730     nvl(p_rec.org_link_information14, hr_api.g_varchar2)  or
731     nvl(hr_ord_shd.g_old_rec.org_link_information15, hr_api.g_varchar2) <>
732     nvl(p_rec.org_link_information15, hr_api.g_varchar2)  or
733     nvl(hr_ord_shd.g_old_rec.org_link_information16, hr_api.g_varchar2) <>
734     nvl(p_rec.org_link_information16, hr_api.g_varchar2)  or
735     nvl(hr_ord_shd.g_old_rec.org_link_information17, hr_api.g_varchar2) <>
736     nvl(p_rec.org_link_information17, hr_api.g_varchar2)  or
737     nvl(hr_ord_shd.g_old_rec.org_link_information18, hr_api.g_varchar2) <>
738     nvl(p_rec.org_link_information18, hr_api.g_varchar2)  or
739     nvl(hr_ord_shd.g_old_rec.org_link_information19, hr_api.g_varchar2) <>
740     nvl(p_rec.org_link_information19, hr_api.g_varchar2)  or
741     nvl(hr_ord_shd.g_old_rec.org_link_information20, hr_api.g_varchar2) <>
742     nvl(p_rec.org_link_information20, hr_api.g_varchar2)  or
743     nvl(hr_ord_shd.g_old_rec.org_link_information21, hr_api.g_varchar2) <>
744     nvl(p_rec.org_link_information21, hr_api.g_varchar2)  or
745     nvl(hr_ord_shd.g_old_rec.org_link_information22, hr_api.g_varchar2) <>
746     nvl(p_rec.org_link_information22, hr_api.g_varchar2)  or
747     nvl(hr_ord_shd.g_old_rec.org_link_information23, hr_api.g_varchar2) <>
748     nvl(p_rec.org_link_information23, hr_api.g_varchar2)  or
749     nvl(hr_ord_shd.g_old_rec.org_link_information24, hr_api.g_varchar2) <>
750     nvl(p_rec.org_link_information24, hr_api.g_varchar2)  or
751     nvl(hr_ord_shd.g_old_rec.org_link_information25, hr_api.g_varchar2) <>
752     nvl(p_rec.org_link_information25, hr_api.g_varchar2)  or
753     nvl(hr_ord_shd.g_old_rec.org_link_information26, hr_api.g_varchar2) <>
754     nvl(p_rec.org_link_information26, hr_api.g_varchar2)  or
755     nvl(hr_ord_shd.g_old_rec.org_link_information27, hr_api.g_varchar2) <>
756     nvl(p_rec.org_link_information27, hr_api.g_varchar2)  or
757     nvl(hr_ord_shd.g_old_rec.org_link_information28, hr_api.g_varchar2) <>
758     nvl(p_rec.org_link_information28, hr_api.g_varchar2)  or
759     nvl(hr_ord_shd.g_old_rec.org_link_information29, hr_api.g_varchar2) <>
760     nvl(p_rec.org_link_information29, hr_api.g_varchar2)  or
761     nvl(hr_ord_shd.g_old_rec.org_link_information30, hr_api.g_varchar2) <>
762     nvl(p_rec.org_link_information30, hr_api.g_varchar2) ))
763     or (p_rec.organization_link_id is null)  then
764     --
768     -- b) During insert.
765     -- Only execute the validation if absolutely necessary:
766     -- a) During update, the structure column value or any
767     --    of the attribute values have actually changed.
769     --
770     hr_dflex_utility.ins_or_upd_descflex_attribs
771       (p_appl_short_name                 => 'PER'
772       ,p_descflex_name                   => 'Organization Links DF'
773       ,p_attribute_category              => p_rec.org_link_information_category
774       ,p_attribute1_name                 => 'ORG_LINK_INFORMATION1'
775       ,p_attribute1_value                => p_rec.org_link_information1
776       ,p_attribute2_name                 => 'ORG_LINK_INFORMATION2'
777       ,p_attribute2_value                => p_rec.org_link_information2
778       ,p_attribute3_name                 => 'ORG_LINK_INFORMATION3'
779       ,p_attribute3_value                => p_rec.org_link_information3
780       ,p_attribute4_name                 => 'ORG_LINK_INFORMATION4'
781       ,p_attribute4_value                => p_rec.org_link_information4
782       ,p_attribute5_name                 => 'ORG_LINK_INFORMATION5'
783       ,p_attribute5_value                => p_rec.org_link_information5
784       ,p_attribute6_name                 => 'ORG_LINK_INFORMATION6'
785       ,p_attribute6_value                => p_rec.org_link_information6
786       ,p_attribute7_name                 => 'ORG_LINK_INFORMATION7'
787       ,p_attribute7_value                => p_rec.org_link_information7
788       ,p_attribute8_name                 => 'ORG_LINK_INFORMATION8'
789       ,p_attribute8_value                => p_rec.org_link_information8
790       ,p_attribute9_name                 => 'ORG_LINK_INFORMATION9'
791       ,p_attribute9_value                => p_rec.org_link_information9
792       ,p_attribute10_name                => 'ORG_LINK_INFORMATION10'
793       ,p_attribute10_value               => p_rec.org_link_information10
794       ,p_attribute11_name                => 'ORG_LINK_INFORMATION11'
795       ,p_attribute11_value               => p_rec.org_link_information11
796       ,p_attribute12_name                => 'ORG_LINK_INFORMATION12'
797       ,p_attribute12_value               => p_rec.org_link_information12
798       ,p_attribute13_name                => 'ORG_LINK_INFORMATION13'
799       ,p_attribute13_value               => p_rec.org_link_information13
800       ,p_attribute14_name                => 'ORG_LINK_INFORMATION14'
801       ,p_attribute14_value               => p_rec.org_link_information14
802       ,p_attribute15_name                => 'ORG_LINK_INFORMATION15'
803       ,p_attribute15_value               => p_rec.org_link_information15
804       ,p_attribute16_name                => 'ORG_LINK_INFORMATION16'
805       ,p_attribute16_value               => p_rec.org_link_information16
806       ,p_attribute17_name                => 'ORG_LINK_INFORMATION17'
807       ,p_attribute17_value               => p_rec.org_link_information17
808       ,p_attribute18_name                => 'ORG_LINK_INFORMATION18'
809       ,p_attribute18_value               => p_rec.org_link_information18
810       ,p_attribute19_name                => 'ORG_LINK_INFORMATION19'
811       ,p_attribute19_value               => p_rec.org_link_information19
812       ,p_attribute20_name                => 'ORG_LINK_INFORMATION20'
813       ,p_attribute20_value               => p_rec.org_link_information20
814       ,p_attribute21_name                => 'ORG_LINK_INFORMATION21'
815       ,p_attribute21_value               => p_rec.org_link_information21
816       ,p_attribute22_name                => 'ORG_LINK_INFORMATION22'
817       ,p_attribute22_value               => p_rec.org_link_information22
818       ,p_attribute23_name                => 'ORG_LINK_INFORMATION23'
819       ,p_attribute23_value               => p_rec.org_link_information23
820       ,p_attribute24_name                => 'ORG_LINK_INFORMATION24'
821       ,p_attribute24_value               => p_rec.org_link_information24
822       ,p_attribute25_name                => 'ORG_LINK_INFORMATION25'
823       ,p_attribute25_value               => p_rec.org_link_information25
824       ,p_attribute26_name                => 'ORG_LINK_INFORMATION26'
825       ,p_attribute26_value               => p_rec.org_link_information26
826       ,p_attribute27_name                => 'ORG_LINK_INFORMATION27'
827       ,p_attribute27_value               => p_rec.org_link_information27
828       ,p_attribute28_name                => 'ORG_LINK_INFORMATION28'
829       ,p_attribute28_value               => p_rec.org_link_information28
830       ,p_attribute29_name                => 'ORG_LINK_INFORMATION29'
831       ,p_attribute29_value               => p_rec.org_link_information29
832       ,p_attribute30_name                => 'ORG_LINK_INFORMATION30'
833       ,p_attribute30_value               => p_rec.org_link_information30
834       );
835   end if;
836   --
837   hr_utility.set_location(' Leaving:'||l_proc,20);
838 end chk_ddf;
839 --
840 -- ----------------------------------------------------------------------------
841 -- |------------------------------< chk_df >----------------------------------|
842 -- ----------------------------------------------------------------------------
843 --
844 -- Description:
845 --   Validates all the Descriptive Flexfield values.
846 --
847 -- Prerequisites:
848 --   All other columns have been validated.  Must be called as the
849 --   last step from insert_validate and update_validate.
850 --
851 -- In Arguments:
852 --   p_rec
853 --
854 -- Post Success:
855 --   If the Descriptive Flexfield structure column and data values are
856 --   all valid this procedure will end normally and processing will
857 --   continue.
858 --
859 -- Post Failure:
860 --   If the Descriptive Flexfield structure column value or any of
861 --   the data values are invalid then an application error is raised as
862 --   a PL/SQL exception.
863 --
864 -- Access Status:
868 procedure chk_df
865 --   Internal Row Handler Use Only.
866 --
867 -- ----------------------------------------------------------------------------
869   (p_rec in hr_ord_shd.g_rec_type
870   ) is
871 --
872   l_proc   varchar2(72) := g_package || 'chk_df';
873 --
874 begin
875   hr_utility.set_location('Entering:'||l_proc,10);
876   --
877   if ((p_rec.organization_link_id is not null)  and (
878     nvl(hr_ord_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
879     nvl(p_rec.attribute_category, hr_api.g_varchar2)  or
880     nvl(hr_ord_shd.g_old_rec.attribute1, hr_api.g_varchar2) <>
881     nvl(p_rec.attribute1, hr_api.g_varchar2)  or
882     nvl(hr_ord_shd.g_old_rec.attribute2, hr_api.g_varchar2) <>
883     nvl(p_rec.attribute2, hr_api.g_varchar2)  or
884     nvl(hr_ord_shd.g_old_rec.attribute3, hr_api.g_varchar2) <>
885     nvl(p_rec.attribute3, hr_api.g_varchar2)  or
886     nvl(hr_ord_shd.g_old_rec.attribute4, hr_api.g_varchar2) <>
887     nvl(p_rec.attribute4, hr_api.g_varchar2)  or
888     nvl(hr_ord_shd.g_old_rec.attribute5, hr_api.g_varchar2) <>
889     nvl(p_rec.attribute5, hr_api.g_varchar2)  or
890     nvl(hr_ord_shd.g_old_rec.attribute6, hr_api.g_varchar2) <>
891     nvl(p_rec.attribute6, hr_api.g_varchar2)  or
892     nvl(hr_ord_shd.g_old_rec.attribute7, hr_api.g_varchar2) <>
893     nvl(p_rec.attribute7, hr_api.g_varchar2)  or
894     nvl(hr_ord_shd.g_old_rec.attribute8, hr_api.g_varchar2) <>
895     nvl(p_rec.attribute8, hr_api.g_varchar2)  or
896     nvl(hr_ord_shd.g_old_rec.attribute9, hr_api.g_varchar2) <>
897     nvl(p_rec.attribute9, hr_api.g_varchar2)  or
898     nvl(hr_ord_shd.g_old_rec.attribute10, hr_api.g_varchar2) <>
899     nvl(p_rec.attribute10, hr_api.g_varchar2)  or
900     nvl(hr_ord_shd.g_old_rec.attribute11, hr_api.g_varchar2) <>
901     nvl(p_rec.attribute11, hr_api.g_varchar2)  or
902     nvl(hr_ord_shd.g_old_rec.attribute12, hr_api.g_varchar2) <>
903     nvl(p_rec.attribute12, hr_api.g_varchar2)  or
904     nvl(hr_ord_shd.g_old_rec.attribute13, hr_api.g_varchar2) <>
905     nvl(p_rec.attribute13, hr_api.g_varchar2)  or
906     nvl(hr_ord_shd.g_old_rec.attribute14, hr_api.g_varchar2) <>
907     nvl(p_rec.attribute14, hr_api.g_varchar2)  or
908     nvl(hr_ord_shd.g_old_rec.attribute15, hr_api.g_varchar2) <>
909     nvl(p_rec.attribute15, hr_api.g_varchar2)  or
910     nvl(hr_ord_shd.g_old_rec.attribute16, hr_api.g_varchar2) <>
911     nvl(p_rec.attribute16, hr_api.g_varchar2)  or
912     nvl(hr_ord_shd.g_old_rec.attribute17, hr_api.g_varchar2) <>
913     nvl(p_rec.attribute17, hr_api.g_varchar2)  or
914     nvl(hr_ord_shd.g_old_rec.attribute18, hr_api.g_varchar2) <>
915     nvl(p_rec.attribute18, hr_api.g_varchar2)  or
916     nvl(hr_ord_shd.g_old_rec.attribute19, hr_api.g_varchar2) <>
917     nvl(p_rec.attribute19, hr_api.g_varchar2)  or
918     nvl(hr_ord_shd.g_old_rec.attribute20, hr_api.g_varchar2) <>
919     nvl(p_rec.attribute20, hr_api.g_varchar2)  or
920     nvl(hr_ord_shd.g_old_rec.attribute21, hr_api.g_varchar2) <>
921     nvl(p_rec.attribute21, hr_api.g_varchar2)  or
922     nvl(hr_ord_shd.g_old_rec.attribute22, hr_api.g_varchar2) <>
923     nvl(p_rec.attribute22, hr_api.g_varchar2)  or
924     nvl(hr_ord_shd.g_old_rec.attribute23, hr_api.g_varchar2) <>
925     nvl(p_rec.attribute23, hr_api.g_varchar2)  or
926     nvl(hr_ord_shd.g_old_rec.attribute24, hr_api.g_varchar2) <>
927     nvl(p_rec.attribute24, hr_api.g_varchar2)  or
928     nvl(hr_ord_shd.g_old_rec.attribute25, hr_api.g_varchar2) <>
929     nvl(p_rec.attribute25, hr_api.g_varchar2)  or
930     nvl(hr_ord_shd.g_old_rec.attribute26, hr_api.g_varchar2) <>
931     nvl(p_rec.attribute26, hr_api.g_varchar2)  or
932     nvl(hr_ord_shd.g_old_rec.attribute27, hr_api.g_varchar2) <>
933     nvl(p_rec.attribute27, hr_api.g_varchar2)  or
934     nvl(hr_ord_shd.g_old_rec.attribute28, hr_api.g_varchar2) <>
935     nvl(p_rec.attribute28, hr_api.g_varchar2)  or
936     nvl(hr_ord_shd.g_old_rec.attribute29, hr_api.g_varchar2) <>
937     nvl(p_rec.attribute29, hr_api.g_varchar2)  or
938     nvl(hr_ord_shd.g_old_rec.attribute30, hr_api.g_varchar2) <>
939     nvl(p_rec.attribute30, hr_api.g_varchar2) ))
940     or (p_rec.organization_link_id is null)  then
941     --
942     -- Only execute the validation if absolutely necessary:
943     -- a) During update, the structure column value or any
944     --    of the attribute values have actually changed.
945     -- b) During insert.
946     --
947     hr_dflex_utility.ins_or_upd_descflex_attribs
948       (p_appl_short_name                 => 'PER'
949       ,p_descflex_name                   => 'HR_DE_ORGANIZATION_LINKS'
950       ,p_attribute_category              => p_rec.attribute_category
951       ,p_attribute1_name                 => 'ATTRIBUTE1'
952       ,p_attribute1_value                => p_rec.attribute1
953       ,p_attribute2_name                 => 'ATTRIBUTE2'
954       ,p_attribute2_value                => p_rec.attribute2
955       ,p_attribute3_name                 => 'ATTRIBUTE3'
956       ,p_attribute3_value                => p_rec.attribute3
957       ,p_attribute4_name                 => 'ATTRIBUTE4'
958       ,p_attribute4_value                => p_rec.attribute4
959       ,p_attribute5_name                 => 'ATTRIBUTE5'
960       ,p_attribute5_value                => p_rec.attribute5
961       ,p_attribute6_name                 => 'ATTRIBUTE6'
962       ,p_attribute6_value                => p_rec.attribute6
963       ,p_attribute7_name                 => 'ATTRIBUTE7'
964       ,p_attribute7_value                => p_rec.attribute7
965       ,p_attribute8_name                 => 'ATTRIBUTE8'
966       ,p_attribute8_value                => p_rec.attribute8
967       ,p_attribute9_name                 => 'ATTRIBUTE9'
968       ,p_attribute9_value                => p_rec.attribute9
969       ,p_attribute10_name                => 'ATTRIBUTE10'
973       ,p_attribute12_name                => 'ATTRIBUTE12'
970       ,p_attribute10_value               => p_rec.attribute10
971       ,p_attribute11_name                => 'ATTRIBUTE11'
972       ,p_attribute11_value               => p_rec.attribute11
974       ,p_attribute12_value               => p_rec.attribute12
975       ,p_attribute13_name                => 'ATTRIBUTE13'
976       ,p_attribute13_value               => p_rec.attribute13
977       ,p_attribute14_name                => 'ATTRIBUTE14'
978       ,p_attribute14_value               => p_rec.attribute14
979       ,p_attribute15_name                => 'ATTRIBUTE15'
980       ,p_attribute15_value               => p_rec.attribute15
981       ,p_attribute16_name                => 'ATTRIBUTE16'
982       ,p_attribute16_value               => p_rec.attribute16
983       ,p_attribute17_name                => 'ATTRIBUTE17'
984       ,p_attribute17_value               => p_rec.attribute17
985       ,p_attribute18_name                => 'ATTRIBUTE18'
986       ,p_attribute18_value               => p_rec.attribute18
987       ,p_attribute19_name                => 'ATTRIBUTE19'
988       ,p_attribute19_value               => p_rec.attribute19
989       ,p_attribute20_name                => 'ATTRIBUTE20'
990       ,p_attribute20_value               => p_rec.attribute20
991       ,p_attribute21_name                => 'ATTRIBUTE21'
992       ,p_attribute21_value               => p_rec.attribute21
993       ,p_attribute22_name                => 'ATTRIBUTE22'
994       ,p_attribute22_value               => p_rec.attribute22
995       ,p_attribute23_name                => 'ATTRIBUTE23'
996       ,p_attribute23_value               => p_rec.attribute23
997       ,p_attribute24_name                => 'ATTRIBUTE24'
998       ,p_attribute24_value               => p_rec.attribute24
999       ,p_attribute25_name                => 'ATTRIBUTE25'
1000       ,p_attribute25_value               => p_rec.attribute25
1001       ,p_attribute26_name                => 'ATTRIBUTE26'
1002       ,p_attribute26_value               => p_rec.attribute26
1003       ,p_attribute27_name                => 'ATTRIBUTE27'
1004       ,p_attribute27_value               => p_rec.attribute27
1005       ,p_attribute28_name                => 'ATTRIBUTE28'
1006       ,p_attribute28_value               => p_rec.attribute28
1007       ,p_attribute29_name                => 'ATTRIBUTE29'
1008       ,p_attribute29_value               => p_rec.attribute29
1009       ,p_attribute30_name                => 'ATTRIBUTE30'
1010       ,p_attribute30_value               => p_rec.attribute30
1011       );
1012   end if;
1013   --
1014   hr_utility.set_location(' Leaving:'||l_proc,20);
1015 end chk_df;
1016 --
1017 -- ----------------------------------------------------------------------------
1018 -- |-----------------------< chk_non_updateable_args >------------------------|
1019 -- ----------------------------------------------------------------------------
1020 -- {Start Of Comments}
1021 --
1022 -- Description:
1023 --   This procedure is used to ensure that non updateable attributes have
1024 --   not been updated. If an attribute has been updated an error is generated.
1025 --
1026 -- Pre Conditions:
1027 --   g_old_rec has been populated with details of the values currently in
1028 --   the database.
1029 --
1030 -- In Arguments:
1031 --   p_rec has been populated with the updated values the user would like the
1032 --   record set to.
1033 --
1034 -- Post Success:
1035 --   Processing continues if all the non updateable attributes have not
1036 --   changed.
1037 --
1038 -- Post Failure:
1039 --   An application error is raised if any of the non updatable attributes
1040 --   have been altered.
1041 --
1042 -- {End Of Comments}
1043 -- ----------------------------------------------------------------------------
1044 Procedure chk_non_updateable_args
1045   (p_effective_date               in date
1046   ,p_rec in hr_ord_shd.g_rec_type
1047   ) IS
1048 --
1049   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
1050   l_error    EXCEPTION;
1051   l_argument varchar2(30);
1052 --
1053 Begin
1054   --
1055   -- Only proceed with the validation if a row exists for the current
1056   -- record in the HR Schema.
1057   --
1058   IF NOT hr_ord_shd.api_updating
1059       (p_organization_link_id                 => p_rec.organization_link_id
1060       ,p_object_version_number                => p_rec.object_version_number
1061       ) THEN
1062      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
1063      fnd_message.set_token('PROCEDURE ', l_proc);
1064      fnd_message.set_token('STEP ', '5');
1065      fnd_message.raise_error;
1066   END IF;
1067   --
1068   if nvl(p_rec.business_group_id, hr_api.g_number) <>
1069      nvl(hr_ord_shd.g_old_rec.business_group_id, hr_api.g_number) then
1070      l_argument := 'business_group_id';
1071      raise l_error;
1072   end if;
1073   --
1074   if nvl(p_rec.parent_organization_id, hr_api.g_number) <>
1075      nvl(hr_ord_shd.g_old_rec.parent_organization_id, hr_api.g_number) then
1076      l_argument := 'parent_organization_id';
1077      raise l_error;
1078   end if;
1079   --
1080   if nvl(p_rec.child_organization_id, hr_api.g_number) <>
1081      nvl(hr_ord_shd.g_old_rec.child_organization_id, hr_api.g_number) then
1082      l_argument := 'child_organization_id';
1083      raise l_error;
1084   end if;
1085   --
1086   if nvl(p_rec.org_link_type, hr_api.g_varchar2) <>
1087      nvl(hr_ord_shd.g_old_rec.org_link_type, hr_api.g_varchar2) then
1088      l_argument := 'org_link_type';
1089      raise l_error;
1090   end if;
1091   --
1092   if nvl(p_rec.org_link_information_category, hr_api.g_varchar2) <>
1093      nvl(hr_ord_shd.g_old_rec.org_link_information_category, hr_api.g_varchar2) then
1094      l_argument := 'org_link_information_category';
1095      raise l_error;
1096   end if;
1097   --
1098   EXCEPTION
1099     WHEN l_error THEN
1100        hr_api.argument_changed_error
1101          (p_api_name => l_proc
1102          ,p_argument => l_argument);
1103     WHEN OTHERS THEN
1104        RAISE;
1105 End chk_non_updateable_args;
1106 --
1107 -- ----------------------------------------------------------------------------
1108 -- |---------------------------< insert_validate >----------------------------|
1109 -- ----------------------------------------------------------------------------
1110 Procedure insert_validate
1111 (p_effective_date in date
1112 ,p_rec            in hr_ord_shd.g_rec_type) is
1113   --
1114   --
1115   -- Local Variables.
1116   --
1117   l_proc varchar2(72) := g_package || 'insert_validate';
1118 Begin
1119   hr_utility.set_location('Entering:'||l_proc, 10);
1120   --
1121   hr_api.validate_bus_grp_id
1122     (p_rec.business_group_id);
1123   --
1124   hr_api.mandatory_arg_error
1125     (p_api_name       => l_proc
1126     ,p_argument       => 'effective_date'
1127     ,p_argument_value => p_effective_date);
1128   --
1129   chk_localisation_installed
1130     (p_business_group_id => p_rec.business_group_id);
1131   --
1132   chk_org_link_type
1133     (p_effective_date => p_effective_date
1134     ,p_org_link_type  => p_rec.org_link_type);
1135   --
1136   chk_parent_organization_id
1137     (p_effective_date         => p_effective_date
1138     ,p_business_group_id      => p_rec.business_group_id
1139     ,p_parent_organization_id => p_rec.parent_organization_id);
1140   --
1141   chk_child_organization_id
1142     (p_effective_date        => p_effective_date
1143     ,p_business_group_id     => p_rec.business_group_id
1144     ,p_org_link_type         => p_rec.org_link_type
1145     ,p_child_organization_id => p_rec.child_organization_id);
1146   --
1147   chk_parent_child_org_ids
1148     (p_parent_organization_id => p_rec.parent_organization_id
1149     ,p_child_organization_id  => p_rec.child_organization_id);
1150   --
1151   chk_org_link_info_category
1152   (p_org_link_type          => p_rec.org_link_type
1153   ,p_org_link_info_category => p_rec.org_link_information_category);
1154   --
1155   hr_ord_bus.chk_ddf
1156     (p_rec);
1157   --
1158   hr_ord_bus.chk_df
1159     (p_rec);
1160   --
1161   hr_utility.set_location(' Leaving:'||l_proc, 10);
1162 End insert_validate;
1163 --
1164 -- ----------------------------------------------------------------------------
1165 -- |---------------------------< update_validate >----------------------------|
1166 -- ----------------------------------------------------------------------------
1167 Procedure update_validate
1168 (p_effective_date in date
1169 ,p_rec            in hr_ord_shd.g_rec_type) is
1170   --
1171   --
1172   -- Local Variables.
1173   --
1174   l_proc varchar2(72) := g_package || 'update_validate';
1175 Begin
1176   hr_utility.set_location('Entering:'||l_proc, 10);
1177   --
1178   --
1179   -- Check mandatory parameters have been set.
1180   --
1181   hr_api.mandatory_arg_error
1182     (p_api_name       => l_proc
1183     ,p_argument       => 'effective_date'
1184     ,p_argument_value => p_effective_date);
1185   --
1186   hr_api.validate_bus_grp_id
1187     (p_rec.business_group_id);
1188   --
1189   chk_non_updateable_args
1190     (p_effective_date => p_effective_date
1191     ,p_rec            => p_rec);
1192   --
1193   hr_ord_bus.chk_ddf
1194     (p_rec);
1195   --
1196   hr_ord_bus.chk_df
1197     (p_rec);
1198   --
1199   hr_utility.set_location(' Leaving:'||l_proc, 10);
1200 End update_validate;
1201 --
1202 -- ----------------------------------------------------------------------------
1203 -- |---------------------------< delete_validate >----------------------------|
1204 -- ----------------------------------------------------------------------------
1205 Procedure delete_validate
1206   (p_rec                          in hr_ord_shd.g_rec_type
1207   ) is
1208 --
1209   l_proc  varchar2(72) := g_package||'delete_validate';
1210 --
1211 Begin
1212   hr_utility.set_location('Entering:'||l_proc, 5);
1213   --
1214   chk_organization_link_delete
1215     (p_org_link_type => p_rec.org_link_type);
1216   --
1217   hr_utility.set_location(' Leaving:'||l_proc, 10);
1218 End delete_validate;
1219 --
1220 end hr_ord_bus;