[Home] [Help]
PACKAGE BODY: APPS.PER_CTK_UPD
Source
1 Package Body per_ctk_upd as
2 /* $Header: pectkrhi.pkb 120.7 2006/09/11 20:45:03 sturlapa noship $ */
3 g_debug boolean := hr_utility.debug_enabled;
4 --
5 -- ----------------------------------------------------------------------------
6 -- | Private Global Definitions |
7 -- ----------------------------------------------------------------------------
8 --
9 g_package varchar2(33) := ' per_ctk_upd.'; -- Global package name
10 --
11 -- ----------------------------------------------------------------------------
12 -- |------------------------------< update_dml >------------------------------|
13 -- ----------------------------------------------------------------------------
14 -- {Start Of Comments}
15 --
16 -- Description:
17 -- This procedure controls the actual dml update logic. The processing of
18 -- this procedure is:
19 -- 1) Increment the object_version_number by 1 if the object_version_number
20 -- is defined as an attribute for this entity.
21 -- 2) To set and unset the g_api_dml status as required (as we are about to
22 -- perform dml).
23 -- 3) To update the specified row in the schema using the primary key in
24 -- the predicates.
25 -- 4) To trap any constraint violations that may have occurred.
26 -- 5) To raise any other errors.
27 --
28 -- Prerequisites:
29 -- This is an internal private procedure which must be called from the upd
30 -- procedure.
31 --
32 -- In Parameters:
33 -- A Pl/Sql record structre.
34 --
35 -- Post Success:
36 -- The specified row will be updated in the schema.
37 --
38 -- Post Failure:
39 -- On the update dml failure it is important to note that we always reset the
40 -- g_api_dml status to false.
41 -- If a check, unique or parent integrity constraint violation is raised the
42 -- constraint_error procedure will be called.
43 -- If any other error is reported, the error will be raised after the
44 -- g_api_dml status is reset.
45 --
46 -- Developer Implementation Notes:
47 -- The update 'set' attribute list should be modified if any of your
48 -- attributes are not updateable.
49 --
50 -- Access Status:
51 -- Internal Row Handler Use Only.
52 --
53 -- {End Of Comments}
54 -- ----------------------------------------------------------------------------
55 Procedure update_dml
56 (p_rec in out nocopy per_ctk_shd.g_rec_type
57 ) is
58 --
59 l_proc varchar2(72) := g_package||'update_dml';
60 --
61 Begin
62 hr_utility.set_location('Entering:'||l_proc, 5);
63 --
64 -- Increment the object version
65 p_rec.object_version_number := p_rec.object_version_number + 1;
66 --
67 --
68 --
69 -- Update the per_tasks_in_checklist Row
70 --
71 update per_tasks_in_checklist
72 set
73 task_in_checklist_id = p_rec.task_in_checklist_id
74 ,checklist_id = p_rec.checklist_id
75 ,checklist_task_name = p_rec.checklist_task_name
76 ,eligibility_object_id = p_rec.eligibility_object_id
77 ,eligibility_profile_id = p_rec.eligibility_profile_id
78 ,ame_attribute_identifier = p_rec.ame_attribute_identifier
79 ,description = p_rec.description
80 ,mandatory_flag = p_rec.mandatory_flag
81 ,target_duration = p_rec.target_duration
82 ,target_duration_uom = p_rec.target_duration_uom
83 ,task_sequence = p_rec.task_sequence
84 ,object_version_number = p_rec.object_version_number
85 ,action_url = p_rec.action_url
86 ,attribute_category = p_rec.attribute_category
87 ,attribute1 = p_rec.attribute1
88 ,attribute2 = p_rec.attribute2
89 ,attribute3 = p_rec.attribute3
90 ,attribute4 = p_rec.attribute4
91 ,attribute5 = p_rec.attribute5
92 ,attribute6 = p_rec.attribute6
93 ,attribute7 = p_rec.attribute7
94 ,attribute8 = p_rec.attribute8
95 ,attribute9 = p_rec.attribute9
96 ,attribute10 = p_rec.attribute10
97 ,attribute11 = p_rec.attribute11
98 ,attribute12 = p_rec.attribute12
99 ,attribute13 = p_rec.attribute13
100 ,attribute14 = p_rec.attribute14
101 ,attribute15 = p_rec.attribute15
102 ,attribute16 = p_rec.attribute16
103 ,attribute17 = p_rec.attribute17
104 ,attribute18 = p_rec.attribute18
105 ,attribute19 = p_rec.attribute19
106 ,attribute20 = p_rec.attribute20
107 ,information_category = p_rec.information_category
108 ,information1 = p_rec.information1
109 ,information2 = p_rec.information2
110 ,information3 = p_rec.information3
111 ,information4 = p_rec.information4
112 ,information5 = p_rec.information5
113 ,information6 = p_rec.information6
114 ,information7 = p_rec.information7
115 ,information8 = p_rec.information8
116 ,information9 = p_rec.information9
117 ,information10 = p_rec.information10
118 ,information11 = p_rec.information11
119 ,information12 = p_rec.information12
120 ,information13 = p_rec.information13
121 ,information14 = p_rec.information14
122 ,information15 = p_rec.information15
123 ,information16 = p_rec.information16
124 ,information17 = p_rec.information17
125 ,information18 = p_rec.information18
126 ,information19 = p_rec.information19
127 ,information20 = p_rec.information20
128 where task_in_checklist_id = p_rec.task_in_checklist_id;
129 --
130 --
131 --
132 hr_utility.set_location(' Leaving:'||l_proc, 10);
133 --
134 Exception
135 When hr_api.check_integrity_violated Then
136 -- A check constraint has been violated
137 --
138 per_ctk_shd.constraint_error
139 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
140 When hr_api.parent_integrity_violated Then
141 -- Parent integrity has been violated
142 --
143 per_ctk_shd.constraint_error
144 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
145 When hr_api.unique_integrity_violated Then
146 -- Unique integrity has been violated
147 --
148 per_ctk_shd.constraint_error
149 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
150 When Others Then
151 --
152 Raise;
153 End update_dml;
154 --
155 -- ----------------------------------------------------------------------------
156 -- |------------------------------< pre_update >------------------------------|
157 -- ----------------------------------------------------------------------------
158 -- {Start Of Comments}
159 --
160 -- Description:
161 -- This private procedure contains any processing which is required before
162 -- the update dml.
163 --
164 -- Prerequisites:
165 -- This is an internal procedure which is called from the upd procedure.
166 --
167 -- In Parameters:
168 -- A Pl/Sql record structure.
169 --
170 -- Post Success:
171 -- Processing continues.
172 --
173 -- Post Failure:
174 -- If an error has occurred, an error message and exception wil be raised
175 -- but not handled.
176 --
177 -- Developer Implementation Notes:
178 -- Any pre-processing required before the update dml is issued should be
179 -- coded within this procedure. It is important to note that any 3rd party
180 -- maintenance should be reviewed before placing in this procedure.
181 --
182 -- Access Status:
183 -- Internal Row Handler Use Only.
184 --
185 -- {End Of Comments}
186 -- ----------------------------------------------------------------------------
187 Procedure pre_update
188 (p_rec in out nocopy per_ctk_shd.g_rec_type
189 ) is
190 --
191 l_proc varchar2(72) := g_package||'pre_update';
192 -- for bgid
193 cursor c_bg_id(p_checklist_id number) is
194 select business_group_id
195 from per_checklists
196 where checklist_id = p_checklist_id;
197
198 -- for elgibility profile
199
200 cursor c_elig_prfl_dates(cur_p_elig_prfl_id number) is
201 select
202 effective_start_date,object_version_number
203 FROM
204 ben_eligy_prfl_f
205 WHERE
206 trunc(sysdate) between effective_start_date and effective_end_date
207 AND stat_cd = 'A'
208 AND bnft_cagr_prtn_cd = 'CHKLIST'
209 and ELIGY_PRFL_ID=cur_p_elig_prfl_id;
210
211 -- for elgiy object
212
213 cursor c_elig_obj (p_elig_objid number) is
214 select object_version_number,effective_start_date
215 from ben_elig_obj_f
216 where elig_obj_id = p_elig_objid;
217
218 -- for eligy profile and eligy object
219 cursor c_elig_prfl_elig_obj (c_elig_prfl_id number, c_elig_obj_id number) is
220 select
221 elig_obj_elig_prfl_id,
222 object_version_number,
223 effective_start_date
224 from
225 ben_elig_obj_elig_profl_f
226 where elig_obj_id = c_elig_obj_id and elig_prfl_id=c_elig_prfl_id;
227
228 --
229 l_bgid number;
230 l_elig_obj_id number;
231 l_elig_obj_elig_prfl_id number;
232 l_prf_ovn number;
233 l_obj_ovn number;
234 l_prf_obj_ovn number;
235 l_tab_name varchar2(30) := 'PER_TASKS_IN_CHECKLIST';
236 l_col_name varchar2(30) := 'TASK_IN_CHECKLIST_ID';
237 l_tic_id number;
238 l_effective_start_date date;
239 l_effective_end_date date;
240 l_effective_date date;
241 Begin
242
243 hr_utility.set_location('Entering:'||l_proc, 5);
244 --
245 -- hr_utility.set_location('g_old_rec.eligibility_profile_id='||per_ctk_shd.g_old_rec.eligibility_profile_id,10);
246 -- hr_utility.set_location('p_rec.eligibility_profile_id='||p_rec.eligibility_profile_id,10);
247 if ( nvl(per_ctk_shd.g_old_rec.eligibility_profile_id, hr_api.g_number) <> hr_api.g_number AND
248 nvl(per_ctk_shd.g_old_rec.eligibility_profile_id, hr_api.g_number) <> nvl(p_rec.eligibility_profile_id, hr_api.g_number)) then
249
250 -- delete old eligy profile eligy object (child)
251 open c_elig_prfl_elig_obj(per_ctk_shd.g_old_rec.eligibility_profile_id, per_ctk_shd.g_old_rec.eligibility_object_id);
252 fetch c_elig_prfl_elig_obj into l_elig_obj_elig_prfl_id,l_prf_obj_ovn,l_effective_date;
253 if(c_elig_prfl_elig_obj%found) then
254 begin
255 ben_ELIG_OBJ_ELIG_PROFL_api.delete_elig_obj_elig_profl
256 (
257 p_validate=> false,
258 p_elig_obj_elig_prfl_id=>l_elig_obj_elig_prfl_id,
259 p_effective_start_date=>l_effective_start_date,
260 p_effective_end_date=>l_effective_end_date,
261 p_object_version_number=>l_prf_obj_ovn,
262 p_effective_date=>l_effective_date,
263 p_datetrack_mode =>'ZAP'
264 );
265 exception
266 when others then
267 close c_elig_prfl_elig_obj;
268 raise;
269 end;
270 end if;
271 close c_elig_prfl_elig_obj;
272 --hr_utility.set_location('p_rec.l_elig_obj_elig_prfl_id='||l_elig_obj_elig_prfl_id,10);
273 --hr_utility.set_location('p_rec.l_prf_obj_ovn='||l_prf_obj_ovn,10);
274 --hr_utility.set_location('p_rec.l_effective_date='||l_effective_date,10);
275 --hr_utility.set_location('eligy_obj_elig_profile deleted',10);
276 open c_elig_obj(per_ctk_shd.g_old_rec.eligibility_object_id);
277
278 fetch c_elig_obj into l_obj_ovn,l_effective_date;
279 if(c_elig_obj%found)then
280 begin
281 ben_elig_obj_api.delete_elig_obj
282 (
283 p_validate=>false,
284 p_elig_obj_id=>per_ctk_shd.g_old_rec.eligibility_object_id,
285 p_effective_start_date=>l_effective_start_date,
286 p_effective_end_date=>l_effective_end_date,
287 p_object_version_number=>l_obj_ovn,
288 p_effective_date=>l_effective_date,
289 p_datetrack_mode=>'ZAP'
290 );
291 exception
292 when others then
293 close c_elig_obj;
294 raise;
295 end;
296 end if;
297 close c_elig_obj;
298 --hr_utility.set_location('p_rec.l_obj_ovn='||l_obj_ovn,20);
299 --hr_utility.set_location('p_rec.l_effective_date='||to_char(l_effective_date),20);
300
301 p_rec.eligibility_object_id :=null;
302 -- create eligy object (parent)
303 -- create old eligy profile eligy object (child)
304
305 end if;
306
307 if ((nvl(per_ctk_shd.g_old_rec.eligibility_profile_id, hr_api.g_number)= hr_api.g_number AND
308 nvl(p_rec.eligibility_profile_id, hr_api.g_number) <> hr_api.g_number ))
309 OR -- in this case above we have deleted old records
310 (nvl(per_ctk_shd.g_old_rec.eligibility_profile_id, hr_api.g_number) <> hr_api.g_number AND
311 nvl(p_rec.eligibility_profile_id, hr_api.g_number) <> hr_api.g_number AND
312 nvl(per_ctk_shd.g_old_rec.eligibility_profile_id, hr_api.g_number) <> nvl(p_rec.eligibility_profile_id, hr_api.g_number))
313 then
314
315 open c_elig_prfl_dates(p_rec.eligibility_profile_id);
316 fetch c_elig_prfl_dates into l_effective_date,l_prf_ovn;
317 close c_elig_prfl_dates;
318
319 Open c_bg_id(p_rec.checklist_id);
320 Fetch c_bg_id Into l_bgid;
321 Close c_bg_id;
322
323 l_tic_id:=p_rec.checklist_id;
324 hr_utility.set_location(' entering:'||l_proc, 20);
325
326 ben_elig_obj_api.create_ELIG_OBJ
327 (
328 p_validate => false
329 ,p_elig_obj_id => l_elig_obj_id
330 ,p_effective_start_date => l_effective_start_date
331 ,p_effective_end_date => l_effective_end_date
332 ,p_business_group_id => l_bgid
333 ,p_table_name => l_tab_name --'PER_TASKS_IN_CHECKLIST'
334 ,p_column_name => l_col_name
335 ,p_column_value => l_tic_id
336 ,p_object_version_number => l_obj_ovn
337 ,p_effective_date => l_effective_date
338 );
339
340 hr_utility.set_location('levaving :'||l_proc, 20);
341 p_rec.eligibility_object_id := l_elig_obj_id;
342 --
343 -- Add Create Eligibility Object logic
344 --
345 --
346 ben_ELIG_OBJ_ELIG_PROFL_api. create_ELIG_OBJ_ELIG_PROFL
347 (
348 p_validate => false
349 ,p_elig_obj_id => p_rec.eligibility_object_id
350 ,p_elig_prfl_id => p_rec.eligibility_profile_id
351 ,p_mndtry_flag => 'N'
352 ,p_business_group_id => l_bgid
353 ,p_effective_start_date => l_effective_start_date
354 ,p_effective_end_date => l_effective_end_date
355 ,p_elig_obj_elig_prfl_id => l_elig_obj_elig_prfl_id
356 ,p_object_version_number => l_prf_obj_ovn
357 ,p_effective_date => l_effective_date
358 );
359
360 end if;
361 --
362 hr_utility.set_location(' Leaving:'||l_proc, 10);
363 End pre_update;
364 --
365 -- ----------------------------------------------------------------------------
366 -- |-----------------------------< post_update >------------------------------|
367 -- ----------------------------------------------------------------------------
368 -- {Start Of Comments}
369 --
370 -- Description:
371 -- This private procedure contains any processing which is required after
372 -- the update dml.
373 --
374 -- Prerequisites:
375 -- This is an internal procedure which is called from the upd procedure.
376 --
377 -- In Parameters:
378 -- A Pl/Sql record structure.
379 --
380 -- Post Success:
381 -- Processing continues.
382 --
383 -- Post Failure:
384 -- If an error has occurred, an error message and exception will be raised
385 -- but not handled.
386 --
387 -- Developer Implementation Notes:
388 -- Any post-processing required after the update dml is issued should be
389 -- coded within this procedure. It is important to note that any 3rd party
390 -- maintenance should be reviewed before placing in this procedure.
391 --
392 -- Access Status:
393 -- Internal Row Handler Use Only.
394 --
395 -- {End Of Comments}
396 -- ----------------------------------------------------------------------------
397 Procedure post_update
398 (p_effective_date in date
399 ,p_rec in per_ctk_shd.g_rec_type
400 ) is
401 --
402 l_proc varchar2(72) := g_package||'post_update';
403 --
404 Begin
405 hr_utility.set_location('Entering:'||l_proc, 5);
406 begin
407 --
408 per_ctk_rku.after_update
409 (p_effective_date => p_effective_date
410 ,p_task_in_checklist_id
411 => p_rec.task_in_checklist_id
412 ,p_checklist_id
413 => p_rec.checklist_id
414 ,p_checklist_task_name
415 => p_rec.checklist_task_name
416 ,p_eligibility_object_id
417 => p_rec.eligibility_object_id
418 ,p_eligibility_profile_id
419 => p_rec.eligibility_profile_id
420 ,p_ame_attribute_identifier
421 => p_rec.ame_attribute_identifier
422 ,p_description
423 => p_rec.description
424 ,p_mandatory_flag
425 => p_rec.mandatory_flag
426 ,p_target_duration
427 => p_rec.target_duration
428 ,p_target_duration_uom
429 => p_rec.target_duration_uom
430 ,p_task_sequence
431 => p_rec.task_sequence
432 ,p_object_version_number
433 => p_rec.object_version_number
434 ,p_action_url
435 => p_rec.action_url
436 ,p_attribute_category
437 => p_rec.attribute_category
438 ,p_attribute1
439 => p_rec.attribute1
440 ,p_attribute2
441 => p_rec.attribute2
442 ,p_attribute3
443 => p_rec.attribute3
444 ,p_attribute4
445 => p_rec.attribute4
446 ,p_attribute5
447 => p_rec.attribute5
448 ,p_attribute6
449 => p_rec.attribute6
450 ,p_attribute7
451 => p_rec.attribute7
452 ,p_attribute8
453 => p_rec.attribute8
454 ,p_attribute9
455 => p_rec.attribute9
456 ,p_attribute10
457 => p_rec.attribute10
458 ,p_attribute11
459 => p_rec.attribute11
460 ,p_attribute12
461 => p_rec.attribute12
462 ,p_attribute13
463 => p_rec.attribute13
464 ,p_attribute14
465 => p_rec.attribute14
466 ,p_attribute15
467 => p_rec.attribute15
468 ,p_attribute16
469 => p_rec.attribute16
470 ,p_attribute17
471 => p_rec.attribute17
472 ,p_attribute18
473 => p_rec.attribute18
474 ,p_attribute19
475 => p_rec.attribute19
476 ,p_attribute20
477 => p_rec.attribute20
478 ,p_information_category
479 => p_rec.information_category
480 ,p_information1
481 => p_rec.information1
482 ,p_information2
483 => p_rec.information2
484 ,p_information3
485 => p_rec.information3
486 ,p_information4
487 => p_rec.information4
488 ,p_information5
489 => p_rec.information5
490 ,p_information6
491 => p_rec.information6
492 ,p_information7
493 => p_rec.information7
494 ,p_information8
495 => p_rec.information8
496 ,p_information9
497 => p_rec.information9
498 ,p_information10
499 => p_rec.information10
500 ,p_information11
501 => p_rec.information11
502 ,p_information12
503 => p_rec.information12
504 ,p_information13
505 => p_rec.information13
506 ,p_information14
507 => p_rec.information14
508 ,p_information15
509 => p_rec.information15
510 ,p_information16
511 => p_rec.information16
512 ,p_information17
513 => p_rec.information17
514 ,p_information18
515 => p_rec.information18
516 ,p_information19
517 => p_rec.information19
518 ,p_information20
519 => p_rec.information20
520 ,p_checklist_id_o
521 => per_ctk_shd.g_old_rec.checklist_id
522 ,p_checklist_task_name_o
523 => per_ctk_shd.g_old_rec.checklist_task_name
524 ,p_eligibility_object_id_o
525 => per_ctk_shd.g_old_rec.eligibility_object_id
526 ,p_eligibility_profile_id_o
527 => per_ctk_shd.g_old_rec.eligibility_profile_id
528 ,p_ame_attribute_identifier_o
529 => per_ctk_shd.g_old_rec.ame_attribute_identifier
530 ,p_description_o
531 => per_ctk_shd.g_old_rec.description
532 ,p_mandatory_flag_o
533 => per_ctk_shd.g_old_rec.mandatory_flag
534 ,p_target_duration_o
535 => per_ctk_shd.g_old_rec.target_duration
536 ,p_target_duration_uom_o
537 => per_ctk_shd.g_old_rec.target_duration_uom
538 ,p_task_sequence_o
539 => per_ctk_shd.g_old_rec.task_sequence
540 ,p_object_version_number_o
541 => per_ctk_shd.g_old_rec.object_version_number
542 ,p_action_url_o
543 => per_ctk_shd.g_old_rec.action_url
544 ,p_attribute_category_o
545 => per_ctk_shd.g_old_rec.attribute_category
546 ,p_attribute1_o
547 => per_ctk_shd.g_old_rec.attribute1
548 ,p_attribute2_o
549 => per_ctk_shd.g_old_rec.attribute2
550 ,p_attribute3_o
551 => per_ctk_shd.g_old_rec.attribute3
552 ,p_attribute4_o
553 => per_ctk_shd.g_old_rec.attribute4
554 ,p_attribute5_o
555 => per_ctk_shd.g_old_rec.attribute5
556 ,p_attribute6_o
557 => per_ctk_shd.g_old_rec.attribute6
558 ,p_attribute7_o
559 => per_ctk_shd.g_old_rec.attribute7
560 ,p_attribute8_o
561 => per_ctk_shd.g_old_rec.attribute8
562 ,p_attribute9_o
563 => per_ctk_shd.g_old_rec.attribute9
564 ,p_attribute10_o
565 => per_ctk_shd.g_old_rec.attribute10
566 ,p_attribute11_o
567 => per_ctk_shd.g_old_rec.attribute11
568 ,p_attribute12_o
569 => per_ctk_shd.g_old_rec.attribute12
570 ,p_attribute13_o
571 => per_ctk_shd.g_old_rec.attribute13
572 ,p_attribute14_o
573 => per_ctk_shd.g_old_rec.attribute14
574 ,p_attribute15_o
575 => per_ctk_shd.g_old_rec.attribute15
576 ,p_attribute16_o
577 => per_ctk_shd.g_old_rec.attribute16
578 ,p_attribute17_o
579 => per_ctk_shd.g_old_rec.attribute17
580 ,p_attribute18_o
581 => per_ctk_shd.g_old_rec.attribute18
582 ,p_attribute19_o
583 => per_ctk_shd.g_old_rec.attribute19
584 ,p_attribute20_o
585 => per_ctk_shd.g_old_rec.attribute20
586 ,p_information_category_o
587 => per_ctk_shd.g_old_rec.information_category
588 ,p_information1_o
589 => per_ctk_shd.g_old_rec.information1
590 ,p_information2_o
591 => per_ctk_shd.g_old_rec.information2
592 ,p_information3_o
593 => per_ctk_shd.g_old_rec.information3
594 ,p_information4_o
595 => per_ctk_shd.g_old_rec.information4
596 ,p_information5_o
597 => per_ctk_shd.g_old_rec.information5
598 ,p_information6_o
599 => per_ctk_shd.g_old_rec.information6
600 ,p_information7_o
601 => per_ctk_shd.g_old_rec.information7
602 ,p_information8_o
603 => per_ctk_shd.g_old_rec.information8
604 ,p_information9_o
605 => per_ctk_shd.g_old_rec.information9
606 ,p_information10_o
607 => per_ctk_shd.g_old_rec.information10
608 ,p_information11_o
609 => per_ctk_shd.g_old_rec.information11
610 ,p_information12_o
611 => per_ctk_shd.g_old_rec.information12
612 ,p_information13_o
613 => per_ctk_shd.g_old_rec.information13
614 ,p_information14_o
615 => per_ctk_shd.g_old_rec.information14
616 ,p_information15_o
617 => per_ctk_shd.g_old_rec.information15
618 ,p_information16_o
619 => per_ctk_shd.g_old_rec.information16
620 ,p_information17_o
621 => per_ctk_shd.g_old_rec.information17
622 ,p_information18_o
623 => per_ctk_shd.g_old_rec.information18
624 ,p_information19_o
625 => per_ctk_shd.g_old_rec.information19
626 ,p_information20_o
627 => per_ctk_shd.g_old_rec.information20
628 );
629 --
630 exception
631 --
632 when hr_api.cannot_find_prog_unit then
633 --
634 hr_api.cannot_find_prog_unit_error
635 (p_module_name => 'PER_TASKS_IN_CHECKLIST'
636 ,p_hook_type => 'AU');
637 --
638 end;
639 --
640 hr_utility.set_location(' Leaving:'||l_proc, 10);
641 End post_update;
642 --
643 -- ----------------------------------------------------------------------------
644 -- |-----------------------------< convert_defs >-----------------------------|
645 -- ----------------------------------------------------------------------------
646 -- {Start Of Comments}
647 --
648 -- Description:
649 -- The Convert_Defs procedure has one very important function:
650 -- It must return the record structure for the row with all system defaulted
651 -- values converted into its corresponding parameter value for update. When
652 -- we attempt to update a row through the Upd process , certain
653 -- parameters can be defaulted which enables flexibility in the calling of
654 -- the upd process (e.g. only attributes which need to be updated need to be
655 -- specified). For the upd process to determine which attributes
656 -- have NOT been specified we need to check if the parameter has a reserved
657 -- system default value. Therefore, for all parameters which have a
658 -- corresponding reserved system default mechanism specified we need to
659 -- check if a system default is being used. If a system default is being
660 -- used then we convert the defaulted value into its corresponding attribute
661 -- value held in the g_old_rec data structure.
662 --
663 -- Prerequisites:
664 -- This private function can only be called from the upd process.
665 --
666 -- In Parameters:
667 -- A Pl/Sql record structure.
668 --
669 -- Post Success:
670 -- The record structure will be returned with all system defaulted parameter
671 -- values converted into its current row attribute value.
672 --
673 -- Post Failure:
674 -- No direct error handling is required within this function. Any possible
675 -- errors within this procedure will be a PL/SQL value error due to
676 -- conversion of datatypes or data lengths.
677 --
678 -- Developer Implementation Notes:
679 -- None.
680 --
681 -- Access Status:
682 -- Internal Row Handler Use Only.
683 --
684 -- {End Of Comments}
685 -- ----------------------------------------------------------------------------
686 Procedure convert_defs
687 (p_rec in out nocopy per_ctk_shd.g_rec_type
688 ) is
689 --
690 Begin
691 --
692 -- We must now examine each argument value in the
693 -- p_rec plsql record structure
694 -- to see if a system default is being used. If a system default
695 -- is being used then we must set to the 'current' argument value.
696 --
697 If (p_rec.checklist_id = hr_api.g_number) then
698 p_rec.checklist_id :=
699 per_ctk_shd.g_old_rec.checklist_id;
700 End If;
701 If (p_rec.checklist_task_name = hr_api.g_varchar2) then
702 p_rec.checklist_task_name :=
703 per_ctk_shd.g_old_rec.checklist_task_name;
704 End If;
705 If (p_rec.eligibility_object_id = hr_api.g_number) then
706 p_rec.eligibility_object_id :=
707 per_ctk_shd.g_old_rec.eligibility_object_id;
708 End If;
709 If (p_rec.eligibility_profile_id = hr_api.g_number) then
710 p_rec.eligibility_profile_id :=
711 per_ctk_shd.g_old_rec.eligibility_profile_id;
712 End If;
713 If (p_rec.ame_attribute_identifier = hr_api.g_varchar2) then
714 p_rec.ame_attribute_identifier :=
715 per_ctk_shd.g_old_rec.ame_attribute_identifier;
716 End If;
717 If (p_rec.description = hr_api.g_varchar2) then
718 p_rec.description :=
719 per_ctk_shd.g_old_rec.description;
720 End If;
721 If (p_rec.mandatory_flag = hr_api.g_varchar2) then
722 p_rec.mandatory_flag :=
723 per_ctk_shd.g_old_rec.mandatory_flag;
724 End If;
725 If (p_rec.target_duration = hr_api.g_number) then
726 p_rec.target_duration :=
727 per_ctk_shd.g_old_rec.target_duration;
728 End If;
729 If (p_rec.target_duration_uom = hr_api.g_varchar2) then
730 p_rec.target_duration_uom :=
731 per_ctk_shd.g_old_rec.target_duration_uom;
732 End If;
733 If (p_rec.task_sequence = hr_api.g_number) then
734 p_rec.task_sequence :=
735 per_ctk_shd.g_old_rec.task_sequence;
736 End If;
737 If (p_rec.action_url = hr_api.g_varchar2) then
738 p_rec.action_url :=
739 per_ctk_shd.g_old_rec.action_url;
740 End If;
741 If (p_rec.attribute_category = hr_api.g_varchar2) then
742 p_rec.attribute_category :=
743 per_ctk_shd.g_old_rec.attribute_category;
744 End If;
745 If (p_rec.attribute1 = hr_api.g_varchar2) then
746 p_rec.attribute1 :=
747 per_ctk_shd.g_old_rec.attribute1;
748 End If;
749 If (p_rec.attribute2 = hr_api.g_varchar2) then
750 p_rec.attribute2 :=
751 per_ctk_shd.g_old_rec.attribute2;
752 End If;
753 If (p_rec.attribute3 = hr_api.g_varchar2) then
754 p_rec.attribute3 :=
755 per_ctk_shd.g_old_rec.attribute3;
756 End If;
757 If (p_rec.attribute4 = hr_api.g_varchar2) then
758 p_rec.attribute4 :=
759 per_ctk_shd.g_old_rec.attribute4;
760 End If;
761 If (p_rec.attribute5 = hr_api.g_varchar2) then
762 p_rec.attribute5 :=
763 per_ctk_shd.g_old_rec.attribute5;
764 End If;
765 If (p_rec.attribute6 = hr_api.g_varchar2) then
766 p_rec.attribute6 :=
767 per_ctk_shd.g_old_rec.attribute6;
768 End If;
769 If (p_rec.attribute7 = hr_api.g_varchar2) then
770 p_rec.attribute7 :=
771 per_ctk_shd.g_old_rec.attribute7;
772 End If;
773 If (p_rec.attribute8 = hr_api.g_varchar2) then
774 p_rec.attribute8 :=
775 per_ctk_shd.g_old_rec.attribute8;
776 End If;
777 If (p_rec.attribute9 = hr_api.g_varchar2) then
778 p_rec.attribute9 :=
779 per_ctk_shd.g_old_rec.attribute9;
780 End If;
781 If (p_rec.attribute10 = hr_api.g_varchar2) then
782 p_rec.attribute10 :=
783 per_ctk_shd.g_old_rec.attribute10;
784 End If;
785 If (p_rec.attribute11 = hr_api.g_varchar2) then
786 p_rec.attribute11 :=
787 per_ctk_shd.g_old_rec.attribute11;
788 End If;
789 If (p_rec.attribute12 = hr_api.g_varchar2) then
790 p_rec.attribute12 :=
791 per_ctk_shd.g_old_rec.attribute12;
792 End If;
793 If (p_rec.attribute13 = hr_api.g_varchar2) then
794 p_rec.attribute13 :=
795 per_ctk_shd.g_old_rec.attribute13;
796 End If;
797 If (p_rec.attribute14 = hr_api.g_varchar2) then
798 p_rec.attribute14 :=
799 per_ctk_shd.g_old_rec.attribute14;
800 End If;
801 If (p_rec.attribute15 = hr_api.g_varchar2) then
802 p_rec.attribute15 :=
803 per_ctk_shd.g_old_rec.attribute15;
804 End If;
805 If (p_rec.attribute16 = hr_api.g_varchar2) then
806 p_rec.attribute16 :=
807 per_ctk_shd.g_old_rec.attribute16;
808 End If;
809 If (p_rec.attribute17 = hr_api.g_varchar2) then
810 p_rec.attribute17 :=
811 per_ctk_shd.g_old_rec.attribute17;
812 End If;
813 If (p_rec.attribute18 = hr_api.g_varchar2) then
814 p_rec.attribute18 :=
815 per_ctk_shd.g_old_rec.attribute18;
816 End If;
817 If (p_rec.attribute19 = hr_api.g_varchar2) then
818 p_rec.attribute19 :=
819 per_ctk_shd.g_old_rec.attribute19;
820 End If;
821 If (p_rec.attribute20 = hr_api.g_varchar2) then
822 p_rec.attribute20 :=
823 per_ctk_shd.g_old_rec.attribute20;
824 End If;
825 If (p_rec.information_category = hr_api.g_varchar2) then
826 p_rec.information_category :=
827 per_ctk_shd.g_old_rec.information_category;
828 End If;
829 If (p_rec.information1 = hr_api.g_varchar2) then
830 p_rec.information1 :=
831 per_ctk_shd.g_old_rec.information1;
832 End If;
833 If (p_rec.information2 = hr_api.g_varchar2) then
834 p_rec.information2 :=
835 per_ctk_shd.g_old_rec.information2;
836 End If;
837 If (p_rec.information3 = hr_api.g_varchar2) then
838 p_rec.information3 :=
839 per_ctk_shd.g_old_rec.information3;
840 End If;
841 If (p_rec.information4 = hr_api.g_varchar2) then
842 p_rec.information4 :=
843 per_ctk_shd.g_old_rec.information4;
844 End If;
845 If (p_rec.information5 = hr_api.g_varchar2) then
846 p_rec.information5 :=
847 per_ctk_shd.g_old_rec.information5;
848 End If;
849 If (p_rec.information6 = hr_api.g_varchar2) then
850 p_rec.information6 :=
851 per_ctk_shd.g_old_rec.information6;
852 End If;
853 If (p_rec.information7 = hr_api.g_varchar2) then
854 p_rec.information7 :=
855 per_ctk_shd.g_old_rec.information7;
856 End If;
857 If (p_rec.information8 = hr_api.g_varchar2) then
858 p_rec.information8 :=
859 per_ctk_shd.g_old_rec.information8;
860 End If;
861 If (p_rec.information9 = hr_api.g_varchar2) then
862 p_rec.information9 :=
863 per_ctk_shd.g_old_rec.information9;
864 End If;
865 If (p_rec.information10 = hr_api.g_varchar2) then
866 p_rec.information10 :=
867 per_ctk_shd.g_old_rec.information10;
868 End If;
869 If (p_rec.information11 = hr_api.g_varchar2) then
870 p_rec.information11 :=
871 per_ctk_shd.g_old_rec.information11;
872 End If;
873 If (p_rec.information12 = hr_api.g_varchar2) then
874 p_rec.information12 :=
875 per_ctk_shd.g_old_rec.information12;
876 End If;
877 If (p_rec.information13 = hr_api.g_varchar2) then
878 p_rec.information13 :=
879 per_ctk_shd.g_old_rec.information13;
880 End If;
881 If (p_rec.information14 = hr_api.g_varchar2) then
882 p_rec.information14 :=
883 per_ctk_shd.g_old_rec.information14;
884 End If;
885 If (p_rec.information15 = hr_api.g_varchar2) then
886 p_rec.information15 :=
887 per_ctk_shd.g_old_rec.information15;
888 End If;
889 If (p_rec.information16 = hr_api.g_varchar2) then
890 p_rec.information16 :=
891 per_ctk_shd.g_old_rec.information16;
892 End If;
893 If (p_rec.information17 = hr_api.g_varchar2) then
894 p_rec.information17 :=
895 per_ctk_shd.g_old_rec.information17;
896 End If;
897 If (p_rec.information18 = hr_api.g_varchar2) then
898 p_rec.information18 :=
899 per_ctk_shd.g_old_rec.information18;
900 End If;
901 If (p_rec.information19 = hr_api.g_varchar2) then
902 p_rec.information19 :=
903 per_ctk_shd.g_old_rec.information19;
904 End If;
905 If (p_rec.information20 = hr_api.g_varchar2) then
906 p_rec.information20 :=
907 per_ctk_shd.g_old_rec.information20;
908 End If;
909 --
910 End convert_defs;
911 --
912 -- ----------------------------------------------------------------------------
913 -- |---------------------------------< upd >----------------------------------|
914 -- ----------------------------------------------------------------------------
915 Procedure upd
916 (p_effective_date in date
917 ,p_rec in out nocopy per_ctk_shd.g_rec_type
918 ) is
919 --
920 l_proc varchar2(72) := g_package||'upd';
921 --
922 Begin
923 hr_utility.set_location('Entering:'||l_proc, 5);
924 --
925 -- We must lock the row which we need to update.
926 --
927 per_ctk_shd.lck
928 (p_rec.task_in_checklist_id
929 ,p_rec.object_version_number
930 );
931 --
932 -- 1. During an update system defaults are used to determine if
933 -- arguments have been defaulted or not. We must therefore
934 -- derive the full record structure values to be updated.
935 --
936 -- 2. Call the supporting update validate operations.
937 --
938 convert_defs(p_rec);
939 per_ctk_bus.update_validate
940 (p_effective_date
941 ,p_rec
942 );
943 --
944 -- Call to raise any errors on multi-message list
945 hr_multi_message.end_validation_set;
946 --
947 -- Call the supporting pre-update operation
948 --
949 per_ctk_upd.pre_update(p_rec);
950 --
951 -- Update the row.
952 --
953 per_ctk_upd.update_dml(p_rec);
954 --
955 -- Call the supporting post-update operation
956 --
957 per_ctk_upd.post_update
958 (p_effective_date
959 ,p_rec
960 );
961 --
962 -- Call to raise any errors on multi-message list
963 hr_multi_message.end_validation_set;
964 End upd;
965 --
966 -- ----------------------------------------------------------------------------
967 -- |---------------------------------< upd >----------------------------------|
968 -- ----------------------------------------------------------------------------
969 Procedure upd
970 (p_effective_date in date
971 ,p_task_in_checklist_id in number
972 ,p_object_version_number in out nocopy number
973 ,p_checklist_id in number default hr_api.g_number
974 ,p_checklist_task_name in varchar2 default hr_api.g_varchar2
975 ,p_eligibility_object_id in number default hr_api.g_number
976 ,p_eligibility_profile_id in number default hr_api.g_number
977 ,p_ame_attribute_identifier in varchar2 default hr_api.g_varchar2
978 ,p_description in varchar2 default hr_api.g_varchar2
979 ,p_mandatory_flag in varchar2 default hr_api.g_varchar2
980 ,p_target_duration in number default hr_api.g_number
981 ,p_target_duration_uom in varchar2 default hr_api.g_varchar2
982 ,p_task_sequence in number default hr_api.g_number
983 ,p_action_url in varchar2 default hr_api.g_varchar2
984 ,p_attribute_category in varchar2 default hr_api.g_varchar2
985 ,p_attribute1 in varchar2 default hr_api.g_varchar2
986 ,p_attribute2 in varchar2 default hr_api.g_varchar2
987 ,p_attribute3 in varchar2 default hr_api.g_varchar2
988 ,p_attribute4 in varchar2 default hr_api.g_varchar2
989 ,p_attribute5 in varchar2 default hr_api.g_varchar2
990 ,p_attribute6 in varchar2 default hr_api.g_varchar2
991 ,p_attribute7 in varchar2 default hr_api.g_varchar2
992 ,p_attribute8 in varchar2 default hr_api.g_varchar2
993 ,p_attribute9 in varchar2 default hr_api.g_varchar2
994 ,p_attribute10 in varchar2 default hr_api.g_varchar2
995 ,p_attribute11 in varchar2 default hr_api.g_varchar2
996 ,p_attribute12 in varchar2 default hr_api.g_varchar2
997 ,p_attribute13 in varchar2 default hr_api.g_varchar2
998 ,p_attribute14 in varchar2 default hr_api.g_varchar2
999 ,p_attribute15 in varchar2 default hr_api.g_varchar2
1000 ,p_attribute16 in varchar2 default hr_api.g_varchar2
1001 ,p_attribute17 in varchar2 default hr_api.g_varchar2
1002 ,p_attribute18 in varchar2 default hr_api.g_varchar2
1003 ,p_attribute19 in varchar2 default hr_api.g_varchar2
1004 ,p_attribute20 in varchar2 default hr_api.g_varchar2
1005 ,p_information_category in varchar2 default hr_api.g_varchar2
1006 ,p_information1 in varchar2 default hr_api.g_varchar2
1007 ,p_information2 in varchar2 default hr_api.g_varchar2
1008 ,p_information3 in varchar2 default hr_api.g_varchar2
1009 ,p_information4 in varchar2 default hr_api.g_varchar2
1010 ,p_information5 in varchar2 default hr_api.g_varchar2
1011 ,p_information6 in varchar2 default hr_api.g_varchar2
1012 ,p_information7 in varchar2 default hr_api.g_varchar2
1013 ,p_information8 in varchar2 default hr_api.g_varchar2
1014 ,p_information9 in varchar2 default hr_api.g_varchar2
1015 ,p_information10 in varchar2 default hr_api.g_varchar2
1016 ,p_information11 in varchar2 default hr_api.g_varchar2
1017 ,p_information12 in varchar2 default hr_api.g_varchar2
1018 ,p_information13 in varchar2 default hr_api.g_varchar2
1019 ,p_information14 in varchar2 default hr_api.g_varchar2
1020 ,p_information15 in varchar2 default hr_api.g_varchar2
1021 ,p_information16 in varchar2 default hr_api.g_varchar2
1022 ,p_information17 in varchar2 default hr_api.g_varchar2
1023 ,p_information18 in varchar2 default hr_api.g_varchar2
1024 ,p_information19 in varchar2 default hr_api.g_varchar2
1025 ,p_information20 in varchar2 default hr_api.g_varchar2
1026 ) is
1027 --
1028 l_rec per_ctk_shd.g_rec_type;
1029 l_proc varchar2(72) := g_package||'upd';
1030 --
1031 Begin
1032 hr_utility.set_location('Entering:'||l_proc, 5);
1033 --
1034 -- Call conversion function to turn arguments into the
1035 -- l_rec structure.
1036 --
1037 l_rec :=
1038 per_ctk_shd.convert_args
1039 (p_task_in_checklist_id
1040 ,p_checklist_id
1041 ,p_checklist_task_name
1042 ,p_eligibility_object_id
1043 ,p_eligibility_profile_id
1044 ,p_ame_attribute_identifier
1045 ,p_description
1046 ,p_mandatory_flag
1047 ,p_target_duration
1048 ,p_target_duration_uom
1049 ,p_task_sequence
1050 ,p_object_version_number
1051 ,p_action_url
1052 ,p_attribute_category
1053 ,p_attribute1
1054 ,p_attribute2
1055 ,p_attribute3
1056 ,p_attribute4
1057 ,p_attribute5
1058 ,p_attribute6
1059 ,p_attribute7
1060 ,p_attribute8
1061 ,p_attribute9
1062 ,p_attribute10
1063 ,p_attribute11
1064 ,p_attribute12
1065 ,p_attribute13
1066 ,p_attribute14
1067 ,p_attribute15
1068 ,p_attribute16
1069 ,p_attribute17
1070 ,p_attribute18
1071 ,p_attribute19
1072 ,p_attribute20
1073 ,p_information_category
1074 ,p_information1
1075 ,p_information2
1076 ,p_information3
1077 ,p_information4
1078 ,p_information5
1079 ,p_information6
1080 ,p_information7
1081 ,p_information8
1082 ,p_information9
1083 ,p_information10
1084 ,p_information11
1085 ,p_information12
1086 ,p_information13
1087 ,p_information14
1088 ,p_information15
1089 ,p_information16
1090 ,p_information17
1091 ,p_information18
1092 ,p_information19
1093 ,p_information20
1094 );
1095 --
1096 -- Having converted the arguments into the
1097 -- plsql record structure we call the corresponding record
1098 -- business process.
1099 --
1100 per_ctk_upd.upd
1101 (p_effective_date
1102 ,l_rec
1103 );
1104 p_object_version_number := l_rec.object_version_number;
1105 --
1106 hr_utility.set_location(' Leaving:'||l_proc, 10);
1107 End upd;
1108 --
1109 end per_ctk_upd;