DBA Data[Home] [Help]

PACKAGE BODY: APPS.AME_ACF_BUS

Source


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