DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_MAPPING_COMPONENT_API

Source


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