DBA Data[Home] [Help]

PACKAGE BODY: APPS.AME_CON_BUS

Source


1 Package Body ame_con_bus as
2 /* $Header: amconrhi.pkb 120.6 2006/01/12 22:43 pvelugul noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  ame_con_bus.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |-------------------------< CHK_CONDITION_ID >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure checks whether the mandatory column condition_id  has been
17 --   populated or not.
18 --
19 -- Pre-Requisites:
20 --   None
21 --
22 -- In Parameters:
23 --   p_condition_id
24 --
25 -- Post Success:
26 --   Processing continues if a valid condition_id has been entered.
27 --
28 -- Post Failure:
29 --   An application error is raised if the condition_id is undefined.
30 --
31 -- Access Status:
32 --   Internal Row Handler Use Only.
33 --
34 -- {End Of Comments}
35 -- ----------------------------------------------------------------------------
36 procedure chk_condition_id(p_condition_id                     in   number) IS
37 --
38   l_proc     varchar2(72) := g_package || 'CHK_CONDITION_ID';
39 --
40   Begin
41     hr_utility.set_location('Entering:'||l_proc,10);
42     hr_api.mandatory_arg_error(p_api_name           => l_proc
43                               ,p_argument           => 'CONDITION_ID'
44                               ,p_argument_value     => p_condition_id
45                               );
46     hr_utility.set_location(' Leaving:'||l_proc,30);
47   exception
48     when app_exception.application_exception then
49       if hr_multi_message.exception_add
50                        (p_associated_column1 => 'AME_CONDITIONS.CONDITION_ID'
51                        ) then
52         hr_utility.set_location(' Leaving:'||l_proc, 40);
53         raise;
54       end if;
55       hr_utility.set_location(' Leaving:'||l_proc,50);
56   End chk_condition_id;
57 --
58 -- ----------------------------------------------------------------------------
59 -- |-------------------------< CHK_CONDITION_TYPE >---------------------------|
60 -- ----------------------------------------------------------------------------
61 -- {Start Of Comments}
62 --
63 -- Description:
64 --   This procedure validates whether the mandatory column condition_type
65 --   contains a lookup value.
66 --
67 -- Pre-Requisites:
68 --   None
69 --
70 -- In Parameters:
71 --   p_condition_type
72 --
73 -- Post Success:
74 --   Processing continues if a valid condition_type has been entered.
75 --
76 -- Post Failure:
77 --   An application error is raised if the condition_type is not from the
78 --   specified lookup.
79 --
80 -- Access Status:
81 --   Internal Row Handler Use Only.
82 --
83 -- {End Of Comments}
84 -- ----------------------------------------------------------------------------
85 procedure chk_condition_type(p_condition_type                in   varchar2) IS
86 --
87   l_proc     varchar2(72) := g_package || 'CHK_CONDITION_TYPE';
88 --
89   Begin
90     hr_utility.set_location('Entering:'||l_proc,10);
91     hr_api.mandatory_arg_error(p_api_name           => l_proc
92                               ,p_argument           => 'CONDITION_TYPE'
93                               ,p_argument_value     => p_condition_type
94                               );
95     -- Check if the value exist in the lookup list
96     if p_condition_type not in(ame_util.ordinaryConditionType
97                               ,ame_util.exceptionConditionType
98                               ,ame_util.listModConditionType
99                               ) then
100       fnd_message.set_name('PER','AME_400496_INV_CON_TYPE');
101       fnd_message.raise_error;
102     end if;
103     hr_utility.set_location(' Leaving:'||l_proc,30);
104   exception
105     when app_exception.application_exception then
106       if hr_multi_message.exception_add
107                      (p_associated_column1 => 'AME_CONDITIONS.CONDITION_TYPE'
108                      ) then
109         hr_utility.set_location(' Leaving:'||l_proc, 40);
110         raise;
111       end if;
112       hr_utility.set_location( ' Leaving:'||l_proc,50 );
113   End chk_condition_type;
114 --
115 -- ----------------------------------------------------------------------------
116 -- |-------------------------< CHK_ATTRIBUTE_ID >-----------------------------|
117 -- ----------------------------------------------------------------------------
118 -- {Start Of Comments}
119 --
120 -- Description:
121 --   This procedure ensure that one of the following combinations are entered
122 --
123 --   If condition_type is ListModificationType then attribute_id must be 0
124 --   Else attribute_id must be already defined in ame_attributes table and
125 --   must be valid over the given date ranges
126 --
127 -- Pre-Requisites:
128 --   chk_condition_type must have been validated.
129 --
130 -- In Parameters:
131 --   p_attribute_id
132 --   p_condition_type
133 --   p_effective_date
134 --
135 -- Post Success:
136 --   Processing continues if a valid attribute_id has been entered.
137 --
138 -- Post Failure:
139 --   An application error is raised if the attribute_id is not equal to zero
140 --   (for a ListModificationType condition) or when the attribute_id is not
141 --   defined in ame_attributes table
142 --
143 -- Access Status:
144 --   Internal Row Handler Use Only.
145 --
146 -- {End Of Comments}
147 -- ----------------------------------------------------------------------------
148 procedure chk_attribute_id(p_attribute_id                      in   number
149                           ,p_condition_type                    in   varchar2
150                           ,p_effective_date                    in   date
151                           ) IS
152 --
153   cursor csr_name is
154          select attribute_id
155            from ame_attributes
156           where attribute_id=p_attribute_id
157             and p_effective_date between start_date
158                   and nvl(end_date - ame_util.oneSecond, p_effective_date);
159   l_proc     varchar2(72) := g_package || 'CHK_ATTRIBUTE_ID';
160   l_key      number;
161 --
162   Begin
163     hr_utility.set_location(' Entering:'||l_proc,10);
164     -- Check whether any dependencies on CONDITION_KEY have failed
165     if hr_multi_message.no_all_inclusive_error
166                    (p_check_column1 => 'AME_CONDITIONS.CONDITION_TYPE') then
167       hr_api.mandatory_arg_error(p_api_name           => l_proc
168                                 ,p_argument           => 'ATTRIBUTE_ID'
169                                 ,p_argument_value     => p_attribute_id
170                                 );
171       -- Check if the condition_type is ListModification type. Else check if
172       -- the value exists in the parent table
173       if(p_condition_type <> ame_util.listModConditionType) then
174         open csr_name;
175         fetch csr_name into l_key;
176         if(csr_name%notfound) then
177           close csr_name;
178           fnd_message.set_name('PER','AME_400473_INV_ATTRIBUTE_ID');
179           fnd_message.raise_error;
180         end if;
181         close csr_name;
182       else
183         if(p_attribute_id <> 0) then
184           fnd_message.set_name('PER','AME_400497_ATTR_ID_NOT_ZERO');
185           fnd_message.raise_error;
186         end if;
187       end if;
188     end if;
189     hr_utility.set_location(' Leaving:'||l_proc,30);
190   exception
191     when app_exception.application_exception then
192       if hr_multi_message.exception_add
193                      (p_associated_column1 => 'AME_CONDITIONS.ATTRIBUTE_ID'
194                      ) then
195       hr_utility.set_location(' Leaving:'||l_proc, 40);
196       raise;
197       end if;
198       hr_utility.set_location(' Leaving:'||l_proc,50);
199     End chk_attribute_id;
200 --
201 -- ----------------------------------------------------------------------------
202 -- |-------------------------< CHK_PARAMETER_ONE >----------------------------|
203 -- ----------------------------------------------------------------------------
204 -- {Start Of Comments}
205 --
206 -- Description:
207 --   This procedure ensure that one of the following combinations are entered
208 --
209 --   If attribute_type is boolean then parameter_one must not be null. For
210 --   other types of attributes(excluding string types) either parameter_one or
211 --   parameter_two must not be null. The string attribute type is a special
212 --   case wherein both the parameters must be null.
213 --
214 -- Pre-Requisites:
215 --   chk_attribute_id must have been validated.
216 --
217 -- In Parameters:
218 --   p_parameter_one
219 --   p_parameter_two
220 --   p_attribute_id
221 --   p_effective_date
222 --
223 -- Post Success:
224 --   Processing continues if valid parameters(parameter_one and parameter_two)
225 --   have been entered.
226 --
227 -- Post Failure:
228 --   An application error is raised if the parameters entered are not following
229 --   the aforementioned rule
230 --
231 -- Access Status:
232 --   Internal Row Handler Use Only.
233 --
234 -- {End Of Comments}
235 -- ----------------------------------------------------------------------------
236 procedure chk_parameter_one(p_parameter_one                    in   varchar2
237                            ,p_parameter_two                    in   varchar2
238                            ,p_attribute_id                     in   number
239                            ,p_effective_date                   in   date
240                            ) IS
241 --
242   cursor csr_atr_type is
243          select attribute_type
244            from ame_attributes
245           where attribute_id = p_attribute_id
246             and p_effective_date between start_date
247                   and nvl(end_date - ame_util.oneSecond, p_effective_date);
248   l_proc     varchar2(72) := g_package || 'CHK_PARAMETER_ONE';
249   l_key      varchar2(30);
250 --
251   Begin
252     hr_utility.set_location('Entering:'||l_proc,10);
253     -- Check for dependency issues with ATTRIBUTE_ID
254     if hr_multi_message.no_all_inclusive_error
255                 (p_check_column1   => 'AME_CONDITIONS.ATTRIBUTE_ID') then
256       -- Check if the attribute_type is not ame_util.stringType
257       open csr_atr_type;
258       fetch csr_atr_type into l_key;
259       close csr_atr_type;
260       if(l_key = ame_util.booleanAttributeType) then
261         hr_api.mandatory_arg_error(p_api_name           => l_proc
262                                   ,p_argument           => 'PARAMETER_ONE'
263                                   ,p_argument_value     => p_parameter_one
264                                   );
265       elsif(l_key <> ame_util.stringAttributeType) then
266         if(p_parameter_one is null and p_parameter_two is null) then
267           fnd_message.set_name('PER','AME_400330_CND_NULL_LUB');
268           fnd_message.raise_error;
269         end if;
270       end if;
271     end if;
272     hr_utility.set_location(' Leaving:'||l_proc,30);
273   exception
274     when app_exception.application_exception then
275       if hr_multi_message.exception_add
276                   (p_associated_column1 => 'AME_CONDITIONS.PARAMETER_ONE'
277                   ) then
278         hr_utility.set_location(' Leaving:'||l_proc, 40);
279         raise;
280       end if;
281       hr_utility.set_location(' Leaving:'||l_proc,50);
282   End chk_parameter_one;
283 --
284 -- ----------------------------------------------------------------------------
285 -- |-------------------------< CHK_PARAMETERS >-------------------------------|
286 -- ----------------------------------------------------------------------------
287 -- {Start Of Comments}
288 --
289 -- Description:
290 --   This procedure ensure that one of the following combinations are entered
291 --
292 --   For Ordinary and Exception type conditions, if the attribute is of type
293 --   Date,Number(with no approver_type)and Currency, either parameter1 or
294 --   parameter2 can exist with the other being null.If both exist, then
295 --   parameter1 must be less than parameter2 or they must be equal.For Number
296 --   attributes associated to an approver, both parameters must be equal.A
297 --   string attribute must have both parameters set to null, while a boolean
298 --   attribute must have parameter1 set to either 'true' or 'false'
299 --
300 --   Conditions of type ListModConditionTypes must have their parameter_one
304 -- Pre-Requisites:
301 --   set to either ame_util.anyApprover or ame_util.finalApprover,while
302 --   parameter2 must reference a valid WF_Role.
303 --
305 --   chk_condition_type,chk_attribute_id and chk_parameter_one must have been
306 --   validated.
307 --
308 -- In Parameters:
309 --   p_condition_type
310 --   p_attribute_id
311 --   p_parameter_one
312 --   p_parameter_two
313 --   p_effective_date
314 --
315 -- Post Success:
316 --   Processing continues if valid parameters(parameter_one and parameter_two)
317 --   have been entered.
318 --
319 -- Post Failure:
320 --   An application error is raised if the parameters entered are not following
321 --   the aforementioned rule
322 --
323 -- Access Status:
324 --   Internal Row Handler Use Only.
325 --
326 -- {End Of Comments}
327 -- ----------------------------------------------------------------------------
328 procedure chk_parameters(p_condition_type                      in   varchar2
329                         ,p_attribute_id                        in   number
330                         ,p_parameter_one                       in   varchar2
331                         ,p_parameter_two                       in   varchar2
332                         ,p_effective_date                      in   date
333                         ) IS
334 --
335   cursor csr_atr_type is
336          select attribute_type,approver_type_id
337            from ame_attributes
338           where attribute_id = p_attribute_id
339             and p_effective_date between start_date
340                   and nvl(end_date - ame_util.oneSecond, p_effective_date);
341   cursor csr_wf_role(p_name varchar2,p_date date) is
342          select 'Y'
343            from wf_roles
344           where name = p_name
345             and status='ACTIVE';
346   l_proc          varchar2(72) := g_package || 'CHK_PARAMETERS';
347   l_key           varchar2(30);
348   l_key_approver  number;
349 --
350   Begin
351     hr_utility.set_location('Entering:'||l_proc,10);
352     -- Check for dependency over CONDITION_TYPE.ATTRIBUTE_ID and PARAMETER_ONE
353     if hr_multi_message.no_all_inclusive_error
354                      (p_check_column1  => 'AME_CONDITIONS.CONDITION_TYPE'
355                      ,p_check_column2  => 'AME_CONDITIONS.ATTRIBUTE_ID'
356                      ,p_check_column3  => 'AME_CONDITIONS.PARAMETER_ONE'
357                      ) then
358       if(p_condition_type = ame_util.ordinaryConditionType)
359         or (p_condition_type = ame_util.exceptionConditionType) then
360         open csr_atr_type;
361         fetch csr_atr_type into l_key,l_key_approver;
362         close csr_atr_type;
363         -- Determine the attribute type
364         if(l_key = ame_util.dateAttributeType) then
365           -- Either one parameter ( of parameter1 or parametr2) can exist with
366           -- the other being null.If both exist, then parameter1 must be less
367           -- than parameter2 or they must be equal.
368           if(to_date(nvl(p_parameter_one,p_parameter_two),'yyyy:mm:dd:hh24:mi:ss')
369               >to_date(nvl(p_parameter_two,p_parameter_one),'yyyy:mm:dd:hh24:mi:ss'))
370           then
371             fnd_message.set_name('PER','AME_400186_CON_START_LESS_END');
372             fnd_message.raise_error;
373           end if;
374         elsif(l_key = ame_util.currencyAttributeType) then
375           -- Either one parameter ( of parameter1 or parametr2) can exist with
376           -- the other being null.If both exist, then parameter1 must be less
377           -- than parameter2 or they must be equal.
378           if(to_number(nvl(p_parameter_one, p_parameter_two))> to_number(nvl(p_parameter_two, p_parameter_one)))
379           then
380             fnd_message.set_name('PER','AME_400187_CON_LWR_LESS_UPP');
381             fnd_message.raise_error;
382           end if;
383         elsif(l_key = ame_util.numberAttributeType) then
384           -- When there is no approver, Either one parameter ( of parameter1 or
385           -- parameter2) can exist with the other being null.If both exist, then
386           -- parameter1 must be less than parameter2 or they must be equal.
387           if(l_key_approver is null) then
388             if(to_number(nvl(p_parameter_one, p_parameter_two))> to_number(nvl(p_parameter_two, p_parameter_one)))
389             then
390               fnd_message.set_name('PER','AME_400187_CON_LWR_LESS_UPP');
391               fnd_message.raise_error;
392             end if;
393           else
394             if(p_parameter_one <> p_parameter_two) then
395               fnd_message.set_name('PER','AME_400498_INV_APPROVER_PARAMS');
396               fnd_message.raise_error;
397             end if;
398           end if;
399         elsif(l_key = ame_util.stringAttributeType) and
400               not (p_parameter_one is null and p_parameter_two is null) then
401           fnd_message.set_name('PER','AME_400499_INV_STR_PARAMS');
402           fnd_message.raise_error;
403         elsif(l_key = ame_util.booleanAttributeType) and
404               not (p_parameter_one in (ame_util.booleanAttributeTrue,ame_util.booleanAttributeFalse)
405                     and p_parameter_two is null) then
406           fnd_message.set_name('PER','AME_400500_INV_BOOL_PARAMS');
407           fnd_message.raise_error;
408         end if;
409       elsif(p_condition_type = ame_util.listModConditionType) then
410         open csr_wf_role(p_parameter_two,p_effective_date);
411         fetch csr_wf_role into l_key;
412         if(csr_wf_role%notfound) or
413            not (p_parameter_one in (ame_util.anyApprover
414                                    ,ame_util.finalApprover)) then
415           close csr_wf_role;
416           fnd_message.set_name('PER','AME_400501_INV_LMCOND_PARAM');
417           fnd_message.raise_error;
418         end if;
419         close csr_wf_role;
420       end if;
421     end if;
425     when app_exception.application_exception then
422   ----
423     hr_utility.set_location(' Leaving:'||l_proc,30);
424   exception
426       if hr_multi_message.exception_add
427                       (p_associated_column1 => 'AME_CONDITIONS.PARAMETERS'
428                       ) then
429         hr_utility.set_location(' Leaving:'||l_proc, 40);
430         raise;
431       end if;
432       hr_utility.set_location(' Leaving:'||l_proc,50);
433   End chk_parameters;
434 --
435 -- ----------------------------------------------------------------------------
436 -- |-------------------------< CHK_PARAMETER_THREE >--------------------------|
437 -- ----------------------------------------------------------------------------
438 -- {Start Of Comments}
439 --
440 -- Description:
441 --   This procedure ensure that one of the following combinations are entered
442 --
443 --   For conditions of type ordinaryConditionType or exceptionConditionType, if
444 --   attribute_id represents an Currency attribute, parameter_three must store
445 --   the currency code.Otherwise, parameter_three must be null.
446 --
447 -- Pre-Requisites:
448 --   chk_condition_type and chk_attribute_id must have been validated.
449 --
450 -- In Parameters:
451 --   p_parameter_three
452 --   p_condition_type
453 --   p_attribute_id
454 --   p_effective_date
455 --
456 -- Post Success:
457 --   Processing continues if valid parameter_three has been entered.
458 --
459 -- Post Failure:
460 --   An application error is raised if the parameter_three entered does not
461 --   follow the aforementioned rule
462 --
463 -- Access Status:
464 --   Internal Row Handler Use Only.
465 --
466 -- {End Of Comments}
467 -- ----------------------------------------------------------------------------
468 procedure chk_parameter_three(p_parameter_three                in   varchar2
469                              ,p_condition_type                 in   varchar2
470                              ,p_attribute_id                   in   number
471                              ,p_effective_date                 in   date
472                              ) IS
473 --
474   cursor csr_atr_type is
475          select attribute_type
476            from ame_attributes
477           where attribute_id = p_attribute_id
478             and p_effective_date between start_date
479                   and nvl(end_date - ame_util.oneSecond, p_effective_date);
480   cursor csr_cur_code(p_currency_code varchar2) is
481          select currency_code
482            from fnd_currencies
483           where currency_code = p_currency_code;
484   l_proc     varchar2(72) := g_package || 'CHK_PARAMETER_THREE';
485   l_key      varchar2(30);
486 --
487   Begin
488     hr_utility.set_location('Entering:'||l_proc,10);
489     -- Check for dependency over CONDITION_TYPE, ATTRIBUTE_ID
490     if hr_multi_message.no_all_inclusive_error
491                      (p_check_column1  => 'AME_CONDITIONS.CONDITION_TYPE'
492                      ,p_check_column2  => 'AME_CONDITIONS.ATTRIBUTE_ID'
493                      ) then
494       -- Check condition_type and attribute_type.
495       if(p_condition_type = ame_util.ordinaryConditionType or
496           p_condition_type = ame_util.exceptionConditionType)
497       then
498         open csr_atr_type;
499         fetch csr_atr_type into l_key;
500         close csr_atr_type;
501         if(l_key = ame_util.currencyAttributeType) then
502           open csr_cur_code(p_parameter_three);
503           fetch csr_cur_code into l_key;
504           if(csr_cur_code%notfound) then
505             close csr_cur_code;
506             fnd_message.set_name('PER','AME_400502_INV_CURR_CODE');
507             fnd_message.raise_error;
508           end if;
509           close csr_cur_code;
510         elsif(p_parameter_three is not null) then
511           fnd_message.set_name('PER','AME_400503_COND_PAR3_NOT_NULL');
512           fnd_message.raise_error;
513         end if;
514       end if;
515     end if;
516     hr_utility.set_location(' Leaving:'||l_proc,30);
517   exception
518     when app_exception.application_exception then
519       if hr_multi_message.exception_add
520                (p_associated_column1 => 'AME_CONDITIONS.PARAMETER_THREE'
521                ) then
522         hr_utility.set_location(' Leaving:'||l_proc, 40);
523         raise;
524       end if;
525       hr_utility.set_location(' Leaving:'||l_proc,50);
526   End chk_parameter_three;
527 --
528 -- ----------------------------------------------------------------------------
529 -- |------------------------------< CHK_UNIQUE >------------------------------|
530 -- ----------------------------------------------------------------------------
531 -- {Start Of Comments}
532 --
533 -- Description:
534 --   This procedure ensures that a duplicate condition with the same set of
535 --   values for condition_type, attribute_id, parameter_one, parameter_two,
536 --   parameter_three, include_lower_limit, include_upper_limit does not exist.
537 --
538 -- Pre-Requisites:
539 --   chk_condition_type, chk_attribute_id, chk_limits, chk_parameter_one and
540 --   chk_parameter_three must have been validated.
541 --
542 -- In Parameters:
543 --   p_rec
544 --   p_effective_date
545 --
546 -- Post Success:
547 --   Processing continues if a valid record has been entered.
548 --
549 -- Post Failure:
550 --   An application error is raised if the record entered does not
551 --   follow the aforementioned rule
552 --
553 -- Access Status:
554 --   Internal Row Handler Use Only.
555 --
556 -- {End Of Comments}
557 -- ----------------------------------------------------------------------------
558 procedure chk_unique(p_rec                        in   ame_con_shd.g_rec_type
559                     ,p_effective_date             in   date
560                     ) IS
561 --
562   cursor csr_name is
563          select condition_id
564            from ame_conditions
565           where condition_type    = p_rec.condition_type
566             and nvl(parameter_one, hr_api.g_varchar2)
567                   = nvl(p_rec.parameter_one, hr_api.g_varchar2)
568             and nvl(parameter_two, hr_api.g_varchar2)
569                   = nvl(p_rec.parameter_two, hr_api.g_varchar2)
570             and nvl(parameter_three, hr_api.g_varchar2)
571                   = nvl(p_rec.parameter_three, hr_api.g_varchar2)
572             and nvl(include_lower_limit, hr_api.g_varchar2)
573                   = nvl(p_rec.include_lower_limit, hr_api.g_varchar2)
574             and nvl(include_upper_limit, hr_api.g_varchar2)
575                   = nvl(p_rec.include_upper_limit, hr_api.g_varchar2)
576             and p_effective_date between start_date
577                   and nvl(end_date - ame_util.oneSecond, p_effective_date)
578             and attribute_id = p_rec.attribute_id
579             and attribute_id not in ( select attribute_id
580                                         from ame_attributes
581                                        where attribute_type = ame_util.stringAttributeType
582                                          and p_effective_date between
583                                                start_date and
584                                                nvl(end_date - ame_util.oneSecond, p_effective_date)
585                                     );
586   l_proc     varchar2(72) := g_package || 'CHK_UNIQUE';
587   l_key      number;
588 --
589   Begin
590     hr_utility.set_location('Entering:'||l_proc,10);
591     -- check for dependency over CONDITION_TYPE, ATTRIBUTE_ID
592     -- PARAMETER_ONE,PARAMETER_THREE and LIMITS
593     if hr_multi_message.no_all_inclusive_error
594                      (p_check_column1  => 'AME_CONDITIONS.CONDITION_TYPE'
595                      ,p_check_column2  => 'AME_CONDITIONS.ATTRIBUTE_ID'
596                      ,p_check_column3  => 'AME_CONDITIONS.PARAMETER_ONE'
597                      ,p_check_column4  => 'AME_CONDITIONS.PARAMETER_THREE'
598                      ,p_check_column5  => 'AME_CONDITIONS.LIMITS'
599                      ) then
600       open csr_name;
601       fetch csr_name into l_key;
602       -- and l_key <> p_rec.condition_id
603       if(csr_name%found) then
604         if l_key = p_rec.condition_id then
605           null;
606         else
607           close csr_name;
608           fnd_message.set_name('PER','AME_400183_CON_ALRDY_EXISTS');
609           fnd_message.raise_error;
610         end if;
611       end if;
612       close csr_name;
613     end if;
614     hr_utility.set_location(' Leaving:'||l_proc,30);
615   exception
616     when app_exception.application_exception then
617       if hr_multi_message.exception_add
618                            (p_associated_column1 => 'AME_CONDITIONS.UNIQUE'
619                            ) then
620         hr_utility.set_location(' Leaving:'||l_proc, 40);
621         raise;
622       end if;
623       hr_utility.set_location(' Leaving:'||l_proc,50);
624   End chk_unique;
625 --
626 -- ----------------------------------------------------------------------------
627 -- |------------------------------< CHK_LIMITS >------------------------------|
628 -- ----------------------------------------------------------------------------
629 -- {Start Of Comments}
630 --
631 -- Description:
632 --   This procedure ensures that for a boolean attribute, limits are not
633 --   defined. For other attributes with either parameter_one or parameter_two
634 --   or both defined, the limits must exist only when the associated parameter
635 --   (lower limit for parameter_one and upper limit for parameter_two) exist.
636 --   For equal parameters both limits must be set to 'Y'
637 --
638 -- Pre-Requisites:
639 --   chk_condition_type, chk_attribute_id and chk_parameters must have been
640 --   validated.
641 --
642 -- In Parameters:
643 --   p_condition_type
644 --   p_attribute_id
645 --   p_parameter_one
646 --   p_parameter_two
647 --   p_include_lower_limit
648 --   p_include_upper_limit
649 --   p_effective_date
650 --
651 -- Post Success:
652 --   Processing continues if a valid parameters have been entered.
653 --
654 -- Post Failure:
655 --   An application error is raised if the parameters entered do not follow the
656 --   aforementioned rule
657 --
658 -- Access Status:
659 --   Internal Row Handler Use Only.
660 --
661 -- {End Of Comments}
662 -- ----------------------------------------------------------------------------
663 procedure chk_limits(p_condition_type                           in   varchar2
664                     ,p_attribute_id                             in   number
665                     ,p_parameter_one                            in   varchar2
666                     ,p_parameter_two                            in   varchar2
667                     ,p_include_lower_limit                      in   varchar2
668                     ,p_include_upper_limit                      in   varchar2
669                     ,p_effective_date                           in   date
670                     ) IS
671 --
672   cursor csr_atr_type is
673          select attribute_type
674            from ame_attributes
675           where attribute_id = p_attribute_id
676             and p_effective_date between start_date
677                   and nvl(end_date - ame_util.oneSecond, p_effective_date);
678   l_proc     varchar2(72) := g_package || 'CHK_LIMITS';
679   l_key      varchar2(30);
680 --
681   Begin
682     hr_utility.set_location( 'Entering:'||l_proc,10 );
683     if hr_multi_message.no_all_inclusive_error
684                      (p_check_column1  => 'AME_CONDITIONS.CONDITION_TYPE'
685                      ,p_check_column2  => 'AME_CONDITIONS.ATTRIBUTE_ID'
686                      ,p_check_column3  => 'AME_CONDITIONS.PARAMETERS'
687                      ) then
688       if(p_condition_type <> ame_util.listModConditionType) then
689         open csr_atr_type;
690         fetch csr_atr_type into l_key;
691         close csr_atr_type;
692         if (l_key = ame_util.booleanAttributeType) then
693           if not(p_include_lower_limit is null and p_include_upper_limit is null)
694           then
695             fnd_message.set_name('PER','AME_400504_INV_BOOL_LIMITS');
696             fnd_message.raise_error;
697           end if;
698         else
699           -- The parameters 1 and 2 decide the existence of the appopriate limits
700           if(p_parameter_one is null and p_include_lower_limit is not null)
701               or(p_parameter_one is not null and (p_include_lower_limit is null
702                 or p_include_lower_limit not in
703                   (ame_util.booleanTrue,ame_util.booleanFalse))) then
704             fnd_message.set_name('PER','AME_400506_INV_LOWER_LIMIT');
705             fnd_message.raise_error;
706           end if;
707           if(p_parameter_two is null and p_include_upper_limit is not null)
708               or (p_parameter_two is not null and (p_include_upper_limit is null
709                 or p_include_upper_limit not in
710                   (ame_util.booleanTrue,ame_util.booleanFalse))) then
711             fnd_message.set_name('PER','AME_400505_INV_UPPER_LIMIT');
712             fnd_message.raise_error;
713           end if;
714           if((p_parameter_one = p_parameter_two) and
715              (p_include_lower_limit <> ame_util.booleanTrue or
716                p_include_upper_limit <> ame_util.booleanTrue)
717             ) then
718             fnd_message.set_name('PER','AME_400678_CON_LMT_VAL_YES');
719             fnd_message.raise_error;
720           end if;
721         end if;
722       else
723         if not(p_include_lower_limit is null and p_include_upper_limit is null)
724         then
725           fnd_message.set_name('PER','AME_400507_INV_LMCOND_LIMITS');
726           fnd_message.raise_error;
727         end if;
728       end if;
729     end if;
730 --
731     hr_utility.set_location(' Leaving:'||l_proc,30);
732   exception
733     when app_exception.application_exception then
734       if hr_multi_message.exception_add
735                        (p_associated_column1 => 'AME_CONDITIONS.LIMITS'
736                        ) then
737         hr_utility.set_location(' Leaving:'||l_proc, 40);
738         raise;
739       end if;
740       hr_utility.set_location(' Leaving:'||l_proc,50);
741   End chk_limits;
742 --
743 -- ----------------------------------------------------------------------------
744 -- |-------------------------< CHK_CONDITION_KEY >----------------------------|
745 -- ----------------------------------------------------------------------------
746 -- {Start Of Comments}
747 --
748 -- Description:
749 --   This procedure ensures that a non-null and a unique condition_key is
750 --   entered. Also check is done to ensure that condition_key does not start
751 --   with '@' character.
752 --
753 -- Pre-Requisites:
754 --   None
755 --
756 -- In Parameters:
757 --   p_condition_key
758 --   p_effective_date
759 --
760 -- Post Success:
761 --   Processing continues if a valid condition_key has been entered.
762 --
763 -- Post Failure:
764 --   An application error is raised if the condition_key is either null or
765 --   non-unique. Error is also thrown when the condition_key starts with '@'.
766 --
767 -- Access Status:
768 --   Internal Row Handler Use Only.
769 --
770 -- {End Of Comments}
771 -- ----------------------------------------------------------------------------
772 procedure chk_condition_key(p_condition_key                      in   varchar2
773                            ,p_effective_date                     in   date
774                            ) IS
775 --
776   cursor csr_name is
777          select 'Y'
778            from ame_conditions
779           where condition_key = p_condition_key
780             and p_effective_date between start_date
781                   and nvl(end_date - ame_util.oneSecond, p_effective_date);
782   l_proc     varchar2(72) := g_package || 'CHK_CONDITION_KEY';
783   l_key      varchar2(1);
784 --
785   Begin
786     hr_utility.set_location('Entering:'||l_proc,10);
787     hr_api.mandatory_arg_error(p_api_name           => l_proc
788                               ,p_argument           => 'CONDITION_KEY'
789                               ,p_argument_value     => p_condition_key
790                               );
791   -- Check if the value already exists
792     open csr_name;
793     fetch csr_name into l_key;
794     if(csr_name%found) then
795       close csr_name;
796       fnd_message.set_name('PER','AME_400360_CND_KEY_EXIST');
797       fnd_message.raise_error;
798     elsif(substr(p_condition_key,1,1) = '@') then
799       close csr_name;
800       fnd_message.set_name('PER','AME_400364_COND_KEY_SYMBOL');
801       fnd_message.raise_error;
802     end if;
803     close csr_name;
804     hr_utility.set_location(' Leaving:'||l_proc,30);
805   exception
806     when app_exception.application_exception then
807       if hr_multi_message.exception_add
808                   (p_associated_column1 => 'AME_CONDITIONS.CONDITION_KEY'
809                   ) then
810         hr_utility.set_location(' Leaving:'||l_proc, 40);
811         raise;
812       end if;
813       hr_utility.set_location(' Leaving:'||l_proc,50);
814   End chk_condition_key;
815 --
816 -- ----------------------------------------------------------------------------
817 -- |-----------------------------< chk_delete >-------------------------------|
818 -- ----------------------------------------------------------------------------
819 -- {Start Of Comments}
820 --
821 -- Description:
822 --   This procedure is used to check whether any valid child records exist for
823 --   the given condition(condition_id). This is essential to prevent records
824 --   from being orphaned
825 --
826 -- Pre-Requisites:
827 --   None
828 --
829 -- In Parameters:
830 --   p_condition_id
831 --   p_effective_date
832 --
833 -- Post Success:
834 --   Processing continues if no child records for the said condition are found.
835 --
836 -- Post Failure:
837 --   An application error is raised if valid child records exist for the given
838 --   condition_id.
839 --
840 -- Access Status:
841 --   Internal Row Handler Use Only.
842 --
843 -- {End Of Comments}
844 -- ----------------------------------------------------------------------------
845 procedure chk_delete(p_condition_id                              in   number
846                     ,p_effective_date                            in   date
847                     ) IS
848 --
849   cursor csr_name is
850          select 'Y'
851            from ame_condition_usages
852           where condition_id = p_condition_id
853             and ((p_effective_date between start_date
854                     and nvl(end_date - ame_util.oneSecond, p_effective_date))
855                   or(p_effective_date < start_date and
856                       p_effective_date <= nvl(end_date - ame_util.oneSecond, p_effective_date))
857                 );
858 --  cursor c_sel2 is
859 --    select null
860 --      from ame_conditions
861 --      where ame_utility_pkg.check_seeddb = 'N'
862 --        and ame_utility_pkg.is_seed_user(created_by) = ame_util.seededDataCreatedById
863 --       and condition_id = p_condition_id
864 --        and p_effective_date between start_date and
865 --             nvl(end_date - (1/86400), p_effective_date);
866 
867   l_proc     varchar2(72) := g_package || 'CHK_DELETE';
868   l_key      varchar2(1);
869 --
870   Begin
871     hr_utility.set_location('Entering:'||l_proc,10);
872     -- Check if the value already exists
873     open csr_name;
874     fetch csr_name into l_key;
875     if(csr_name%found) then
876       close csr_name;
877       fnd_message.set_name('PER','AME_400193_CON_IN_USE');
878       fnd_message.raise_error;
879     end if;
880     close csr_name;
881 
882 --    open c_sel2;
883 --    fetch c_sel2 into l_key;
884 --    if c_sel2%found then
885 --      close c_sel2;
886 --      fnd_message.set_name('PER', 'AME_400477_CANNOT_DEL_SEEDED');
887 --      fnd_message.set_token('OBJECT', 'CONDITION');
888 --      fnd_message.raise_error;
889 --    end if;
890 --    close c_sel2;
891 
892     hr_utility.set_location(' Leaving:'||l_proc,30);
893   exception
894     when app_exception.application_exception then
895       if hr_multi_message.exception_add
896                        (p_associated_column1 => 'AME_CONDITIONS.DELETE'
897                        ) then
898         hr_utility.set_location(' Leaving:'||l_proc, 40);
899         raise;
900       end if;
904 -- ----------------------------------------------------------------------------
901       hr_utility.set_location(' Leaving:'||l_proc,50);
902   End chk_delete;
903 --
905 -- |-----------------------< chk_non_updateable_args >------------------------|
906 -- ----------------------------------------------------------------------------
907 -- {Start Of Comments}
908 --
909 -- Description:
910 --   This procedure is used to ensure that non updateable attributes have
911 --   not been updated. If an attribute has been updated an error is generated.
912 --
913 -- Pre Conditions:
914 --   g_old_rec has been populated with details of the values currently in
915 --   the database.
916 --
917 -- In Arguments:
918 --   p_rec has been populated with the updated values the user would like the
919 --   record set to.
920 --
921 -- Post Success:
922 --   Processing continues if all the non updateable attributes have not
923 --   changed.
924 --
925 -- Post Failure:
926 --   An application error is raised if any of the non updatable attributes
927 --   have been altered.
928 --
929 -- {End Of Comments}
930 -- ----------------------------------------------------------------------------
931 Procedure chk_non_updateable_args
932   (p_effective_date  in date
933   ,p_rec             in ame_con_shd.g_rec_type
934   ) IS
935 --
936   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
937 --
938 Begin
939   --
940   -- Only proceed with the validation if a row exists for the current
941   -- record in the HR Schema.
942   --
943   IF NOT ame_con_shd.api_updating
944       (p_condition_id =>  p_rec.condition_id
945       ,p_effective_date                   => p_effective_date
946       ,p_object_version_number            => p_rec.object_version_number
947       ) THEN
948      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
949      fnd_message.set_token('PROCEDURE ', l_proc);
950      fnd_message.set_token('STEP ', '5');
951      fnd_message.raise_error;
952   END IF;
953   --
954   -- EDIT_HERE: Add checks to ensure non-updateable args have
955   --            not been updated.
956   --
957   -- CONDITION_TYPE is non-updateable
958    if nvl(p_rec.condition_type, hr_api.g_varchar2) <>
959        nvl(ame_con_shd.g_old_rec.condition_type,hr_api.g_varchar2) then
960      hr_api.argument_changed_error
961           (p_api_name   => l_proc
962           ,p_argument   => 'CONDITION_TYPE'
963           ,p_base_table => ame_con_shd.g_tab_nam
964           );
965   end if;
966 --
967 -- ATTRIBUTE_ID is non-updateable
968    if nvl(p_rec.attribute_id, hr_api.g_number) <>
969        nvl(ame_con_shd.g_old_rec.attribute_id,hr_api.g_number ) then
970      hr_api.argument_changed_error
971           (p_api_name   => l_proc
972           ,p_argument   => 'ATTRIBUTE_ID'
973           ,p_base_table => ame_con_shd.g_tab_nam
974           );
975   end if;
976 --
977 -- CONDITION_KEY is non-updateable
978   if nvl(p_rec.condition_key, hr_api.g_varchar2) <>
979        nvl(ame_con_shd.g_old_rec.condition_key,hr_api.g_varchar2 ) then
980      hr_api.argument_changed_error
981           (p_api_name   => l_proc
982           ,p_argument   => 'CONDITION_KEY'
983           ,p_base_table => ame_con_shd.g_tab_nam
984           );
985   end if;
986 --
987 End chk_non_updateable_args;
988 --
989 -- ----------------------------------------------------------------------------
990 -- |--------------------------< dt_update_validate >--------------------------|
991 -- ----------------------------------------------------------------------------
992 -- {Start Of Comments}
993 --
994 -- Description:
995 --   This procedure is used for referential integrity of datetracked
996 --   parent entities when a datetrack update operation is taking place
997 --   and where there is no cascading of update defined for this entity.
998 --
999 -- Prerequisites:
1000 --   This procedure is called from the update_validate.
1001 --
1002 -- In Parameters:
1003 --
1004 -- Post Success:
1005 --   Processing continues.
1006 --
1007 -- Post Failure:
1008 --
1009 -- Developer Implementation Notes:
1010 --   This procedure should not need maintenance unless the HR Schema model
1011 --   changes.
1012 --
1013 -- Access Status:
1014 --   Internal Row Handler Use Only.
1015 --
1016 -- {End Of Comments}
1017 -- ----------------------------------------------------------------------------
1018 Procedure dt_update_validate
1019   (p_datetrack_mode                in varchar2
1020   ,p_validation_start_date         in date
1021   ,p_validation_end_date           in date
1022   ) Is
1023 --
1024   l_proc  varchar2(72) := g_package||'dt_update_validate';
1025 --
1026 Begin
1027   --
1028   -- Ensure that the p_datetrack_mode argument is not null
1029   --
1030   hr_api.mandatory_arg_error
1031     (p_api_name       => l_proc
1032     ,p_argument       => 'datetrack_mode'
1033     ,p_argument_value => p_datetrack_mode
1034     );
1035   --
1036   -- Mode will be valid, as this is checked at the start of the upd.
1037   --
1038   -- Ensure the arguments are not null
1039   --
1040   hr_api.mandatory_arg_error
1041     (p_api_name       => l_proc
1042     ,p_argument       => 'validation_start_date'
1043     ,p_argument_value => p_validation_start_date
1044     );
1045   --
1046   /*hr_api.mandatory_arg_error
1047     (p_api_name       => l_proc
1048     ,p_argument       => 'validation_end_date'
1049     ,p_argument_value => p_validation_end_date
1050     );*/
1051   --
1052 Exception
1053   When Others Then
1054     --
1055     -- An unhandled or unexpected error has occurred which
1059     fnd_message.set_token('PROCEDURE', l_proc);
1056     -- we must report
1057     --
1058     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
1060     fnd_message.set_token('STEP','15');
1061     fnd_message.raise_error;
1062 End dt_update_validate;
1063 --
1064 -- ----------------------------------------------------------------------------
1065 -- |--------------------------< dt_delete_validate >--------------------------|
1066 -- ----------------------------------------------------------------------------
1067 -- {Start Of Comments}
1068 --
1069 -- Description:
1070 --   This procedure is used for referential integrity of datetracked
1071 --   child entities when either a datetrack DELETE or ZAP is in operation
1072 --   and where there is no cascading of delete defined for this entity.
1073 --   For the datetrack mode of DELETE or ZAP we must ensure that no
1074 --   datetracked child rows exist between the validation start and end
1075 --   dates.
1076 --
1077 -- Prerequisites:
1078 --   This procedure is called from the delete_validate.
1079 --
1080 -- In Parameters:
1081 --
1082 -- Post Success:
1083 --   Processing continues.
1084 --
1085 -- Post Failure:
1086 --   If a row exists by determining the returning Boolean value from the
1087 --   generic dt_api.rows_exist function then we must supply an error via
1088 --   the use of the local exception handler l_rows_exist.
1089 --
1090 -- Developer Implementation Notes:
1091 --   This procedure should not need maintenance unless the HR Schema model
1092 --   changes.
1093 --
1094 -- Access Status:
1095 --   Internal Row Handler Use Only.
1096 --
1097 -- {End Of Comments}
1098 -- ----------------------------------------------------------------------------
1099 Procedure dt_delete_validate
1100   (p_condition_id                     in number
1101   ,p_datetrack_mode                   in varchar2
1102   ,p_validation_start_date            in date
1103   ,p_validation_end_date              in date
1104   ) Is
1105 --
1106   l_proc        varchar2(72)    := g_package||'dt_delete_validate';
1107 --
1108 Begin
1109   --
1110   -- Ensure that the p_datetrack_mode argument is not null
1111   --
1112   hr_api.mandatory_arg_error
1113     (p_api_name       => l_proc
1114     ,p_argument       => 'datetrack_mode'
1115     ,p_argument_value => p_datetrack_mode
1116     );
1117   --
1118   -- Only perform the validation if the datetrack mode is either
1119   -- DELETE or ZAP
1120   --
1121   If (p_datetrack_mode = hr_api.g_delete or
1122       p_datetrack_mode = hr_api.g_zap) then
1123     --
1124     --
1125     -- Ensure the arguments are not null
1126     --
1127     hr_api.mandatory_arg_error
1128       (p_api_name       => l_proc
1129       ,p_argument       => 'validation_start_date'
1130       ,p_argument_value => p_validation_start_date
1131       );
1132     --
1133     /*hr_api.mandatory_arg_error
1134       (p_api_name       => l_proc
1135       ,p_argument       => 'validation_end_date'
1136       ,p_argument_value => p_validation_end_date
1137       );*/
1138     --
1139     hr_api.mandatory_arg_error
1140       (p_api_name       => l_proc
1141       ,p_argument       => 'condition_id'
1142       ,p_argument_value => p_condition_id
1143       );
1144     --
1145     --
1146     --
1147   End If;
1148   --
1149 Exception
1150   When Others Then
1151     --
1152     -- An unhandled or unexpected error has occurred which
1153     -- we must report
1154     --
1155     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
1156     fnd_message.set_token('PROCEDURE', l_proc);
1157     fnd_message.set_token('STEP','15');
1158     fnd_message.raise_error;
1159   --
1160 End dt_delete_validate;
1161 --
1162 -- ----------------------------------------------------------------------------
1163 -- |---------------------------< insert_validate >----------------------------|
1164 -- ----------------------------------------------------------------------------
1165 Procedure insert_validate
1166   (p_rec                   in ame_con_shd.g_rec_type
1167   ,p_effective_date        in date
1168   ,p_datetrack_mode        in varchar2
1169   ,p_validation_start_date in date
1170   ,p_validation_end_date   in date
1171   ) is
1172 --
1173   l_proc        varchar2(72) := g_package||'insert_validate';
1174 --
1175 Begin
1176   hr_utility.set_location('Entering:'||l_proc, 5);
1177   --
1178   -- Validate Dependent Attributes
1179   --
1180   -- User Entered calls to validate procedures
1181   -- chk_condition_id(p_rec.condition_id);
1182 
1183   chk_condition_type(p_rec.condition_type);
1184 
1185   chk_attribute_id(p_rec.attribute_id
1186                   ,p_rec.condition_type
1187                   ,p_effective_date
1188                   );
1189 
1190   chk_condition_key(p_rec.condition_key
1191                    ,p_effective_date
1192                    );
1193 
1194   chk_parameter_one(p_rec.parameter_one
1195                    ,p_rec.parameter_two
1196                    ,p_rec.attribute_id
1197                    ,p_effective_date
1198                    );
1199 
1200   chk_parameters(p_rec.condition_type
1201                 ,p_rec.attribute_id
1202                 ,p_rec.parameter_one
1203                 ,p_rec.parameter_two
1204                 ,p_effective_date
1205                 );
1206 
1207   chk_parameter_three(p_rec.parameter_three
1208                      ,p_rec.condition_type
1209                      ,p_rec.attribute_id
1210                      ,p_effective_date
1211                      );
1212 
1213   chk_limits(p_rec.condition_type
1214             ,p_rec.attribute_id
1215             ,p_rec.parameter_one
1216             ,p_rec.parameter_two
1217             ,p_rec.include_lower_limit
1218             ,p_rec.include_upper_limit
1219             ,p_effective_date
1220             );
1221 
1222   chk_unique(p_rec
1223             ,p_effective_date
1224             );
1225 
1226   --
1227   hr_utility.set_location(' Leaving:'||l_proc, 10);
1228 End insert_validate;
1229 --
1230 -- ----------------------------------------------------------------------------
1231 -- |---------------------------< update_validate >----------------------------|
1232 -- ----------------------------------------------------------------------------
1233 Procedure update_validate
1234   (p_rec                     in ame_con_shd.g_rec_type
1235   ,p_effective_date          in date
1236   ,p_datetrack_mode          in varchar2
1237   ,p_validation_start_date   in date
1238   ,p_validation_end_date     in date
1239   ) is
1240 --
1241   l_proc        varchar2(72) := g_package||'update_validate';
1242 --
1243 Begin
1244   hr_utility.set_location('Entering:'||l_proc, 5);
1245   --
1246   -- Validate Dependent Attributes
1247   --
1248   -- Call the datetrack update integrity operation
1249   --
1250   dt_update_validate
1251     (p_datetrack_mode                 => p_datetrack_mode
1252     ,p_validation_start_date          => p_validation_start_date
1253     ,p_validation_end_date            => p_validation_end_date
1254     );
1255   --
1256   chk_non_updateable_args
1257     (p_effective_date  => p_effective_date
1258     ,p_rec             => p_rec
1259     );
1260   --
1261   -- User Entered calls to validate procedures
1262   --
1263   chk_condition_id(p_rec.condition_id);
1264 
1265   chk_unique(p_rec
1266             ,p_effective_date
1267             );
1268 
1269   chk_parameter_one(p_rec.parameter_one
1270                    ,p_rec.parameter_two
1271                    ,p_rec.attribute_id
1272                    ,p_effective_date
1273                    );
1274 
1275   chk_parameters(p_rec.condition_type
1276                 ,p_rec.attribute_id
1277                 ,p_rec.parameter_one
1278                 ,p_rec.parameter_two
1279                 ,p_effective_date
1280                 );
1281 
1282   chk_parameter_three(p_rec.parameter_three
1283                      ,p_rec.condition_type
1284                      ,p_rec.attribute_id
1285                      ,p_effective_date
1286                      );
1287 
1288   chk_limits(p_rec.condition_type
1289             ,p_rec.attribute_id
1290             ,p_rec.parameter_one
1291             ,p_rec.parameter_two
1292             ,p_rec.include_lower_limit
1293             ,p_rec.include_upper_limit
1294             ,p_effective_date
1295             );
1296 
1297   --
1298   hr_utility.set_location(' Leaving:'||l_proc, 10);
1299 End update_validate;
1300 --
1301 -- ----------------------------------------------------------------------------
1302 -- |---------------------------< delete_validate >----------------------------|
1303 -- ----------------------------------------------------------------------------
1304 Procedure delete_validate
1305   (p_rec                    in ame_con_shd.g_rec_type
1306   ,p_effective_date         in date
1307   ,p_datetrack_mode         in varchar2
1308   ,p_validation_start_date  in date
1309   ,p_validation_end_date    in date
1310   ) is
1311 --
1312   l_proc        varchar2(72) := g_package||'delete_validate';
1313 --
1314 Begin
1315   hr_utility.set_location('Entering:'||l_proc, 5);
1316   --
1317   -- Call all supporting business operations
1318   --
1319   dt_delete_validate
1320     (p_datetrack_mode                   => p_datetrack_mode
1321     ,p_validation_start_date            => p_validation_start_date
1322     ,p_validation_end_date              => p_validation_end_date
1323     ,p_condition_id =>  p_rec.condition_id
1324     );
1325   --
1326   hr_utility.set_location(' Leaving:'||l_proc, 10);
1327 End delete_validate;
1328 --
1329 end ame_con_bus;