DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_TIME_RECIPIENT_API

Source


1 Package Body hxc_time_recipient_api as
2 /* $Header: hxchtrapi.pkb 120.2 2005/09/23 05:25:04 nissharm noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  hxc_time_recipient_api.';
7 g_debug boolean := hr_utility.debug_enabled;
8 --
9 -- ----------------------------------------------------------------------------
10 -- |------------------------< create_time_recipient >----------------------------|
11 -- ----------------------------------------------------------------------------
12 --
13 procedure create_time_recipient
14   (p_validate                       in      boolean   default false
15   ,p_time_recipient_id              in  out nocopy hxc_time_recipients.time_recipient_id%TYPE
16   ,p_application_id                 in  out nocopy hxc_time_recipients.application_id%TYPE
17   ,p_object_version_number          in  out nocopy hxc_time_recipients.object_version_number%TYPE
18   ,p_name                           in      varchar2
19   ,p_appl_retrieval_function        in      varchar2 default NULL
20   ,p_appl_update_process            in      varchar2 default NULL
21   ,p_appl_validation_process        in      varchar2 default NULL
22   ,p_appl_period_function           in      varchar2 default NULL
23   ,p_appl_dyn_template_process      in      varchar2 default NULL
24   ,p_extension_function1            in      varchar2 default NULL
25   ,p_extension_function2            in      varchar2 default NULL
26   ) is
27   --
28   -- Declare cursors and local variables
29   --
30 	l_proc varchar2(72);
31 	l_object_version_number hxc_time_recipients.object_version_number%TYPE;
32 	l_time_recipient_id            hxc_time_recipients.time_recipient_id%TYPE;
33   --
34 begin
35   g_debug := hr_utility.debug_enabled;
36   --
37   --
38   if g_debug then
39   	l_proc := g_package||' create_time_recipient';
40   	hr_utility.set_location('Entering:'|| l_proc, 10);
41   end if;
42   --
43   -- Issue a savepoint if operating in validation only mode
44   --
45   savepoint create_time_recipient;
46   --
47   if g_debug then
48   	hr_utility.set_location(l_proc, 20);
49   end if;
50   --
51   -- Call Before Process User Hook
52   --
53   begin
54     hxc_time_recipient_BK_1.create_time_recipient_b
55 	  (p_time_recipient_id          => p_time_recipient_id
56 	  ,p_application_id		=> p_application_id
57 	  ,p_object_version_number      => p_object_version_number
58 	  ,p_name                       => p_name
59           ,p_appl_retrieval_function    => p_appl_retrieval_function
60           ,p_appl_update_process        => p_appl_update_process
61           ,p_appl_validation_process    => p_appl_validation_process
62           ,p_appl_period_function       => p_appl_period_function
63           ,p_appl_dyn_template_process  => p_appl_dyn_template_process
64           ,p_extension_function1        => p_extension_function1
65           ,p_extension_function2        => p_extension_function2
66   );
67   exception
68     when hr_api.cannot_find_prog_unit then
69       hr_api.cannot_find_prog_unit_error
70         (p_module_name => 'create_time_recipient'
71         ,p_hook_type   => 'BP'
72         );
73   end;
74   --
75   if g_debug then
76   	hr_utility.set_location(l_proc, 30);
77   end if;
78   --
79   -- Process Logic
80   --
81 --
82   if g_debug then
83   	hr_utility.set_location(l_proc, 40);
84   end if;
85 --
86 -- call row handler
87 --
88 hxc_htr_ins.ins (
89    p_effective_date	        => sysdate
90   ,p_name 	                => p_name
91   ,p_appl_retrieval_function    => p_appl_retrieval_function
92   ,p_appl_update_process        => p_appl_update_process
93   ,p_appl_validation_process    => p_appl_validation_process
94   ,p_appl_period_function       => p_appl_period_function
95   ,p_appl_dyn_template_process  => p_appl_dyn_template_process
96   ,p_extension_function1        => p_extension_function1
97   ,p_extension_function2        => p_extension_function2
98   ,p_time_recipient_id          => l_time_recipient_id
99   ,p_application_id             => p_application_id
100   ,p_object_version_number      => l_object_version_number );
101 --
102   if g_debug then
103   	hr_utility.set_location(l_proc, 50);
104   end if;
105   --
106   -- Call After Process User Hook
107   --
108   begin
109     hxc_time_recipient_BK_1.create_time_recipient_a
110 	  (p_time_recipient_id          => l_time_recipient_id
111 	  ,p_application_id		=> p_application_id
112 	  ,p_object_version_number      => l_object_version_number
113 	  ,p_name                       => p_name
114           ,p_appl_retrieval_function    => p_appl_retrieval_function
115           ,p_appl_update_process        => p_appl_update_process
116           ,p_appl_validation_process    => p_appl_validation_process
117           ,p_appl_period_function       => p_appl_period_function
118           ,p_appl_dyn_template_process  => p_appl_dyn_template_process
119           ,p_extension_function1        => p_extension_function1
120           ,p_extension_function2        => p_extension_function2
121   );
122   exception
123     when hr_api.cannot_find_prog_unit then
124       hr_api.cannot_find_prog_unit_error
125         (p_module_name => 'create_time_recipient'
126         ,p_hook_type   => 'AP'
127         );
128   end;
129   --
130   if g_debug then
131   	hr_utility.set_location(l_proc, 60);
132   end if;
133   --
134   -- When in validation only mode raise the Validate_Enabled exception
135   --
136   if p_validate then
137     raise hr_api.validate_enabled;
138   end if;
139   --
140   if g_debug then
141   	hr_utility.set_location(' Leaving:'||l_proc, 70);
142   end if;
143   --
144   -- Set all output arguments
145   --
146   p_time_recipient_id     := l_time_recipient_id;
147   p_object_version_number := l_object_version_number;
148   --
149 exception
150   --
151   when hr_api.validate_enabled then
152     --
153     -- As the Validate_Enabled exception has been raised
154     -- we must rollback to the savepoint
155     --
156     ROLLBACK TO create_time_recipient;
157     --
158     -- Only set output warning arguments
159     -- (Any key or derived arguments must be set to null
160     -- when validation only mode is being used.)
161     --
162     p_time_recipient_id             := null;
163     p_object_version_number  := null;
164     --
165     if g_debug then
166     	hr_utility.set_location(' Leaving:'||l_proc, 80);
167     end if;
168     --
169   when others then
170     --
171     -- A validation or unexpected error has occured
172     --
173 if g_debug then
174 	hr_utility.trace('In exeception');
175 end if;
176     ROLLBACK TO create_time_recipient;
177     raise;
178     --
179 END create_time_recipient;
180 --
181 -- ----------------------------------------------------------------------------
182 -- |------------------------< update_time_recipient>--------------------------|
183 -- ----------------------------------------------------------------------------
184 --
185 procedure update_time_recipient
186   (p_validate                       in      boolean   default false
187   ,p_time_recipient_id              in      hxc_time_recipients.time_recipient_id%TYPE
188   ,p_application_id                 in      hxc_time_recipients.application_id%TYPE
189   ,p_object_version_number          in  out nocopy hxc_time_recipients.object_version_number%TYPE
190   ,p_name                           in      hxc_time_recipients.name%TYPE
191   ,p_appl_retrieval_function        in      varchar2 default NULL
192   ,p_appl_update_process            in      varchar2 default NULL
193   ,p_appl_validation_process        in      varchar2 default NULL
194   ,p_appl_period_function           in      varchar2 default NULL
195   ,p_appl_dyn_template_process      in      varchar2 default NULL
196   ,p_extension_function1            in      varchar2 default NULL
197   ,p_extension_function2            in      varchar2 default NULL
198   ) is
199   --
200   -- Declare cursors and local variables
201   --
202 	l_proc varchar2(72);
203 	l_object_version_number hxc_time_recipients.object_version_number%TYPE := p_object_version_number;
204   --
205 begin
206   g_debug := hr_utility.debug_enabled;
207   --
208   if g_debug then
209   	l_proc := g_package||' update_time_recipient';
210   	hr_utility.set_location('Entering:'|| l_proc, 10);
211   end if;
212   --
213   -- Issue a savepoint if operating in validation only mode
214   --
215   savepoint update_time_recipient;
216   --
217   if g_debug then
218   	hr_utility.set_location(l_proc, 20);
219   end if;
220   --
221   -- Call Before Process User Hook
222   --
223   begin
224     hxc_time_recipient_BK_2.update_time_recipient_b
225 	  (p_time_recipient_id          => p_time_recipient_id
226 	  ,p_application_id             => p_application_id
227 	  ,p_object_version_number      => p_object_version_number
228 	  ,p_name                       => p_name
229           ,p_appl_retrieval_function    => p_appl_retrieval_function
230           ,p_appl_update_process        => p_appl_update_process
231           ,p_appl_validation_process    => p_appl_validation_process
232           ,p_appl_period_function       => p_appl_period_function
233           ,p_appl_dyn_template_process  => p_appl_dyn_template_process
234           ,p_extension_function1        => p_extension_function1
235           ,p_extension_function2        => p_extension_function2
236   );
237   exception
238     when hr_api.cannot_find_prog_unit then
239       hr_api.cannot_find_prog_unit_error
240         (p_module_name => 'update_time_recipient'
241         ,p_hook_type   => 'BP'
242         );
243   end;
244   --
245   if g_debug then
246   	hr_utility.set_location(l_proc, 30);
247   end if;
248   --
249   -- Process Logic
250 --
251 -- call row handler
252 --
253 hxc_htr_upd.upd (
254    p_effective_date	        => sysdate
255   ,p_name                       => p_name
256   ,p_appl_retrieval_function    => p_appl_retrieval_function
257   ,p_appl_update_process        => p_appl_update_process
258   ,p_appl_validation_process    => p_appl_validation_process
259   ,p_appl_period_function       => p_appl_period_function
260   ,p_appl_dyn_template_process  => p_appl_dyn_template_process
261   ,p_extension_function1        => p_extension_function1
262   ,p_extension_function2        => p_extension_function2
263   ,p_time_recipient_id          => p_time_recipient_id
264   ,p_application_id             => p_application_id
265   ,p_object_version_number      => l_object_version_number );
266 --
267   --
268   if g_debug then
269   	hr_utility.set_location(l_proc, 40);
270   end if;
271   --
272   -- Call After Process User Hook
273   --
274   begin
275     hxc_time_recipient_BK_2.update_time_recipient_a
276 	  (p_time_recipient_id          => p_time_recipient_id
277 	  ,p_application_id             => p_application_id
278 	  ,p_object_version_number      => l_object_version_number
279 	  ,p_name                       => p_name
280           ,p_appl_retrieval_function    => p_appl_retrieval_function
281           ,p_appl_update_process        => p_appl_update_process
282           ,p_appl_validation_process    => p_appl_validation_process
283           ,p_appl_period_function       => p_appl_period_function
284           ,p_appl_dyn_template_process  => p_appl_dyn_template_process
285           ,p_extension_function1        => p_extension_function1
286           ,p_extension_function2        => p_extension_function2
287   );
288   exception
289     when hr_api.cannot_find_prog_unit then
290       hr_api.cannot_find_prog_unit_error
291         (p_module_name => 'update_time_recipient'
292         ,p_hook_type   => 'AP'
293         );
294   end;
295   --
296   if g_debug then
297   	hr_utility.set_location(l_proc, 50);
298   end if;
299   --
300   -- When in validation only mode raise the Validate_Enabled exception
301   --
302   if p_validate then
303     raise hr_api.validate_enabled;
304   end if;
305   --
306   if g_debug then
307   	hr_utility.set_location(' Leaving:'||l_proc, 60);
308   end if;
309   --
310   -- Set all output arguments
311   --
312   p_object_version_number := l_object_version_number;
313   --
314 exception
315   --
316   when hr_api.validate_enabled then
317     --
318     -- As the Validate_Enabled exception has been raised
319     -- we must rollback to the savepoint
320     --
321     ROLLBACK TO update_time_recipient;
322     --
323     -- Only set output warning arguments
324     -- (Any key or derived arguments must be set to null
325     -- when validation only mode is being used.)
326     --
327     p_object_version_number  := null;
328     --
329     if g_debug then
330     	hr_utility.set_location(' Leaving:'||l_proc, 60);
331     end if;
332     --
333   when others then
334     --
335     -- A validation or unexpected error has occured
336     --
337 if g_debug then
338 	hr_utility.trace('In exeception');
339 end if;
340     ROLLBACK TO update_time_recipient;
341     raise;
342     --
343 END update_time_recipient;
344 --
345 -- ----------------------------------------------------------------------------
346 -- |------------------------< delete_time_recipient >-------------------------|
347 -- ----------------------------------------------------------------------------
348 --
349 procedure delete_time_recipient
350   (p_validate                       in  boolean  default false
351   ,p_time_recipient_id              in  hxc_time_recipients.time_recipient_id%TYPE
352   ,p_object_version_number          in  hxc_time_recipients.object_version_number%TYPE
353   ) is
354   --
355   -- Declare cursors and local variables
356   --
357   l_proc varchar2(72);
358   --
359 begin
360   g_debug := hr_utility.debug_enabled;
361   --
362   if g_debug then
363   	l_proc := g_package||'delete_time_recipient';
364   	hr_utility.set_location('Entering:'|| l_proc, 10);
365   end if;
366   --
367   -- Issue a savepoint if operating in validation only mode
368   --
369   savepoint delete_time_recipient;
370   --
371   if g_debug then
372   	hr_utility.set_location(l_proc, 20);
373   end if;
374   --
375   -- Call Before Process User Hook
376   --
377   begin
378   --
379     hxc_time_recipient_BK_3.delete_time_recipient_b
380 	  (p_time_recipient_id            => p_time_recipient_id
381 	  ,p_object_version_number => p_object_version_number
382 	  );
383   exception
384     when hr_api.cannot_find_prog_unit then
385       hr_api.cannot_find_prog_unit_error
386         (p_module_name => 'delete_time_recipient_b'
387         ,p_hook_type   => 'BP'
388         );
389   end;
390   --
391   if g_debug then
392   	hr_utility.set_location(l_proc, 30);
393   end if;
394   --
395   -- Process Logic
396   --
397   hxc_htr_del.del
398     (
399      p_time_recipient_id            => p_time_recipient_id
400     ,p_object_version_number => p_object_version_number
401     );
402   --
403   if g_debug then
404   	hr_utility.set_location(l_proc, 40);
405   end if;
406   --
407   -- Call After Process User Hook
408   --
409   begin
410   --
411   hxc_time_recipient_BK_3.delete_time_recipient_a
412 	  (p_time_recipient_id            => p_time_recipient_id
413 	  ,p_object_version_number => p_object_version_number
414 	  );
415   exception
416     when hr_api.cannot_find_prog_unit then
417       hr_api.cannot_find_prog_unit_error
418         (p_module_name => 'delete_time_recipient_a'
419         ,p_hook_type   => 'AP'
420         );
421   end;
422   --
423   -- When in validation only mode raise the Validate_Enabled exception
424   --
425   if p_validate then
426     raise hr_api.validate_enabled;
427   end if;
428   --
429   if g_debug then
430   	hr_utility.set_location(' Leaving:'||l_proc, 50);
431   end if;
432   --
433 exception
434   --
435   when hr_api.validate_enabled then
436     --
437     -- As the Validate_Enabled exception has been raised
438     -- we must rollback to the savepoint
439     --
440     ROLLBACK TO delete_time_recipient;
441     --
442   when others then
443     --
444     -- A validation or unexpected error has occured
445     --
446     ROLLBACK TO delete_time_recipient;
447     raise;
448     --
449 end delete_time_recipient;
450 --
451 END hxc_time_recipient_api;