DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_TIME_ENTRY_GROUP_COMP_API

Source


1 Package Body hxc_time_entry_group_comp_api as
2 /* $Header: hxctecapi.pkb 120.2 2005/09/23 07:09:28 nissharm noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  hxc_time_entry_group_comp_api.';
7 
8 g_entity_type varchar2(16) := 'TIME_ENTRY_RULES';
9 
10 g_debug boolean := hr_utility.debug_enabled;
11 
12 -- ----------------------------------------------------------------------------
13 -- |--------------------< create_time_entry_group_comp>-----------------------|
14 -- ----------------------------------------------------------------------------
15 --
16 procedure create_time_entry_group_comp
17   (p_validate                       in  boolean   default false
18   ,p_effective_date                 in  date
19   ,p_time_entry_group_comp_id       in  out nocopy number
20   ,p_object_version_number          in  out nocopy number
21   ,p_time_entry_rule_id             in     number
22   ,p_time_entry_rule_group_id       in     number
23   ,p_attribute_category             in     varchar2 default null
24   ,p_attribute1                     in     varchar2 default null
25   ,p_attribute2                     in     varchar2 default null
26   ,p_attribute3                     in     varchar2 default null
27   ,p_attribute4                     in     varchar2 default null
28   ,p_attribute5                     in     varchar2 default null
29   ,p_attribute6                     in     varchar2 default null
30   ,p_attribute7                     in     varchar2 default null
31   ,p_attribute8                     in     varchar2 default null
32   ,p_attribute9                     in     varchar2 default null
33   ,p_attribute10                    in     varchar2 default null
34   ,p_attribute11                    in     varchar2 default null
35   ,p_attribute12                    in     varchar2 default null
36   ,p_attribute13                    in     varchar2 default null
37   ,p_attribute14                    in     varchar2 default null
38   ,p_attribute15                    in     varchar2 default null
39   ,p_attribute16                    in     varchar2 default null
40   ,p_attribute17                    in     varchar2 default null
41   ,p_attribute18                    in     varchar2 default null
42   ,p_attribute19                    in     varchar2 default null
43   ,p_attribute20                    in     varchar2 default null
44   ,p_attribute21                    in     varchar2 default null
45   ,p_attribute22                    in     varchar2 default null
46   ,p_attribute23                    in     varchar2 default null
47   ,p_attribute24                    in     varchar2 default null
48   ,p_attribute25                    in     varchar2 default null
49   ,p_attribute26                    in     varchar2 default null
50   ,p_attribute27                    in     varchar2 default null
51   ,p_attribute28                    in     varchar2 default null
52   ,p_attribute29                    in     varchar2 default null
53   ,p_attribute30                    in     varchar2 default null
54   ,p_called_from_form               in     varchar2 default 'N'
55   ) is
56   --
57   -- Declare cursors and local variables
58   --
59 	l_proc varchar2(72);
60 	l_object_version_number hxc_entity_group_comps.object_version_number%TYPE;
61 	l_time_entry_group_comp_id hxc_entity_group_comps.entity_group_comp_id%TYPE;
62   --
63 begin
64 
65   g_debug := hr_utility.debug_enabled;
66 
67   if g_debug then
68   	l_proc := g_package||' create_time_entry_group_comp';
69   	hr_utility.set_location('Entering:'|| l_proc, 10);
70   end if;
71 
72   -- Issue a savepoint if operating in validation only mode
73 
74   savepoint create_time_entry_group_comp;
75 
76   if g_debug then
77   	hr_utility.set_location(l_proc, 20);
78   end if;
79 
80 	chk_ter_unique ( p_time_entry_group_comp_id	=> p_time_entry_group_comp_id
81 			,p_time_entry_rule_group_id	=> p_time_entry_rule_group_id
82 			,p_time_entry_rule_id	        => p_time_entry_rule_id );
83 
84 
85   -- Call Before Process User Hook
86 
87   begin
88     hxc_time_entry_group_comp_BK_1.create_time_entry_group_comp_b
89 	  (p_time_entry_group_comp_id  => p_time_entry_group_comp_id
90 	  ,p_object_version_number  => p_object_version_number
91           ,p_time_entry_rule_id             => p_time_entry_rule_id
92           ,p_time_entry_rule_group_id   => p_time_entry_rule_group_id
93           ,p_attribute_category    => p_attribute_category
94           ,p_attribute1            => p_attribute1
95           ,p_attribute2            => p_attribute2
96           ,p_attribute3            => p_attribute3
97           ,p_attribute4            => p_attribute4
98           ,p_attribute5            => p_attribute5
99           ,p_attribute6            => p_attribute6
100           ,p_attribute7            => p_attribute7
101           ,p_attribute8            => p_attribute8
102           ,p_attribute9            => p_attribute9
103           ,p_attribute10           => p_attribute10
104           ,p_attribute11           => p_attribute11
105           ,p_attribute12           => p_attribute12
106           ,p_attribute13           => p_attribute13
107           ,p_attribute14           => p_attribute14
108           ,p_attribute15           => p_attribute15
109           ,p_attribute16           => p_attribute16
110           ,p_attribute17           => p_attribute17
111           ,p_attribute18           => p_attribute18
112           ,p_attribute19           => p_attribute19
113           ,p_attribute20           => p_attribute20
114           ,p_attribute21           => p_attribute21
115           ,p_attribute22           => p_attribute22
116           ,p_attribute23           => p_attribute23
117           ,p_attribute24           => p_attribute24
118           ,p_attribute25           => p_attribute25
119           ,p_attribute26           => p_attribute26
120           ,p_attribute27           => p_attribute27
121           ,p_attribute28           => p_attribute28
122           ,p_attribute29           => p_attribute29
123           ,p_attribute30           => p_attribute30
124   );
125   exception
126     when hr_api.cannot_find_prog_unit then
127       hr_api.cannot_find_prog_unit_error
128         (p_module_name => 'create_time_entry_group_comp'
129         ,p_hook_type   => 'BP'
130         );
131   end;
132   --
133   if g_debug then
134   	hr_utility.set_location(l_proc, 30);
135   end if;
136   --
137   -- Process Logic
138   --
139 --
140   if g_debug then
141   	hr_utility.set_location(l_proc, 40);
142   end if;
143 --
144 -- call row handler
145 --
146 hxc_egc_ins.ins (
147    p_effective_date       => p_effective_date
148   ,p_entity_id            => p_time_entry_rule_id
149   ,p_entity_type          => g_entity_type
150   ,p_entity_group_id  	  => p_time_entry_rule_group_id
151   ,p_entity_group_comp_id => l_time_entry_group_comp_id
152   ,p_object_version_number => l_object_version_number
153   ,p_attribute_category    => p_attribute_category
154   ,p_attribute1            => p_attribute1
155   ,p_attribute2            => p_attribute2
156   ,p_attribute3            => p_attribute3
157   ,p_attribute4            => p_attribute4
158   ,p_attribute5            => p_attribute5
159   ,p_attribute6            => p_attribute6
160   ,p_attribute7            => p_attribute7
161   ,p_attribute8            => p_attribute8
162   ,p_attribute9            => p_attribute9
163   ,p_attribute10           => p_attribute10
164   ,p_attribute11           => p_attribute11
165   ,p_attribute12           => p_attribute12
166   ,p_attribute13           => p_attribute13
167   ,p_attribute14           => p_attribute14
168   ,p_attribute15           => p_attribute15
169   ,p_attribute16           => p_attribute16
170   ,p_attribute17           => p_attribute17
171   ,p_attribute18           => p_attribute18
172   ,p_attribute19           => p_attribute19
173   ,p_attribute20           => p_attribute20
174   ,p_attribute21           => p_attribute21
175   ,p_attribute22           => p_attribute22
176   ,p_attribute23           => p_attribute23
177   ,p_attribute24           => p_attribute24
178   ,p_attribute25           => p_attribute25
179   ,p_attribute26           => p_attribute26
180   ,p_attribute27           => p_attribute27
181   ,p_attribute28           => p_attribute28
182   ,p_attribute29           => p_attribute29
183   ,p_attribute30           => p_attribute30
184   ,p_called_from_form      => p_called_from_form );
185 --
186   if g_debug then
187   	hr_utility.set_location(l_proc, 50);
188   end if;
189   --
190   -- Call After Process User Hook
191   --
192   begin
193     hxc_time_entry_group_comp_BK_1.create_time_entry_group_comp_a
194 	  (p_time_entry_group_comp_id  => l_time_entry_group_comp_id
195 	  ,p_object_version_number          => l_object_version_number
196           ,p_time_entry_rule_id             => p_time_entry_rule_id
197           ,p_time_entry_rule_group_id       => p_time_entry_rule_group_id
198           ,p_attribute_category    => p_attribute_category
199           ,p_attribute1            => p_attribute1
200           ,p_attribute2            => p_attribute2
201           ,p_attribute3            => p_attribute3
202           ,p_attribute4            => p_attribute4
203           ,p_attribute5            => p_attribute5
204           ,p_attribute6            => p_attribute6
205           ,p_attribute7            => p_attribute7
206           ,p_attribute8            => p_attribute8
207           ,p_attribute9            => p_attribute9
208           ,p_attribute10           => p_attribute10
209           ,p_attribute11           => p_attribute11
210           ,p_attribute12           => p_attribute12
211           ,p_attribute13           => p_attribute13
212           ,p_attribute14           => p_attribute14
213           ,p_attribute15           => p_attribute15
214           ,p_attribute16           => p_attribute16
215           ,p_attribute17           => p_attribute17
216           ,p_attribute18           => p_attribute18
217           ,p_attribute19           => p_attribute19
218           ,p_attribute20           => p_attribute20
219           ,p_attribute21           => p_attribute21
220           ,p_attribute22           => p_attribute22
221           ,p_attribute23           => p_attribute23
222           ,p_attribute24           => p_attribute24
223           ,p_attribute25           => p_attribute25
224           ,p_attribute26           => p_attribute26
225           ,p_attribute27           => p_attribute27
226           ,p_attribute28           => p_attribute28
227           ,p_attribute29           => p_attribute29
228           ,p_attribute30           => p_attribute30 );
229   exception
230     when hr_api.cannot_find_prog_unit then
231       hr_api.cannot_find_prog_unit_error
232         (p_module_name => 'create_time_entry_group_comp'
233         ,p_hook_type   => 'AP'
234         );
235   end;
236   --
237   if g_debug then
238   	hr_utility.set_location(l_proc, 60);
239   end if;
240   --
241   -- When in validation only mode raise the Validate_Enabled exception
242   --
243   if p_validate then
244     raise hr_api.validate_enabled;
245   end if;
246   --
247   if g_debug then
248   	hr_utility.set_location(' Leaving:'||l_proc, 70);
249   end if;
250   --
251   -- Set all output arguments
252   --
253   p_time_entry_group_comp_id := l_time_entry_group_comp_id;
254   p_object_version_number := l_object_version_number;
255   --
256 exception
257   --
258   when hr_api.validate_enabled then
259     --
260     -- As the Validate_Enabled exception has been raised
261     -- we must rollback to the savepoint
262     --
263     ROLLBACK TO create_time_entry_group_comp;
264     --
265     -- Only set output warning arguments
266     -- (Any key or derived arguments must be set to null
267     -- when validation only mode is being used.)
268     --
269     p_time_entry_group_comp_id := null;
270     p_object_version_number  := null;
271     --
272     if g_debug then
273     	hr_utility.set_location(' Leaving:'||l_proc, 80);
274     end if;
275     --
276   when others then
277     --
278     -- A validation or unexpected error has occured
279     --
280 if g_debug then
281 	hr_utility.trace('In exeception');
282 end if;
283     ROLLBACK TO create_time_entry_group_comp;
284     raise;
285     --
286 END create_time_entry_group_comp;
287 --
288 -- ----------------------------------------------------------------------------
289 -- |---------------------< update_time_entry_group_comp>----------------------|
290 -- ----------------------------------------------------------------------------
291 --
292 procedure update_time_entry_group_comp
293   (p_validate                       in  boolean   default false
294   ,p_effective_date                 in  date
295   ,p_time_entry_group_comp_id  in  number
296   ,p_object_version_number          in  out nocopy number
297   ,p_time_entry_rule_id             in      number
298   ,p_time_entry_rule_group_id       in      number
299   ,p_attribute_category             in     varchar2 default null
300   ,p_attribute1                     in     varchar2 default null
301   ,p_attribute2                     in     varchar2 default null
302   ,p_attribute3                     in     varchar2 default null
303   ,p_attribute4                     in     varchar2 default null
304   ,p_attribute5                     in     varchar2 default null
305   ,p_attribute6                     in     varchar2 default null
306   ,p_attribute7                     in     varchar2 default null
307   ,p_attribute8                     in     varchar2 default null
308   ,p_attribute9                     in     varchar2 default null
309   ,p_attribute10                    in     varchar2 default null
310   ,p_attribute11                    in     varchar2 default null
311   ,p_attribute12                    in     varchar2 default null
312   ,p_attribute13                    in     varchar2 default null
313   ,p_attribute14                    in     varchar2 default null
314   ,p_attribute15                    in     varchar2 default null
315   ,p_attribute16                    in     varchar2 default null
316   ,p_attribute17                    in     varchar2 default null
317   ,p_attribute18                    in     varchar2 default null
318   ,p_attribute19                    in     varchar2 default null
319   ,p_attribute20                    in     varchar2 default null
320   ,p_attribute21                    in     varchar2 default null
321   ,p_attribute22                    in     varchar2 default null
322   ,p_attribute23                    in     varchar2 default null
323   ,p_attribute24                    in     varchar2 default null
324   ,p_attribute25                    in     varchar2 default null
325   ,p_attribute26                    in     varchar2 default null
326   ,p_attribute27                    in     varchar2 default null
327   ,p_attribute28                    in     varchar2 default null
328   ,p_attribute29                    in     varchar2 default null
329   ,p_attribute30                    in     varchar2 default null
330   ,p_called_from_form               in     varchar2 default 'N'
331   ) is
332   --
333   -- Declare cursors and local variables
334   --
335 	l_proc varchar2(72);
336 	l_object_version_number hxc_entity_group_comps.object_version_number%TYPE := p_object_version_number;
337   --
338 begin
339 
340   g_debug := hr_utility.debug_enabled;
341 
342   if g_debug then
343   	l_proc := g_package||' update_time_entry_group_comp';
344   	hr_utility.set_location('Entering:'|| l_proc, 10);
345   end if;
346 
347   -- Issue a savepoint if operating in validation only mode
348 
349   savepoint update_time_entry_group_comp;
350   --
351   if g_debug then
352   	hr_utility.set_location(l_proc, 20);
353   end if;
354 
355 	chk_ter_unique ( p_time_entry_group_comp_id	=> p_time_entry_group_comp_id
356 			,p_time_entry_rule_group_id	=> p_time_entry_rule_group_id
357 			,p_time_entry_rule_id	        => p_time_entry_rule_id );
358 
359   --
360   -- Call Before Process User Hook
361   --
362   begin
363     hxc_time_entry_group_comp_BK_2.update_time_entry_group_comp_b
364 	  (p_time_entry_group_comp_id  => p_time_entry_group_comp_id
365 	  ,p_object_version_number  => p_object_version_number
366           ,p_time_entry_rule_id             => p_time_entry_rule_id
367           ,p_time_entry_rule_group_id   => p_time_entry_rule_group_id
368           ,p_attribute_category    => p_attribute_category
369           ,p_attribute1            => p_attribute1
370           ,p_attribute2            => p_attribute2
371           ,p_attribute3            => p_attribute3
372           ,p_attribute4            => p_attribute4
373           ,p_attribute5            => p_attribute5
374           ,p_attribute6            => p_attribute6
375           ,p_attribute7            => p_attribute7
376           ,p_attribute8            => p_attribute8
377           ,p_attribute9            => p_attribute9
378           ,p_attribute10           => p_attribute10
379           ,p_attribute11           => p_attribute11
380           ,p_attribute12           => p_attribute12
381           ,p_attribute13           => p_attribute13
382           ,p_attribute14           => p_attribute14
383           ,p_attribute15           => p_attribute15
384           ,p_attribute16           => p_attribute16
385           ,p_attribute17           => p_attribute17
386           ,p_attribute18           => p_attribute18
387           ,p_attribute19           => p_attribute19
388           ,p_attribute20           => p_attribute20
389           ,p_attribute21           => p_attribute21
390           ,p_attribute22           => p_attribute22
391           ,p_attribute23           => p_attribute23
392           ,p_attribute24           => p_attribute24
393           ,p_attribute25           => p_attribute25
394           ,p_attribute26           => p_attribute26
395           ,p_attribute27           => p_attribute27
396           ,p_attribute28           => p_attribute28
397           ,p_attribute29           => p_attribute29
398           ,p_attribute30           => p_attribute30
399   );
400   exception
401     when hr_api.cannot_find_prog_unit then
402       hr_api.cannot_find_prog_unit_error
403         (p_module_name => 'update_time_entry_group_comp'
404         ,p_hook_type   => 'BP'
405         );
406   end;
407   --
408   if g_debug then
409   	hr_utility.set_location(l_proc, 30);
410   end if;
411   --
412   -- Process Logic
413 --
414 -- call row handler
415 --
416 hxc_egc_upd.upd (
417    p_effective_date        => p_effective_date
418   ,p_entity_id            => p_time_entry_rule_id
419   ,p_entity_type          => g_entity_type
420   ,p_entity_group_id       => p_time_entry_rule_group_id
421   ,p_entity_group_comp_id  => p_time_entry_group_comp_id
422   ,p_object_version_number => l_object_version_number
423   ,p_attribute_category    => p_attribute_category
424   ,p_attribute1            => p_attribute1
425   ,p_attribute2            => p_attribute2
426   ,p_attribute3            => p_attribute3
427   ,p_attribute4            => p_attribute4
428   ,p_attribute5            => p_attribute5
429   ,p_attribute6            => p_attribute6
430   ,p_attribute7            => p_attribute7
431   ,p_attribute8            => p_attribute8
432   ,p_attribute9            => p_attribute9
433   ,p_attribute10           => p_attribute10
434   ,p_attribute11           => p_attribute11
435   ,p_attribute12           => p_attribute12
436   ,p_attribute13           => p_attribute13
437   ,p_attribute14           => p_attribute14
438   ,p_attribute15           => p_attribute15
439   ,p_attribute16           => p_attribute16
440   ,p_attribute17           => p_attribute17
441   ,p_attribute18           => p_attribute18
442   ,p_attribute19           => p_attribute19
443   ,p_attribute20           => p_attribute20
444   ,p_attribute21           => p_attribute21
445   ,p_attribute22           => p_attribute22
446   ,p_attribute23           => p_attribute23
447   ,p_attribute24           => p_attribute24
448   ,p_attribute25           => p_attribute25
449   ,p_attribute26           => p_attribute26
450   ,p_attribute27           => p_attribute27
451   ,p_attribute28           => p_attribute28
452   ,p_attribute29           => p_attribute29
453   ,p_attribute30           => p_attribute30
454   ,p_called_from_form      => p_called_from_form );
455 --
456   --
457   if g_debug then
458   	hr_utility.set_location(l_proc, 40);
459   end if;
460   --
461   -- Call After Process User Hook
462   --
463   begin
464     hxc_time_entry_group_comp_BK_2.update_time_entry_group_comp_a
465 	  (p_time_entry_group_comp_id  => p_time_entry_group_comp_id
466 	  ,p_object_version_number  => l_object_version_number
467           ,p_time_entry_rule_id             => p_time_entry_rule_id
468           ,p_time_entry_rule_group_id   => p_time_entry_rule_group_id
469           ,p_attribute_category    => p_attribute_category
470           ,p_attribute1            => p_attribute1
471           ,p_attribute2            => p_attribute2
472           ,p_attribute3            => p_attribute3
473           ,p_attribute4            => p_attribute4
474           ,p_attribute5            => p_attribute5
475           ,p_attribute6            => p_attribute6
476           ,p_attribute7            => p_attribute7
477           ,p_attribute8            => p_attribute8
478           ,p_attribute9            => p_attribute9
479           ,p_attribute10           => p_attribute10
480           ,p_attribute11           => p_attribute11
481           ,p_attribute12           => p_attribute12
482           ,p_attribute13           => p_attribute13
483           ,p_attribute14           => p_attribute14
484           ,p_attribute15           => p_attribute15
485           ,p_attribute16           => p_attribute16
486           ,p_attribute17           => p_attribute17
487           ,p_attribute18           => p_attribute18
488           ,p_attribute19           => p_attribute19
489           ,p_attribute20           => p_attribute20
490           ,p_attribute21           => p_attribute21
491           ,p_attribute22           => p_attribute22
492           ,p_attribute23           => p_attribute23
493           ,p_attribute24           => p_attribute24
494           ,p_attribute25           => p_attribute25
495           ,p_attribute26           => p_attribute26
496           ,p_attribute27           => p_attribute27
497           ,p_attribute28           => p_attribute28
498           ,p_attribute29           => p_attribute29
499           ,p_attribute30           => p_attribute30
500   );
501   exception
502     when hr_api.cannot_find_prog_unit then
503       hr_api.cannot_find_prog_unit_error
504         (p_module_name => 'update_time_entry_group_comp'
505         ,p_hook_type   => 'AP'
506         );
507   end;
508   --
509   if g_debug then
510   	hr_utility.set_location(l_proc, 50);
511   end if;
512   --
513   -- When in validation only mode raise the Validate_Enabled exception
514   --
515   if p_validate then
516     raise hr_api.validate_enabled;
517   end if;
518   --
519   if g_debug then
520   	hr_utility.set_location(' Leaving:'||l_proc, 60);
521   end if;
522   --
523   -- Set all output arguments
524   --
525   p_object_version_number := l_object_version_number;
526   --
527 exception
528   --
529   when hr_api.validate_enabled then
530     --
531     -- As the Validate_Enabled exception has been raised
532     -- we must rollback to the savepoint
533     --
534     ROLLBACK TO update_time_entry_group_comp;
535     --
536     -- Only set output warning arguments
537     -- (Any key or derived arguments must be set to null
538     -- when validation only mode is being used.)
539     --
540     p_object_version_number  := null;
541     --
542     if g_debug then
543     	hr_utility.set_location(' Leaving:'||l_proc, 60);
544     end if;
545     --
546   when others then
547     --
548     -- A validation or unexpected error has occured
549     --
550 if g_debug then
551 	hr_utility.trace('In exeception');
552 end if;
553     ROLLBACK TO update_time_entry_group_comp;
554     raise;
555     --
556 END update_time_entry_group_comp;
557 --
558 -- ----------------------------------------------------------------------------
559 -- |---------------------< delete_time_entry_group_comp >---------------------|
560 -- ----------------------------------------------------------------------------
561 --
562 procedure delete_time_entry_group_comp
563   (p_validate                       in  boolean  default false
564   ,p_time_entry_group_comp_id       in  number
565   ,p_time_entry_rule_group_id       in  number
566   ,p_object_version_number          in  number
567   ) is
568   --
569   -- Declare cursors and local variables
570   --
571   l_proc varchar2(72);
572   --
573 begin
574 
575   g_debug := hr_utility.debug_enabled;
576   --
577 
578 if g_debug then
579 	l_proc := g_package||'delete_time_entry_group_comp';
580 	hr_utility.set_location('Entering:'|| l_proc, 10);
581 end if;
582   --
583   -- Issue a savepoint if operating in validation only mode
584   --
585   savepoint delete_time_entry_group_comp;
586   --
587   if g_debug then
588   	hr_utility.set_location(l_proc, 20);
589   end if;
590 
591 -- gaz - replace this with a check to make sure that if it is referenced it
592 -- isn't the last one being deleted - new error message?
593 
594 --	hxc_time_entry_rule_group_api.chk_delete(
595 --				p_entity_group_id => p_time_entry_rule_group_id
596 --			,	p_entity_type     => g_entity_type );
597 
598   --
599   -- Call Before Process User Hook
600   --
601   begin
602   --
603     hxc_time_entry_group_comp_BK_3.delete_time_entry_group_comp_b
604 	  (p_time_entry_group_comp_id => p_time_entry_group_comp_id
605 	  ,p_object_version_number => p_object_version_number
606 	  );
607   exception
608     when hr_api.cannot_find_prog_unit then
609       hr_api.cannot_find_prog_unit_error
610         (p_module_name => 'delete_time_entry_group_comp_b'
611         ,p_hook_type   => 'BP'
612         );
613   end;
614   --
615   if g_debug then
616   	hr_utility.set_location(l_proc, 30);
617   end if;
618   --
619   -- Process Logic
620   --
621   hxc_egc_del.del
622     (
623      p_entity_group_comp_id => p_time_entry_group_comp_id
624     ,p_object_version_number => p_object_version_number
625     );
626   --
627   if g_debug then
628   	hr_utility.set_location(l_proc, 40);
629   end if;
630   --
631   -- Call After Process User Hook
632   --
633   begin
634   --
635   hxc_time_entry_group_comp_BK_3.delete_time_entry_group_comp_a
636 	  (p_time_entry_group_comp_id => p_time_entry_group_comp_id
637 	  ,p_object_version_number => p_object_version_number
638 	  );
639   exception
640     when hr_api.cannot_find_prog_unit then
641       hr_api.cannot_find_prog_unit_error
642         (p_module_name => 'delete_time_entry_group_comp_a'
643         ,p_hook_type   => 'AP'
644         );
645   end;
646   --
647   -- When in validation only mode raise the Validate_Enabled exception
648   --
649   if p_validate then
650     raise hr_api.validate_enabled;
651   end if;
652   --
653   if g_debug then
654   	hr_utility.set_location(' Leaving:'||l_proc, 50);
655   end if;
656   --
657 exception
658   --
659   when hr_api.validate_enabled then
660     --
661     -- As the Validate_Enabled exception has been raised
662     -- we must rollback to the savepoint
663     --
664     ROLLBACK TO delete_time_entry_group_comp;
665     --
666   when others then
667     --
668     -- A validation or unexpected error has occured
669     --
670     ROLLBACK TO delete_time_entry_group_comp;
671     raise;
672     --
673 end delete_time_entry_group_comp;
674 --
675 -- ----------------------------------------------------------------------------
676 -- |-----------------------< chk_ter_unique >---------------------------------|
677 -- ----------------------------------------------------------------------------
678 --
679 -- Description:
680 --   This procedure insures a unique time entry rule per grouping
681 --
682 -- Pre Conditions:
683 --   None
684 --
685 -- In Arguments:
686 --   time_entry_group_comp_id
687 --   time_entry_rule_group_id
688 --   time_entry_rule_id
689 --
690 -- Post Success:
691 --   Processing continues if the entity id business rules
692 --   have not been violated
693 --
694 -- Post Failure:
695 --   An application error is raised if the ter id is not unique
696 --
697 -- ----------------------------------------------------------------------------
698 Procedure chk_ter_unique
699   (
700    p_time_entry_group_comp_id    in hxc_entity_group_comps.entity_group_comp_id%TYPE
701 ,  p_time_entry_rule_group_id    in hxc_entity_group_comps.entity_group_id%TYPE
702 ,  p_time_entry_rule_id          in hxc_time_entry_rules.time_entry_rule_id%TYPE
703   ) IS
704 --
705   l_proc  varchar2(72);
706 --
707 -- cursor to check ter name is unique
708 --
709 CURSOR  csr_chk_ter IS
710 SELECT 'error'
711 FROM	sys.dual
712 WHERE EXISTS (
713 	SELECT	'x'
714 	FROM	hxc_entity_group_comps egc
715 	WHERE	egc.entity_group_id	= p_time_entry_rule_group_id
716 	AND	egc.entity_id		= p_time_entry_rule_id
717 	AND	(  egc.entity_group_comp_id <> p_time_entry_group_comp_id
718 		OR p_time_entry_group_comp_id IS NULL ));
719 
720 --
721  l_error varchar2(5) := NULL;
722 --
723 BEGIN
724 
725   g_debug := hr_utility.debug_enabled;
726 
727   if g_debug then
728   	l_proc := g_package||'chk_ter_unique';
729   	hr_utility.set_location('Entering:'||l_proc, 5);
730   end if;
731 --
732 -- check that ter is unique within the grouping
733 --
734   OPEN  csr_chk_ter;
735   FETCH csr_chk_ter INTO l_error;
736   CLOSE csr_chk_ter;
737 --
738 IF l_error IS NOT NULL
739 THEN
740 --
741       hr_utility.set_message(809, 'HXC_EGC_TER_NOT_UNIQUE');
742       hr_utility.raise_error;
743 --
744 END IF;
745 --
746   if g_debug then
747   	hr_utility.set_location('Leaving:'||l_proc, 20);
748   end if;
749 --
750 END chk_ter_unique;
751 --
752 END hxc_time_entry_group_comp_api;