[Home] [Help]
PACKAGE BODY: APPS.BEN_CWB_PERSON_TASKS_API
Source
1 Package Body BEN_CWB_PERSON_TASKS_API as
2 /* $Header: bectkapi.pkb 120.0 2005/05/28 01:25:07 appldev noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' BEN_CWB_PERSON_TASKS_API.';
7 g_debug boolean := hr_utility.debug_enabled;
8 --
9 -- ----------------------------------------------------------------------------
10 -- |--------------------------< create_person_task >--------------------------|
11 -- ----------------------------------------------------------------------------
12 --
13 procedure create_person_task
14 (p_validate in boolean default false
15 ,p_group_per_in_ler_id in number
16 ,p_task_id in number
17 ,p_group_pl_id in number
18 ,p_lf_evt_ocrd_dt in date
19 ,p_status_cd in varchar2 default null
20 ,p_access_cd in varchar2 default null
21 ,p_task_last_update_date in date default null
22 ,p_task_last_update_by in number default null
23 ,p_object_version_number out nocopy number
24 ) is
25 --
26 -- Declare cursors and local variables
27 --
28 l_object_version_number number;
29 --
30 l_proc varchar2(72) := g_package||'create_person_task';
31 begin
32 if g_debug then
33 hr_utility.set_location('Entering:'|| l_proc, 10);
34 end if;
35 --
36 -- Issue a savepoint
37 --
38 savepoint create_person_task;
39 --
40 -- Call Before Process User Hook
41 --
42 begin
43 ben_cwb_person_tasks_bk1.create_person_task_b
44 (p_group_per_in_ler_id => p_group_per_in_ler_id
45 ,p_task_id => p_task_id
46 ,p_group_pl_id => p_group_pl_id
47 ,p_lf_evt_ocrd_dt => p_lf_evt_ocrd_dt
48 ,p_status_cd => p_status_cd
49 ,p_access_cd => p_access_cd
50 ,p_task_last_update_date => p_task_last_update_date
51 ,p_task_last_update_by => p_task_last_update_by
52 );
53 exception
54 when hr_api.cannot_find_prog_unit then
55 hr_api.cannot_find_prog_unit_error
56 (p_module_name => 'CREATE_PERSON_TASK'
57 ,p_hook_type => 'BP'
58 );
59 end;
60 --
61 -- Validation in addition to Row Handlers
62 --
63
64 --
65 -- Process Logic
66 --
67 ben_ctk_ins.ins
68 (p_group_per_in_ler_id => p_group_per_in_ler_id
69 ,p_task_id => p_task_id
70 ,p_group_pl_id => p_group_pl_id
71 ,p_lf_evt_ocrd_dt => p_lf_evt_ocrd_dt
72 ,p_status_cd => p_status_cd
73 ,p_access_cd => p_access_cd
74 ,p_task_last_update_date => p_task_last_update_date
75 ,p_task_last_update_by => p_task_last_update_by
76 ,p_object_version_number => l_object_version_number
77 );
78 --
79 -- Call After Process User Hook
80 --
81 begin
82 ben_cwb_person_tasks_bk1.create_person_task_a
83 (p_group_per_in_ler_id => p_group_per_in_ler_id
84 ,p_task_id => p_task_id
85 ,p_group_pl_id => p_group_pl_id
86 ,p_lf_evt_ocrd_dt => p_lf_evt_ocrd_dt
87 ,p_status_cd => p_status_cd
88 ,p_access_cd => p_access_cd
89 ,p_task_last_update_date => p_task_last_update_date
90 ,p_task_last_update_by => p_task_last_update_by
91 ,p_object_version_number => l_object_version_number
92 );
93 exception
94 when hr_api.cannot_find_prog_unit then
95 hr_api.cannot_find_prog_unit_error
96 (p_module_name => 'CREATE_PERSON_TASK'
97 ,p_hook_type => 'AP'
98 );
99 end;
100 --
101 -- When in validation only mode raise the Validate_Enabled exception
102 --
103 if p_validate then
104 raise hr_api.validate_enabled;
105 end if;
106 --
107 -- Set all IN OUT and OUT parameters with out values
108 --
109 p_object_version_number := l_object_version_number;
110 --
111 if g_debug then
112 hr_utility.set_location(' Leaving:'||l_proc, 70);
113 end if;
114 exception
115 when hr_api.validate_enabled then
116 --
117 -- As the Validate_Enabled exception has been raised
118 -- we must rollback to the savepoint
119 --
120 rollback to create_person_task;
121 --
122 if g_debug then
123 hr_utility.set_location(' Leaving:'||l_proc, 80);
124 end if;
125 when others then
126 --
127 -- A validation or unexpected error has occured
128 --
129 rollback to create_person_task;
130 --
131 if g_debug then
132 hr_utility.set_location(' Leaving:'||l_proc, 90);
133 end if;
134 raise;
135 end create_person_task;
136 --
137 -- ----------------------------------------------------------------------------
138 -- |--------------------------< update_person_task >--------------------------|
139 -- ----------------------------------------------------------------------------
140 --
141 procedure update_person_task
142 (p_validate in boolean default false
143 ,p_group_per_in_ler_id in number
144 ,p_task_id in number
145 ,p_group_pl_id in number default hr_api.g_number
146 ,p_lf_evt_ocrd_dt in date default hr_api.g_date
147 ,p_status_cd in varchar2 default hr_api.g_varchar2
148 ,p_access_cd in varchar2 default hr_api.g_varchar2
149 ,p_task_last_update_date in date default hr_api.g_date
150 ,p_task_last_update_by in number default hr_api.g_number
151 ,p_object_version_number in out nocopy number
152 ) is
153 --
154 -- Declare cursors and local variables
155 --
156 l_object_version_number number;
157 --
158 l_proc varchar2(72) := g_package||'update_person_task';
159 --
160 begin
161 if g_debug then
162 hr_utility.set_location('Entering:'|| l_proc, 10);
163 end if;
164 --
165 l_object_version_number := p_object_version_number;
166 --
167 -- Issue a savepoint
168 --
169 savepoint update_person_task;
170 --
171 -- Call Before Process User Hook
172 --
173 begin
174 ben_cwb_person_tasks_bk2.update_person_task_b
175 (p_group_per_in_ler_id => p_group_per_in_ler_id
176 ,p_task_id => p_task_id
177 ,p_group_pl_id => p_group_pl_id
178 ,p_lf_evt_ocrd_dt => p_lf_evt_ocrd_dt
179 ,p_status_cd => p_status_cd
180 ,p_access_cd => p_access_cd
181 ,p_task_last_update_date => p_task_last_update_date
182 ,p_task_last_update_by => p_task_last_update_by
183 ,p_object_version_number => l_object_version_number
184 );
185 exception
186 when hr_api.cannot_find_prog_unit then
187 hr_api.cannot_find_prog_unit_error
188 (p_module_name => 'UPDATE_PERSON_TASK'
189 ,p_hook_type => 'BP'
190 );
191 end;
192 --
193 -- Validation in addition to Row Handlers
194 --
195
196 --
197 -- Process Logic
198 --
199 ben_ctk_upd.upd
200 (p_group_per_in_ler_id => p_group_per_in_ler_id
201 ,p_task_id => p_task_id
202 ,p_group_pl_id => p_group_pl_id
203 ,p_lf_evt_ocrd_dt => p_lf_evt_ocrd_dt
204 ,p_status_cd => p_status_cd
205 ,p_access_cd => p_access_cd
206 ,p_task_last_update_date => p_task_last_update_date
207 ,p_task_last_update_by => p_task_last_update_by
208 ,p_object_version_number => l_object_version_number
209 );
210 --
211 -- Call After Process User Hook
212 --
213 begin
214 ben_cwb_person_tasks_bk2.update_person_task_a
215 (p_group_per_in_ler_id => p_group_per_in_ler_id
216 ,p_task_id => p_task_id
217 ,p_group_pl_id => p_group_pl_id
218 ,p_lf_evt_ocrd_dt => p_lf_evt_ocrd_dt
219 ,p_status_cd => p_status_cd
220 ,p_access_cd => p_access_cd
221 ,p_task_last_update_date => p_task_last_update_date
222 ,p_task_last_update_by => p_task_last_update_by
223 ,p_object_version_number => l_object_version_number
224 );
225 exception
226 when hr_api.cannot_find_prog_unit then
227 hr_api.cannot_find_prog_unit_error
228 (p_module_name => 'UPDATE_PERSON_TASK'
229 ,p_hook_type => 'AP'
230 );
231 end;
232 --
233 -- When in validation only mode raise the Validate_Enabled exception
234 --
235 if p_validate then
236 raise hr_api.validate_enabled;
237 end if;
238 --
239 -- Set all IN OUT and OUT parameters with out values
240 --
241 p_object_version_number := l_object_version_number;
242 --
243 if g_debug then
244 hr_utility.set_location(' Leaving:'||l_proc, 70);
245 end if;
246 exception
247 when hr_api.validate_enabled then
248 --
249 -- As the Validate_Enabled exception has been raised
250 -- we must rollback to the savepoint
251 --
252 rollback to update_person_task;
253 --
254 if g_debug then
255 hr_utility.set_location(' Leaving:'||l_proc, 80);
256 end if;
257 when others then
258 --
259 -- A validation or unexpected error has occured
260 --
261 rollback to update_person_task;
262 --
263 if g_debug then
264 hr_utility.set_location(' Leaving:'||l_proc, 90);
265 end if;
266 raise;
267 end update_person_task;
268 --
269 -- ----------------------------------------------------------------------------
270 -- |--------------------------< delete_person_task >--------------------------|
271 -- ----------------------------------------------------------------------------
272 --
273 procedure delete_person_task
274 (p_validate in boolean default false
275 ,p_group_per_in_ler_id in number
276 ,p_task_id in number
277 ,p_object_version_number in number
278 ) is
279 --
280 -- Declare cursors and local variables
281 --
282 l_proc varchar2(72) := g_package||'delete_person_task';
283 --
284 begin
285 if g_debug then
286 hr_utility.set_location('Entering:'|| l_proc, 10);
287 end if;
288 --
289 -- Issue a savepoint
290 --
291 savepoint delete_person_task;
292 --
293 -- Call Before Process User Hook
294 --
295 begin
296 ben_cwb_person_tasks_bk3.delete_person_task_b
297 (p_group_per_in_ler_id => p_group_per_in_ler_id
298 ,p_task_id => p_task_id
299 ,p_object_version_number => p_object_version_number
300 );
301 exception
302 when hr_api.cannot_find_prog_unit then
303 hr_api.cannot_find_prog_unit_error
304 (p_module_name => 'DELETE_PERSON_TASK'
305 ,p_hook_type => 'BP'
306 );
307 end;
308 --
309 -- Validation in addition to Row Handlers
310 --
311
312 --
313 -- Process Logic
314 --
315 ben_ctk_del.del
316 (p_group_per_in_ler_id => p_group_per_in_ler_id
317 ,p_task_id => p_task_id
318 ,p_object_version_number => p_object_version_number
319 );
320 --
321 -- Call After Process User Hook
322 --
323 begin
324 ben_cwb_person_tasks_bk3.delete_person_task_a
325 (p_group_per_in_ler_id => p_group_per_in_ler_id
326 ,p_task_id => p_task_id
327 ,p_object_version_number => p_object_version_number
328 );
329 exception
330 when hr_api.cannot_find_prog_unit then
331 hr_api.cannot_find_prog_unit_error
332 (p_module_name => 'DELETE_PERSON_TASK'
333 ,p_hook_type => 'AP'
334 );
335 end;
336 --
337 -- When in validation only mode raise the Validate_Enabled exception
338 --
339 if p_validate then
340 raise hr_api.validate_enabled;
341 end if;
342 --
343 -- Set all IN OUT and OUT parameters with out values
344 --
345 if g_debug then
346 hr_utility.set_location(' Leaving:'||l_proc, 70);
347 end if;
348 exception
349 when hr_api.validate_enabled then
350 --
351 -- As the Validate_Enabled exception has been raised
352 -- we must rollback to the savepoint
353 --
354 rollback to delete_person_task;
355 --
356 if g_debug then
357 hr_utility.set_location(' Leaving:'||l_proc, 80);
358 end if;
359 when others then
360 --
361 -- A validation or unexpected error has occured
362 --
363 rollback to delete_person_task;
364 --
365 if g_debug then
366 hr_utility.set_location(' Leaving:'||l_proc, 90);
367 end if;
368 raise;
369 end delete_person_task;
370 --
371 --
372 end ben_cwb_person_tasks_api;