[Home] [Help]
PACKAGE BODY: APPS.HXC_FLD_MAPPING_API
Source
1 Package Body hxc_fld_mapping_api as
2 /* $Header: hxcmapapi.pkb 120.2 2005/09/23 08:13:42 nissharm noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' hxc_fld_mapping_api.';
7 g_debug boolean := hr_utility.debug_enabled;
8 --
9 -- ----------------------------------------------------------------------------
10 -- |------------------------< create_fld_mapping >----------------------------|
11 -- ----------------------------------------------------------------------------
12 --
13 procedure create_fld_mapping
14 (p_validate in boolean default false
15 ,p_mapping_id in out nocopy number
16 ,p_object_version_number in out nocopy number
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_mappings.object_version_number%TYPE;
24 l_mapping_id hxc_mappings.mapping_id%TYPE;
25 --
26 begin
27 g_debug := hr_utility.debug_enabled;
28 --
29
30 --
31 if g_debug then
32 l_proc := g_package||' create_fld_mapping';
33 hr_utility.set_location('Entering:'|| l_proc, 10);
34 end if;
35 --
36 -- Issue a savepoint if operating in validation only mode
37 --
38 savepoint create_fld_mapping;
39 --
40 if g_debug then
41 hr_utility.set_location(l_proc, 20);
42 end if;
43 --
44 -- Call Before Process User Hook
45 --
46 begin
47 hxc_fld_mapping_BK_1.create_fld_mapping_b
48 (p_mapping_id => p_mapping_id
49 ,p_object_version_number => p_object_version_number
50 ,p_name => p_name
51 );
52 exception
53 when hr_api.cannot_find_prog_unit then
54 hr_api.cannot_find_prog_unit_error
55 (p_module_name => 'create_fld_mapping'
56 ,p_hook_type => 'BP'
57 );
58 end;
59 --
60 if g_debug then
61 hr_utility.set_location(l_proc, 30);
62 end if;
63 --
64 -- Process Logic
65 --
66 --
67 if g_debug then
68 hr_utility.set_location(l_proc, 40);
69 end if;
70 --
71 -- call row handler
72 --
73 hxc_map_ins.ins (
74 p_name => p_name
75 ,p_mapping_id => l_mapping_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_fld_mapping_BK_1.create_fld_mapping_a
86 (p_mapping_id => l_mapping_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_fld_mapping'
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_mapping_id := l_mapping_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_fld_mapping;
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_mapping_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_fld_mapping;
145 raise;
146 --
147 END create_fld_mapping;
148 --
149 -- ----------------------------------------------------------------------------
150 -- |------------------------< update_fld_mapping>-----------------------------|
151 -- ----------------------------------------------------------------------------
152 --
153 procedure update_fld_mapping
154 (p_validate in boolean default false
155 ,p_mapping_id in number
156 ,p_object_version_number in out nocopy number
157 ,p_name in varchar2
158 ) is
159 --
160 -- Declare cursors and local variables
161 --
162 l_proc varchar2(72);
163 l_object_version_number hxc_mappings.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_fld_mapping';
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_fld_mapping;
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_fld_mapping_BK_2.update_fld_mapping_b
185 (p_mapping_id => p_mapping_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_fld_mapping'
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_map_upd.upd (
206 p_name => p_name
207 ,p_mapping_id => p_mapping_id
208 ,p_object_version_number => l_object_version_number );
209 --
210 --
211 if g_debug then
212 hr_utility.set_location(l_proc, 40);
213 end if;
214 --
215 -- Call After Process User Hook
216 --
217 begin
218 hxc_fld_mapping_BK_2.update_fld_mapping_a
219 (p_mapping_id => p_mapping_id
220 ,p_object_version_number => l_object_version_number
221 ,p_name => p_name
222 );
223 exception
224 when hr_api.cannot_find_prog_unit then
225 hr_api.cannot_find_prog_unit_error
226 (p_module_name => 'update_fld_mapping'
227 ,p_hook_type => 'AP'
228 );
229 end;
230 --
231 if g_debug then
232 hr_utility.set_location(l_proc, 50);
233 end if;
234 --
235 -- When in validation only mode raise the Validate_Enabled exception
236 --
237 if p_validate then
238 raise hr_api.validate_enabled;
239 end if;
240 --
241 if g_debug then
242 hr_utility.set_location(' Leaving:'||l_proc, 60);
243 end if;
244 --
245 -- Set all output arguments
246 --
247 p_object_version_number := l_object_version_number;
248 --
249 exception
250 --
251 when hr_api.validate_enabled then
252 --
253 -- As the Validate_Enabled exception has been raised
254 -- we must rollback to the savepoint
255 --
256 ROLLBACK TO update_fld_mapping;
257 --
258 -- Only set output warning arguments
259 -- (Any key or derived arguments must be set to null
260 -- when validation only mode is being used.)
261 --
262 p_object_version_number := null;
263 --
264 if g_debug then
265 hr_utility.set_location(' Leaving:'||l_proc, 60);
266 end if;
267 --
268 when others then
269 --
270 -- A validation or unexpected error has occured
271 --
272 if g_debug then
273 hr_utility.trace('In exeception');
274 end if;
275 ROLLBACK TO update_fld_mapping;
276 raise;
277 --
278 END update_fld_mapping;
279 --
280 -- ----------------------------------------------------------------------------
281 -- |------------------------< delete_fld_mapping >----------------------------|
282 -- ----------------------------------------------------------------------------
283 --
284 procedure delete_fld_mapping
285 (p_validate in boolean default false
286 ,p_mapping_id in number
287 ,p_object_version_number in number
288 ) is
289 --
290 -- Declare cursors and local variables
291 --
292 l_proc varchar2(72);
293 --
294 begin
295 g_debug := hr_utility.debug_enabled;
296 --
297 if g_debug then
298 l_proc := g_package||'delete_fld_mapping';
299 hr_utility.set_location('Entering:'|| l_proc, 10);
300 end if;
301 --
302 -- Issue a savepoint if operating in validation only mode
303 --
304 savepoint delete_fld_mapping;
305 --
306 if g_debug then
307 hr_utility.set_location(l_proc, 20);
308 end if;
309 --
310 -- Call Before Process User Hook
311 --
312 begin
313 --
314 hxc_fld_mapping_BK_3.delete_fld_mapping_b
315 (p_mapping_id => p_mapping_id
316 ,p_object_version_number => p_object_version_number
317 );
318 exception
319 when hr_api.cannot_find_prog_unit then
320 hr_api.cannot_find_prog_unit_error
321 (p_module_name => 'delete_fld_mapping_b'
322 ,p_hook_type => 'BP'
323 );
324 end;
325 --
326 if g_debug then
327 hr_utility.set_location(l_proc, 30);
328 end if;
329 --
330 -- Process Logic
331 --
332 hxc_map_del.del
333 (
334 p_mapping_id => p_mapping_id
335 ,p_object_version_number => p_object_version_number
336 );
337 --
338 if g_debug then
339 hr_utility.set_location(l_proc, 40);
340 end if;
341 --
342 -- Call After Process User Hook
343 --
344 begin
345 --
346 hxc_fld_mapping_BK_3.delete_fld_mapping_a
347 (p_mapping_id => p_mapping_id
348 ,p_object_version_number => p_object_version_number
349 );
350 exception
351 when hr_api.cannot_find_prog_unit then
352 hr_api.cannot_find_prog_unit_error
353 (p_module_name => 'delete_fld_mapping_a'
354 ,p_hook_type => 'AP'
355 );
356 end;
357 --
358 -- When in validation only mode raise the Validate_Enabled exception
359 --
360 if p_validate then
361 raise hr_api.validate_enabled;
362 end if;
363 --
364 if g_debug then
365 hr_utility.set_location(' Leaving:'||l_proc, 50);
366 end if;
367 --
368 exception
369 --
370 when hr_api.validate_enabled then
371 --
372 -- As the Validate_Enabled exception has been raised
373 -- we must rollback to the savepoint
374 --
375 ROLLBACK TO delete_fld_mapping;
376 --
377 when others then
378 --
379 -- A validation or unexpected error has occured
380 --
381 ROLLBACK TO delete_fld_mapping;
382 raise;
383 --
384 end delete_fld_mapping;
385 --
386 END hxc_fld_mapping_api;