DBA Data[Home] [Help]

PACKAGE BODY: APPS.AME_ATR_BUS

Source


6 -- ----------------------------------------------------------------------------
1 Package Body ame_atr_bus as
2 /* $Header: amatrrhi.pkb 120.3 2005/11/22 03:14 santosin noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
7 --
8 g_package  varchar2(33) := '  ame_atr_bus.';  -- Global package name
9 --
10 --
11 --
12 --  ---------------------------------------------------------------------------
13 --  |----------------------<chk_approver_type_id  >--------------------------|
14 --  ---------------------------------------------------------------------------
15 --
16 --  {Start Of Comments}
17 --
18 -- Description:
19 --   Validates that the approver_type_id field can only be populated if attribute
20 --   type is ame_util.numberAttributeType
21 --   Validates that the approver_type_id if not null, is a foreign key to
22 --   ame_approver_types.approver_type_id.
23 --
24 -- Prerequisites:
25 --   None.
26 --
27 -- In Parameters:
28 --   p_attribute_id
29 --   p_object_version_number
30 --   p_effective_date
31 --   p_approver_type_id
32 --   p_attribute_type
33 --
34 -- Post Success:
35 --   Processing continues.
36 --
37 -- Post Failure:
38 --   Log the error message.
39 --
40 -- Developer Implementation Notes:
41 --   None.
42 --
43 -- Access Status:
44 --   Internal Row Handler Use Only.
45 --
46 -- {End Of Comments}
47 -- ----------------------------------------------------------------------------
48 procedure chk_approver_type_id
49   (p_attribute_id   in number,
50    p_object_version_number in number,
51    p_effective_date        in date,
52    p_approver_type_id in ame_attributes.approver_type_id%type,
53    p_attribute_type in ame_attributes.attribute_type%type) is
54   l_proc              varchar2(72)  :=  g_package||'chk_approver_type_id';
55   tempCount integer;
56   cursor c_sel1 is
57     select null
58       from ame_approver_types
59       where
60         approver_type_id = p_approver_type_id and
61         p_effective_date between start_date and
62                  nvl(end_date - ame_util.oneSecond, p_effective_date) ;
63   l_exists varchar2(1);
64 begin
65   if p_approver_type_id is not null then
66     if p_attribute_type = ame_util.numberAttributeType then
67       open c_sel1;
68       fetch  c_sel1 into l_exists;
69       if c_sel1%notfound then
70         close c_sel1;
71         fnd_message.set_name('PER','AME_400469_INV_APPROVER_TYPE');
72         fnd_message.raise_error;
73       end if;
74       close c_sel1;
75     else
76       fnd_message.set_name('PER','AME_400470_NO_APPROVER_TYPE');
77       fnd_message.raise_error;
78     end if;
79   end if;
80 exception
81    when app_exception.application_exception then
82      if hr_multi_message.exception_add
83        (p_associated_column1 => 'ATTRIBUTE_ID') then
84        hr_utility.set_location(' Leaving:'|| l_proc, 50);
85        raise;
86      end if;
87      hr_utility.set_location(' Leaving:'|| l_proc, 60);
88 end chk_approver_type_id;
89 --
90 --  ---------------------------------------------------------------------------
91 --  |----------------------< chk_attribute_type    >--------------------------|
92 --  ---------------------------------------------------------------------------
93 --
94 --  {Start Of Comments}
95 --
96 -- Description:
97 --   Validates that the attribute type is one of the following:
98 --      ame_util.booleanAttributeType
99 --      ame_util.currencyAttributeType
100 --      ame_util.dateAttributeType
101 --      ame_util.numberAttributeType
102 --      ame_util.stringAttributeType
103 --
104 -- Prerequisites:
105 --   None.
106 --
107 -- In Parameters:
108 --   p_attribute_id
109 --   p_object_version_number
110 --   p_attribute_type
111 --
112 -- Post Success:
113 --   Processing continues if attribute type is valid.
114 --
115 -- Post Failure:
116 --   Log the error message.
120 --
117 --
118 -- Developer Implementation Notes:
119 --   None.
121 -- Access Status:
122 --   Internal Row Handler Use Only.
123 --
124 -- {End Of Comments}
125 -- ----------------------------------------------------------------------------
126 procedure chk_attribute_type
127   (p_attribute_id   in number,
128    p_object_version_number in number,
129    p_attribute_type in ame_attributes.attribute_type%type) is
130   l_proc              varchar2(72)  :=  g_package||'chk_attribute_type';
131 begin
132   if not (p_attribute_type = ame_util.booleanAttributeType or
133           p_attribute_type =  ame_util.currencyAttributeType or
134           p_attribute_type =  ame_util.dateAttributeType or
135           p_attribute_type =  ame_util.numberAttributeType or
136           p_attribute_type =  ame_util.stringAttributeType) then
137      fnd_message.set_name('PER','AME_400471_INV_ATTRIBUTE_TYPE');
138      fnd_message.raise_error;
139   end if;
140 exception
141    when app_exception.application_exception then
142      if hr_multi_message.exception_add
143        (p_associated_column1 => 'ATTRIBUTE_TYPE') then
144        hr_utility.set_location(' Leaving:'|| l_proc, 50);
145        raise;
146      end if;
147      hr_utility.set_location(' Leaving:'|| l_proc, 60);
148 end chk_attribute_type;
149 --  ---------------------------------------------------------------------------
150 --  |----------------------<chk_item_class_id      >--------------------------|
151 --  ---------------------------------------------------------------------------
152 --
153 --  {Start Of Comments}
154 --
155 -- Description:
156 --   Validates that the item_class_id is a foreign key to
157 --   ame_item_classes.item_class_id.
158 --
159 -- Prerequisites:
160 --   None.
161 --
162 -- In Parameters:
163 --   p_attribute_id
164 --   p_object_version_number
165 --   p_effective_date
166 --   p_item_class_id
167 --
168 -- Post Success:
169 --   Processing continues.
170 --
171 -- Post Failure:
172 --   Log the error message.
173 --
174 -- Developer Implementation Notes:
175 --   None.
176 --
177 -- Access Status:
178 --   Internal Row Handler Use Only.
179 --
180 -- {End Of Comments}
181 -- ----------------------------------------------------------------------------
182 procedure chk_item_class_id
183   (p_attribute_id   in number,
184    p_object_version_number in number,
185    p_effective_date        in date,
186    p_item_class_id in ame_attributes.item_class_id%type) is
187   l_proc              varchar2(72)  :=  g_package||'chk_item_class_id';
188   tempCount integer;
189   cursor c_sel1 is
190     select null
191       from ame_item_classes
192       where
193         item_class_id = p_item_class_id and
194         p_effective_date between start_date and
195                  nvl(end_date - ame_util.oneSecond, p_effective_date) ;
196   l_exists varchar2(1);
197 begin
198   open c_sel1;
199   fetch  c_sel1 into l_exists;
200   if c_sel1%notfound then
201     close c_sel1;
202     fnd_message.set_name('PER','AME_400472_INV_ITEM_CLASS');
203     fnd_message.raise_error;
204   end if;
205   close c_sel1;
206 exception
207    when app_exception.application_exception then
208      if hr_multi_message.exception_add
209        (p_associated_column1 => 'ITEM_CLASS_ID') then
210        hr_utility.set_location(' Leaving:'|| l_proc, 50);
211        raise;
212      end if;
213      hr_utility.set_location(' Leaving:'|| l_proc, 60);
214 end chk_item_class_id;
215 --  ---------------------------------------------------------------------------
216 --  |----------------------<           chk_name    >--------------------------|
217 --  ---------------------------------------------------------------------------
218 --
219 --  {Start Of Comments}
220 --
221 -- Description:
222 --   Validates that the attribute name is does not already exist.
223 --
224 -- Prerequisites:
225 --   None.
226 --
227 -- In Parameters:
228 --   p_attribute_id
229 --   p_object_version_number
230 --   p_effective_date
231 --   p_name
232 --
233 -- Post Success:
234 --   Processing continues if attribute name is unique.
235 --
236 -- Post Failure:
237 --   Log the error message.
238 --
239 -- Developer Implementation Notes:
240 --   None.
241 --
242 -- Access Status:
243 --   Internal Row Handler Use Only.
244 --
245 -- {End Of Comments}
246 -- ----------------------------------------------------------------------------
247 procedure chk_name
248   (p_attribute_id   in number,
249    p_object_version_number in number,
250    p_effective_date        in date,
251    p_name in ame_attributes.name%type) is
252   l_proc              varchar2(72)  :=  g_package||'chk_name';
253   tempCount integer;
254   cursor c_sel1 is
255     select count(*)
259         p_effective_date between start_date and
256       from ame_attributes
257       where
258         trim(upper(name)) = trim(upper(p_name)) and
260                  nvl(end_date - ame_util.oneSecond, p_effective_date) ;
261 begin
262   hr_api.mandatory_arg_error
263     (p_api_name       => l_proc
264     ,p_argument       => 'name'
265     ,p_argument_value => p_name
266     );
267   open c_sel1;
268   fetch c_sel1 into tempCount;
269   if c_sel1%found and
270      tempCount > 0 then
271     close c_sel1;
272     fnd_message.set_name('PER','AME_400667_ATT_NAME_EXIST');
273     fnd_message.raise_error;
274   end if;
275   close c_sel1;
276 exception
277    when app_exception.application_exception then
278      if hr_multi_message.exception_add
279        (p_associated_column1 => 'NAME') then
280        hr_utility.set_location(' Leaving:'|| l_proc, 50);
281        raise;
282      end if;
283      hr_utility.set_location(' Leaving:'|| l_proc, 60);
284 end chk_name;
285 --
286 --  ---------------------------------------------------------------------------
287 --  |----------------------<     chk_delete        >--------------------------|
288 --  ---------------------------------------------------------------------------
289 --
290 --  {sTARt Of Comments}
291 --
292 -- Description:
293 --   check that 1. No attribute Usages exist
294 --              2. Attribute is not an existing Mandatory or Required attribute
295 --
296 -- Prerequisites:
297 --   None.
298 --
299 -- In Parameters:
300 --   p_attribute_id
301 --   p_object_version_number
302 --   p_effective_date
303 --
304 -- Post Success:
305 --   Processing continues.
306 --
307 -- Post Failure:
308 --   Log the error message.
309 --
310 -- Developer Implementation Notes:
311 --   None.
312 --
313 -- Access Status:
314 --   Internal Row Handler Use Only.
315 --
316 -- {End Of Comments}
317 -- ----------------------------------------------------------------------------
318 procedure chk_delete
319   (p_attribute_id   in number,
320    p_object_version_number in number,
321    p_effective_date        in date) is
322   l_proc              varchar2(72)  :=  g_package||'chk_delete';
323   tempCount integer;
324   cursor c_sel1 is
325     select null
326       from ame_attribute_usages
327       where
328         attribute_id = p_attribute_id and
329         p_effective_date between start_date and
330                  nvl(end_date - ame_util.oneSecond, p_effective_date) ;
331   cursor c_sel2 is
332     select null
333       from ame_mandatory_attributes
334       where
335         attribute_id = p_attribute_id and
336         p_effective_date between start_date and
337                  nvl(end_date - ame_util.oneSecond, p_effective_date) ;
338   l_exists varchar2(1);
339 begin
340   open c_sel1;
341   fetch  c_sel1 into l_exists;
342   if c_sel1%found then
343     close c_sel1;
344     fnd_message.set_name('PER','AME_400171_ATT_IS_IN_USE');
345     fnd_message.raise_error;
346   end if;
347   close c_sel1;
348   open c_sel2;
349   fetch  c_sel2 into l_exists;
350   if c_sel2%found then
351     close c_sel2;
352     fnd_message.set_name('PER','AME_400170_ATT_MAND_CANT_DEL');
353     fnd_message.raise_error;
354   end if;
355   close c_sel2;
356 exception
357    when app_exception.application_exception then
358      if hr_multi_message.exception_add
359        (p_associated_column1 => 'ATTRIBUTE_ID') then
360        hr_utility.set_location(' Leaving:'|| l_proc, 50);
361        raise;
362      end if;
363      hr_utility.set_location(' Leaving:'|| l_proc, 60);
367 -- |-------------------------< chk_usages_exist >-------------------------|
364 end chk_delete;
365 --
366 -- ----------------------------------------------------------------------------
368 -- ----------------------------------------------------------------------------
369 Procedure chk_usages_exist
370   (p_attribute_id  in  number
371    ,p_start_date       in date
372    ,p_end_date         in date
373   ) is
374 --
375     Cursor C_Sel1 is
376       select count(*)
377         from ame_attribute_usages
378        where attribute_id = p_attribute_id and
382     Cursor C_Sel2 is
379        p_start_date between start_date and
380                  nvl(end_date - ame_util.oneSecond, p_start_date) ;
381 --
383       select count(*)
384         from ame_mandatory_attributes
385        where attribute_id = p_attribute_id
386          and p_start_date between start_date and
387                nvl(end_date - ame_util.oneSecond, p_start_date) ;
388 --
389 --
390     Cursor C_Sel3 is
391       select count(*)
392         from ame_conditions
393        where attribute_id = p_attribute_id
394          and p_start_date between start_date and
395                nvl(end_date - ame_util.oneSecond, p_start_date) ;
396 --
397   l_child_count integer;
398 --
399 --
400 Begin
401   --
402   --
403   -- ame_attribute_usages
404   Open C_Sel1;
405   Fetch C_Sel1 into l_child_count;
406   Close C_Sel1;
407   If l_child_count >0 then
408     fnd_message.set_name('AME','AME_400523_ATT_ATTR_USG_EXIST');
409     fnd_message.set_token('TABLE_NAME','ame_attribute_usages');
410          hr_multi_message.add;
411   End If;
412   -- ame_mandatory_attributes
413   Open C_Sel2;
414   Fetch C_Sel2 into l_child_count;
415   Close C_Sel2;
416   If l_child_count >0 then
417     fnd_message.set_name('AME','AME_400170_ATT_MAND_CANT_DEL');
418     fnd_message.set_token('TABLE_NAME','ame_mandatory_attributes');
419          hr_multi_message.add;
420   End If;
421   -- ame_conditions
422   Open C_Sel3;
423   Fetch C_Sel3 into l_child_count;
424   Close C_Sel3;
425   If l_child_count >0 then
426     fnd_message.set_name('AME','AME_400524_ATT_COND_EXIST');
427     fnd_message.set_token('TABLE_NAME','ame_conditions');
428          hr_multi_message.add;
429   End If;
430 --
431 End chk_usages_exist;
432 --
433 -- ----------------------------------------------------------------------------
434 -- |-----------------------< chk_non_updateable_args >------------------------|
435 -- ----------------------------------------------------------------------------
436 -- {Start Of Comments}
437 --
438 -- Description:
439 --   This procedure is used to ensure that non updateable attributes have
440 --   not been updated. If an attribute has been updated an error is generated.
441 --
442 -- Pre Conditions:
443 --   g_old_rec has been populated with details of the values currently in
444 --   the database.
445 --
446 -- In Arguments:
447 --   p_rec has been populated with the updated values the user would like the
448 --   record set to.
449 --
450 -- Post Success:
451 --   Processing continues if all the non updateable attributes have not
452 --   changed.
453 --
454 -- Post Failure:
458 -- {End Of Comments}
455 --   An application error is raised if any of the non updatable attributes
456 --   have been altered.
457 --
459 -- ----------------------------------------------------------------------------
460 Procedure chk_non_updateable_args
461   (p_effective_date  in date
462   ,p_rec             in ame_atr_shd.g_rec_type
463   ) IS
464 --
465   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
466 --
467 Begin
468   --
469   -- Only proceed with the validation if a row exists for the current
470   -- record in the HR Schema.
471   --
472   IF NOT ame_atr_shd.api_updating
473       (p_attribute_id =>  p_rec.attribute_id
474       ,p_effective_date                   => p_effective_date
475       ,p_object_version_number            => p_rec.object_version_number
476       ) THEN
477      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
478      fnd_message.set_token('PROCEDURE ', l_proc);
479      fnd_message.set_token('STEP ', '5');
480      fnd_message.raise_error;
481   END IF;
482   --
483 if nvl(p_rec.name,hr_api.g_varchar2) <>
484      nvl(ame_atr_shd.g_old_rec.name,hr_api.g_varchar2)
485      then
486        hr_api.argument_changed_error
487          (p_api_name => l_proc
488          ,p_argument => 'NAME'
489          ,p_base_table => ame_atr_shd.g_tab_nam
490          );
491   end if;
492   if nvl(p_rec.attribute_type,hr_api.g_varchar2) <>
493      nvl(ame_atr_shd.g_old_rec.attribute_type,hr_api.g_varchar2)
494      then
495        hr_api.argument_changed_error
496          (p_api_name => l_proc
497          ,p_argument => 'ATTRIBUTE_TYPE'
498          ,p_base_table => ame_atr_shd.g_tab_nam
499          );
500   end if;
501   if nvl(p_rec.approver_type_id,hr_api.g_number) <>
502      nvl(ame_atr_shd.g_old_rec.approver_type_id,hr_api.g_number)
503      then
504        hr_api.argument_changed_error
505          (p_api_name => l_proc
506          ,p_argument => 'APPROVER_TYPE_ID'
507          ,p_base_table => ame_atr_shd.g_tab_nam
508          );
509   end if;
510   if nvl(p_rec.item_class_id,hr_api.g_number) <>
511      nvl(ame_atr_shd.g_old_rec.item_class_id,hr_api.g_number)
512      then
513        hr_api.argument_changed_error
514          (p_api_name => l_proc
515          ,p_argument => 'ITEM_CLASS_ID'
516          ,p_base_table => ame_atr_shd.g_tab_nam
517          );
518   end if;
519 --Added an extra if condition so that no error is thrown when the description for a seeded attribute is modified
520 --using AME Developer responsibility.
521   if ame_utility_pkg.check_seeddb() = 'N' then
522     if nvl(ame_util.seededDataCreatedById,hr_api.g_number) =
523        nvl(ame_utility_pkg.is_seed_user(ame_atr_shd.g_old_rec.created_by),hr_api.g_number) and
524          nvl(p_rec.description,hr_api.g_varchar2) <>
525            nvl(ame_atr_shd.g_old_rec.description,hr_api.g_varchar2)
526        then
527          hr_api.argument_changed_error
528            (p_api_name => l_proc
529            ,p_argument => 'DESCRIPTION'
530            ,p_base_table => ame_atr_shd.g_tab_nam
531            );
532     end if;
533   end if;
534   --
535 End chk_non_updateable_args;
536 --
537 -- ----------------------------------------------------------------------------
538 -- |--------------------------< dt_update_validate >--------------------------|
539 -- ----------------------------------------------------------------------------
540 -- {Start Of Comments}
541 --
542 -- Description:
543 --   This procedure is used for referential integrity of datetracked
544 --   parent entities when a datetrack update operation is taking place
545 --   and where there is no cascading of update defined for this entity.
546 --
547 -- Prerequisites:
548 --   This procedure is called from the update_validate.
549 --
550 -- In Parameters:
551 --
552 -- Post Success:
553 --   Processing continues.
554 --
555 -- Post Failure:
556 --
560 --
557 -- Developer Implementation Notes:
558 --   This procedure should not need maintenance unless the HR Schema model
559 --   changes.
561 -- Access Status:
562 --   Internal Row Handler Use Only.
563 --
564 -- {End Of Comments}
565 -- ----------------------------------------------------------------------------
566 Procedure dt_update_validate
567   (p_datetrack_mode                in varchar2
568   ,p_validation_start_date         in date
569   ,p_validation_end_date           in date
570   ) Is
571 --
572   l_proc  varchar2(72) := g_package||'dt_update_validate';
573 --
574 Begin
575   --
576   -- Ensure that the p_datetrack_mode argument is not null
577   --
578   hr_api.mandatory_arg_error
582     );
579     (p_api_name       => l_proc
580     ,p_argument       => 'datetrack_mode'
581     ,p_argument_value => p_datetrack_mode
583   --
584   -- Mode will be valid, as this is checked at the start of the upd.
585   --
586   -- Ensure the arguments are not null
587   --
588   hr_api.mandatory_arg_error
589     (p_api_name       => l_proc
590     ,p_argument       => 'validation_start_date'
591     ,p_argument_value => p_validation_start_date
592     );
593   --
594   /*hr_api.mandatory_arg_error
595     (p_api_name       => l_proc
596     ,p_argument       => 'validation_end_date'
597     ,p_argument_value => p_validation_end_date
598     );*/
599   --
600 Exception
601   When Others Then
602     --
603     -- An unhandled or unexpected error has occurred which
604     -- we must report
605     --
606     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
607     fnd_message.set_token('PROCEDURE', l_proc);
608     fnd_message.set_token('STEP','15');
609     fnd_message.raise_error;
610 End dt_update_validate;
611 --
612 -- ----------------------------------------------------------------------------
613 -- |--------------------------< dt_delete_validate >--------------------------|
614 -- ----------------------------------------------------------------------------
615 -- {Start Of Comments}
616 --
617 -- Description:
618 --   This procedure is used for referential integrity of datetracked
619 --   child entities when either a datetrack DELETE or ZAP is in operation
620 --   and where there is no cascading of delete defined for this entity.
621 --   For the datetrack mode of DELETE or ZAP we must ensure that no
622 --   datetracked child rows exist between the validation start and end
623 --   dates.
624 --
625 -- Prerequisites:
626 --   This procedure is called from the delete_validate.
627 --
628 -- In Parameters:
629 --
630 -- Post Success:
631 --   Processing continues.
632 --
633 -- Post Failure:
634 --   If a row exists by determining the returning Boolean value from the
635 --   generic dt_api.rows_exist function then we must supply an error via
636 --   the use of the local exception handler l_rows_exist.
637 --
638 -- Developer Implementation Notes:
639 --   This procedure should not need maintenance unless the HR Schema model
640 --   changes.
641 --
642 -- Access Status:
643 --   Internal Row Handler Use Only.
644 --
645 -- {End Of Comments}
646 -- ----------------------------------------------------------------------------
647 Procedure dt_delete_validate
648   (p_attribute_id                     in number
649   ,p_datetrack_mode                   in varchar2
650   ,p_validation_start_date            in date
651   ,p_validation_end_date              in date
652   ) Is
653 --
654   l_proc        varchar2(72)    := g_package||'dt_delete_validate';
655 --
656 Begin
657   --
658   -- Ensure that the p_datetrack_mode argument is not null
659   --
660   hr_api.mandatory_arg_error
661     (p_api_name       => l_proc
662     ,p_argument       => 'datetrack_mode'
663     ,p_argument_value => p_datetrack_mode
664     );
665   --
666   -- Only perform the validation if the datetrack mode is either
667   -- DELETE or ZAP
668   --
669   If (p_datetrack_mode = hr_api.g_delete or
670       p_datetrack_mode = hr_api.g_zap) then
671     --
672     --
673     -- Ensure the arguments are not null
674     --
675     hr_api.mandatory_arg_error
676       (p_api_name       => l_proc
677       ,p_argument       => 'validation_start_date'
678       ,p_argument_value => p_validation_start_date
679       );
680     --
681     /*hr_api.mandatory_arg_error
682       (p_api_name       => l_proc
683       ,p_argument       => 'validation_end_date'
684       ,p_argument_value => p_validation_end_date
685       );*/
686     --
687     hr_api.mandatory_arg_error
688       (p_api_name       => l_proc
689       ,p_argument       => 'attribute_id'
690       ,p_argument_value => p_attribute_id
691       );
692     --
693   ame_atr_bus.chk_usages_exist
694 (p_attribute_id => p_attribute_id
695 ,p_start_date => p_validation_start_date
696 ,p_end_date   => p_validation_end_date);
697 --
698     --
699   End If;
700   --
701 Exception
702   When Others Then
703     --
704     -- An unhandled or unexpected error has occurred which
705     -- we must report
706     --
707     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
708     fnd_message.set_token('PROCEDURE', l_proc);
709     fnd_message.set_token('STEP','15');
710     fnd_message.raise_error;
711   --
712 End dt_delete_validate;
713 --
714 -- ----------------------------------------------------------------------------
715 -- |---------------------------< insert_validate >----------------------------|
716 -- ----------------------------------------------------------------------------
717 Procedure insert_validate
718   (p_rec                   in ame_atr_shd.g_rec_type
719   ,p_effective_date        in date
720   ,p_datetrack_mode        in varchar2
721   ,p_validation_start_date in date
722   ,p_validation_end_date   in date
723   ) is
724 --
725   l_proc        varchar2(72) := g_package||'insert_validate';
726 --
727 Begin
728   hr_utility.set_location('Entering:'||l_proc, 5);
729   --
730   -- Validate Independent Attributes
731   --
732   -- Name
733   chk_name(p_attribute_id => p_rec.attribute_id,
734             p_object_version_number => p_rec.object_version_number,
738   -- attribute_type
735             p_effective_date => p_effective_date,
736             p_name => p_rec.name);
737 
739   chk_attribute_type(p_attribute_id => p_rec.attribute_id,
740                      p_object_version_number => p_rec.object_version_number,
741                      p_attribute_type => p_rec.attribute_type);
742 
746                              p_argument_value => p_rec.description);
743   -- Description
744   hr_api.mandatory_arg_error(p_api_name => l_proc,
745                              p_argument => 'description',
747 
748   -- approver_type_id
749   chk_approver_type_id(p_attribute_id => p_rec.attribute_id,
750                        p_object_version_number => p_rec.object_version_number,
751                        p_effective_date => p_effective_date,
752                        p_approver_type_id => p_rec.approver_type_id,
753                        p_attribute_type => p_rec.attribute_type);
754 
755   -- item_class_id
756   chk_item_class_id(p_attribute_id => p_rec.attribute_id,
757                     p_object_version_number => p_rec.object_version_number,
758                     p_effective_date => p_effective_date,
759                     p_item_class_id => p_rec.item_class_id);
760 
761   hr_utility.set_location(' Leaving:'||l_proc, 10);
762   --
763   hr_utility.set_location(' Leaving:'||l_proc, 10);
764 End insert_validate;
765 --
766 -- ----------------------------------------------------------------------------
767 -- |---------------------------< update_validate >----------------------------|
768 -- ----------------------------------------------------------------------------
769 Procedure update_validate
770   (p_rec                     in ame_atr_shd.g_rec_type
771   ,p_effective_date          in date
772   ,p_datetrack_mode          in varchar2
773   ,p_validation_start_date   in date
774   ,p_validation_end_date     in date
775   ) is
776 --
777   l_proc        varchar2(72) := g_package||'update_validate';
778 --
779 Begin
780   hr_utility.set_location('Entering:'||l_proc, 5);
781   --
782   -- Validate Dependent Attributes
783   --
784   -- Call the datetrack update integrity operation
785   --
786   dt_update_validate
787     (p_datetrack_mode                 => p_datetrack_mode
788     ,p_validation_start_date          => p_validation_start_date
789     ,p_validation_end_date            => p_validation_end_date
790     );
791   --
792   chk_non_updateable_args
793     (p_effective_date  => p_effective_date
794     ,p_rec             => p_rec
795     );
796   --
797   --
798   hr_utility.set_location(' Leaving:'||l_proc, 10);
799 End update_validate;
800 --
801 -- ----------------------------------------------------------------------------
802 -- |---------------------------< delete_validate >----------------------------|
803 -- ----------------------------------------------------------------------------
804 Procedure delete_validate
805   (p_rec                    in ame_atr_shd.g_rec_type
806   ,p_effective_date         in date
807   ,p_datetrack_mode         in varchar2
808   ,p_validation_start_date  in date
809   ,p_validation_end_date    in date
810   ) is
811 --
812   l_proc        varchar2(72) := g_package||'delete_validate';
813 --
814 Begin
815   hr_utility.set_location('Entering:'||l_proc, 5);
816   --
817   -- Call all supporting business operations
818   --
819   --
820   -- check if delete operation is allowed.
821   chk_delete(p_attribute_id => p_rec.attribute_id,
822              p_object_version_number => p_rec.object_version_number,
823              p_effective_date => p_effective_date);
824   --
825   dt_delete_validate
826     (p_datetrack_mode                   => p_datetrack_mode
830     );
827     ,p_validation_start_date            => p_validation_start_date
828     ,p_validation_end_date              => p_validation_end_date
829     ,p_attribute_id =>  p_rec.attribute_id
831   --
832   hr_utility.set_location(' Leaving:'||l_proc, 10);
833 End delete_validate;
834 --
835 end ame_atr_bus;