DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_TIME_SOURCE_API

Source


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