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