DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_MAPPING_COMP_USAGE_API

Source


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