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