DBA Data[Home] [Help]

PACKAGE BODY: APPS.AME_ACT_BUS

Source


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