1 Package Body ben_vep_upd as
2 /* $Header: beveprhi.pkb 120.0.12010000.2 2008/08/05 15:33:44 ubhat ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_vep_upd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_update_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 -- This procedure controls the execution of dml from the datetrack mode
17 -- of CORRECTION only. It is important to note that the object version
18 -- number is only increment by 1 because the datetrack correction is
19 -- soley for one datetracked row.
20 -- This procedure controls the actual dml update logic. The functions of this
21 -- procedure are as follows:
22 -- 1) Get the next object_version_number.
23 -- 2) To set and unset the g_api_dml status as required (as we are about to
24 -- perform dml).
25 -- 3) To update the specified row in the schema using the primary key in
26 -- the predicates.
27 -- 4) To trap any constraint violations that may have occurred.
28 -- 5) To raise any other errors.
29 --
30 -- Prerequisites:
31 -- This is an internal private procedure which must be called from the
32 -- update_dml procedure.
33 --
34 -- In Parameters:
35 -- A Pl/Sql record structure.
36 --
37 -- Post Success:
38 -- The specified row will be updated in the schema.
39 --
40 -- Post Failure:
41 -- On the update dml failure it is important to note that we always reset the
42 -- g_api_dml status to false.
43 -- If a check or unique integrity constraint violation is raised the
44 -- constraint_error procedure will be called.
45 -- If any other error is reported, the error will be raised after the
46 -- g_api_dml status is reset.
47 --
48 -- Developer Implementation Notes:
49 -- The update 'set' arguments list should be modified if any of your
50 -- attributes are not updateable.
51 --
52 -- Access Status:
53 -- Internal Row Handler Use Only.
54 --
55 -- {End Of Comments}
56 -- ----------------------------------------------------------------------------
57 Procedure dt_update_dml
58 (p_rec in out nocopy ben_vep_shd.g_rec_type
59 ,p_effective_date in date
60 ,p_datetrack_mode in varchar2
61 ,p_validation_start_date in date
62 ,p_validation_end_date in date
63 ) is
64 --
65 l_proc varchar2(72) := g_package||'dt_update_dml';
66 --
67 Begin
68 hr_utility.set_location('Entering:'||l_proc, 5);
69 --
70 If (p_datetrack_mode = hr_api.g_correction) then
71 hr_utility.set_location(l_proc, 10);
72 --
73 -- Because we are updating a row we must get the next object
74 -- version number.
75 --
76 p_rec.object_version_number :=
77 dt_api.get_object_version_number
78 (p_base_table_name => 'BEN_VRBL_RT_ELIG_PRFL_f'
79 ,p_base_key_column => 'VRBL_RT_ELIG_PRFL_ID'
80 ,p_base_key_value => p_rec.vrbl_rt_elig_prfl_id
81 );
82 --
83 ben_vep_shd.g_api_dml := true; -- Set the api dml status
84 --
85 -- Update the BEN_VRBL_RT_ELIG_PRFL_f Row
86 --
87 update BEN_VRBL_RT_ELIG_PRFL_f
88 set
89 vrbl_rt_elig_prfl_id = p_rec.vrbl_rt_elig_prfl_id
90 ,business_group_id = p_rec.business_group_id
91 ,vrbl_rt_prfl_id = p_rec.vrbl_rt_prfl_id
92 ,eligy_prfl_id = p_rec.eligy_prfl_id
93 ,mndtry_flag = p_rec.mndtry_flag
94 ,vep_attribute_category = p_rec.vep_attribute_category
95 ,vep_attribute1 = p_rec.vep_attribute1
96 ,vep_attribute2 = p_rec.vep_attribute2
97 ,vep_attribute3 = p_rec.vep_attribute3
98 ,vep_attribute4 = p_rec.vep_attribute4
99 ,vep_attribute5 = p_rec.vep_attribute5
100 ,vep_attribute6 = p_rec.vep_attribute6
101 ,vep_attribute7 = p_rec.vep_attribute7
102 ,vep_attribute8 = p_rec.vep_attribute8
103 ,vep_attribute9 = p_rec.vep_attribute9
104 ,vep_attribute10 = p_rec.vep_attribute10
105 ,vep_attribute11 = p_rec.vep_attribute11
106 ,vep_attribute12 = p_rec.vep_attribute12
107 ,vep_attribute13 = p_rec.vep_attribute13
108 ,vep_attribute14 = p_rec.vep_attribute14
109 ,vep_attribute15 = p_rec.vep_attribute15
110 ,vep_attribute16 = p_rec.vep_attribute16
111 ,vep_attribute17 = p_rec.vep_attribute17
112 ,vep_attribute18 = p_rec.vep_attribute18
113 ,vep_attribute19 = p_rec.vep_attribute19
114 ,vep_attribute20 = p_rec.vep_attribute20
115 ,vep_attribute21 = p_rec.vep_attribute21
116 ,vep_attribute22 = p_rec.vep_attribute22
117 ,vep_attribute23 = p_rec.vep_attribute23
118 ,vep_attribute24 = p_rec.vep_attribute24
119 ,vep_attribute25 = p_rec.vep_attribute25
120 ,vep_attribute26 = p_rec.vep_attribute26
121 ,vep_attribute27 = p_rec.vep_attribute27
122 ,vep_attribute28 = p_rec.vep_attribute28
123 ,vep_attribute29 = p_rec.vep_attribute29
124 ,vep_attribute30 = p_rec.vep_attribute30
125 ,object_version_number = p_rec.object_version_number
126 where vrbl_rt_elig_prfl_id = p_rec.vrbl_rt_elig_prfl_id
127 and effective_start_date = p_validation_start_date
128 and effective_end_date = p_validation_end_date;
129 --
130 ben_vep_shd.g_api_dml := false; -- Unset the api dml status
131 --
132 -- Set the effective start and end dates
133 --
134 p_rec.effective_start_date := p_validation_start_date;
135 p_rec.effective_end_date := p_validation_end_date;
136 End If;
137 --
138 hr_utility.set_location(' Leaving:'||l_proc, 15);
139 Exception
140 When hr_api.check_integrity_violated Then
141 -- A check constraint has been violated
142 ben_vep_shd.g_api_dml := false; -- Unset the api dml status
143 ben_vep_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 ben_vep_shd.g_api_dml := false; -- Unset the api dml status
148 ben_vep_shd.constraint_error
149 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
150 When Others Then
151 ben_vep_shd.g_api_dml := false; -- Unset the api dml status
152 Raise;
153 End dt_update_dml;
154 --
155 -- ----------------------------------------------------------------------------
156 -- |------------------------------< update_dml >------------------------------|
157 -- ----------------------------------------------------------------------------
158 -- {Start Of Comments}
159 --
160 -- Description:
161 -- This procedure calls the dt_update_dml control logic which handles
162 -- the actual datetrack dml.
163 --
164 -- Prerequisites:
165 -- This is an internal private procedure which must be called from the upd
166 -- procedure.
167 --
168 -- In Parameters:
169 -- A Pl/Sql record structre.
170 --
171 -- Post Success:
172 -- Processing contines.
173 --
174 -- Post Failure:
175 -- No specific error handling is required within this procedure.
176 --
177 -- Developer Implementation Notes:
178 -- The update 'set' arguments list should be modified if any of your
179 -- attributes are not updateable.
180 --
181 -- Access Status:
182 -- Internal Row Handler Use Only.
183 --
184 -- {End Of Comments}
185 -- ----------------------------------------------------------------------------
186 Procedure update_dml
187 (p_rec in out nocopy ben_vep_shd.g_rec_type
188 ,p_effective_date in date
189 ,p_datetrack_mode in varchar2
190 ,p_validation_start_date in date
191 ,p_validation_end_date in date
192 ) is
193 --
194 l_proc varchar2(72) := g_package||'update_dml';
195 --
196 Begin
197 hr_utility.set_location('Entering:'||l_proc, 5);
198 --
199 ben_vep_upd.dt_update_dml
200 (p_rec => p_rec
201 ,p_effective_date => p_effective_date
202 ,p_datetrack_mode => p_datetrack_mode
203 ,p_validation_start_date => p_validation_start_date
204 ,p_validation_end_date => p_validation_end_date
205 );
206 --
207 hr_utility.set_location(' Leaving:'||l_proc, 10);
208 End update_dml;
209 --
210 -- ----------------------------------------------------------------------------
211 -- |----------------------------< dt_pre_update >-----------------------------|
212 -- ----------------------------------------------------------------------------
213 -- {Start Of Comments}
214 --
215 -- Description:
216 -- The dt_pre_update procedure controls the execution
217 -- of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
218 -- and UPDATE_CHANGE_INSERT only. The execution required is as
219 -- follows:
220 --
221 -- 1) Providing the datetrack update mode is not 'CORRECTION'
222 -- then set the effective end date of the current row (this
223 -- will be the validation_start_date - 1).
224 -- 2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
225 -- corresponding delete_dml process to delete any future rows
226 -- where the effective_start_date is greater than or equal to
227 -- the validation_start_date.
228 -- 3) Call the insert_dml process to insert the new updated row
229 -- details.
230 --
231 -- Prerequisites:
232 -- This is an internal procedure which is called from the
233 -- pre_update procedure.
234 --
235 -- In Parameters:
236 --
237 -- Post Success:
238 -- Processing continues.
239 --
240 -- Post Failure:
241 -- If an error has occurred, an error message and exception will be raised
242 -- but not handled.
243 --
244 -- Developer Implementation Notes:
245 -- This is an internal procedure which is required by Datetrack. Don't
246 -- remove or modify.
247 --
248 -- Access Status:
249 -- Internal Row Handler Use Only.
250 --
251 -- {End Of Comments}
252 -- ----------------------------------------------------------------------------
253 Procedure dt_pre_update
254 (p_rec in out nocopy ben_vep_shd.g_rec_type
255 ,p_effective_date in date
256 ,p_datetrack_mode in varchar2
257 ,p_validation_start_date in date
258 ,p_validation_end_date in date
259 ) is
260 --
261 l_proc varchar2(72) := g_package||'dt_pre_update';
262 l_dummy_version_number number;
263 --
264 Begin
265 hr_utility.set_location('Entering:'||l_proc, 5);
266 If (p_datetrack_mode <> hr_api.g_correction) then
267 --
268 -- Update the current effective end date
269 --
270 ben_vep_shd.upd_effective_end_date
271 (p_effective_date => p_effective_date
272 ,p_base_key_value => p_rec.vrbl_rt_elig_prfl_id
273 ,p_new_effective_end_date => (p_validation_start_date - 1)
274 ,p_validation_start_date => p_validation_start_date
275 ,p_validation_end_date => p_validation_end_date
276 ,p_object_version_number => l_dummy_version_number
277 );
278 --
279 If (p_datetrack_mode = hr_api.g_update_override) then
280 --
281 -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
282 -- delete any future rows
283 --
284 ben_vep_del.delete_dml
285 (p_rec => p_rec
286 ,p_effective_date => p_effective_date
287 ,p_datetrack_mode => p_datetrack_mode
288 ,p_validation_start_date => p_validation_start_date
289 ,p_validation_end_date => p_validation_end_date
290 );
291 End If;
292 --
293 -- We must now insert the updated row
294 --
295 ben_vep_ins.insert_dml
296 (p_rec => p_rec
297 ,p_effective_date => p_effective_date
298 ,p_datetrack_mode => p_datetrack_mode
299 ,p_validation_start_date => p_validation_start_date
300 ,p_validation_end_date => p_validation_end_date
301 );
302 End If;
303 hr_utility.set_location(' Leaving:'||l_proc, 20);
304 End dt_pre_update;
305 --
306 -- ----------------------------------------------------------------------------
307 -- |------------------------------< pre_update >------------------------------|
308 -- ----------------------------------------------------------------------------
309 -- {Start Of Comments}
310 --
311 -- Description:
312 -- This private procedure contains any processing which is required before
313 -- the update dml.
314 --
315 -- Prerequisites:
316 -- This is an internal procedure which is called from the upd procedure.
317 --
318 -- In Parameters:
319 -- A Pl/Sql record structure.
320 --
321 -- Post Success:
322 -- Processing continues.
323 --
324 -- Post Failure:
325 -- If an error has occurred, an error message and exception will be raised
326 -- but not handled.
327 --
328 -- Developer Implementation Notes:
329 -- Any pre-processing required before the update dml is issued should be
330 -- coded within this procedure. It is important to note that any 3rd party
331 -- maintenance should be reviewed before placing in this procedure. The call
332 -- to the dt_update_dml procedure should NOT be removed.
333 --
334 -- Access Status:
335 -- Internal Row Handler Use Only.
336 --
337 -- {End Of Comments}
338 -- ----------------------------------------------------------------------------
339 Procedure pre_update
340 (p_rec in out nocopy ben_vep_shd.g_rec_type
341 ,p_effective_date in date
342 ,p_datetrack_mode in varchar2
343 ,p_validation_start_date in date
344 ,p_validation_end_date in date
345 ) is
346 --
347 l_proc varchar2(72) := g_package||'pre_update';
348 --
349 Begin
350 hr_utility.set_location('Entering:'||l_proc, 5);
351 --
352 --
353 --
354 dt_pre_update
355 (p_rec => p_rec
356 ,p_effective_date => p_effective_date
357 ,p_datetrack_mode => p_datetrack_mode
358 ,p_validation_start_date => p_validation_start_date
359 ,p_validation_end_date => p_validation_end_date
360 );
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 the
372 -- 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_rec in ben_vep_shd.g_rec_type
399 ,p_effective_date in date
400 ,p_datetrack_mode in varchar2
401 ,p_validation_start_date in date
402 ,p_validation_end_date in date
403 ) is
404 --
405 l_proc varchar2(72) := g_package||'post_update';
406 --
407 Begin
408 hr_utility.set_location('Entering:'||l_proc, 5);
409 begin
410 --
411 ben_vep_rku.after_update
412 (p_effective_date
413 => p_effective_date
414 ,p_datetrack_mode
415 => p_datetrack_mode
416 ,p_validation_start_date
417 => p_validation_start_date
418 ,p_validation_end_date
419 => p_validation_end_date
420 ,p_vrbl_rt_elig_prfl_id
421 => p_rec.vrbl_rt_elig_prfl_id
422 ,p_effective_start_date
423 => p_rec.effective_start_date
424 ,p_effective_end_date
425 => p_rec.effective_end_date
426 ,p_business_group_id
427 => p_rec.business_group_id
428 ,p_vrbl_rt_prfl_id
429 => p_rec.vrbl_rt_prfl_id
430 ,p_eligy_prfl_id
431 => p_rec.eligy_prfl_id
432 ,p_mndtry_flag
433 => p_rec.mndtry_flag
434 ,p_vep_attribute_category
435 => p_rec.vep_attribute_category
436 ,p_vep_attribute1
437 => p_rec.vep_attribute1
438 ,p_vep_attribute2
439 => p_rec.vep_attribute2
440 ,p_vep_attribute3
441 => p_rec.vep_attribute3
442 ,p_vep_attribute4
443 => p_rec.vep_attribute4
444 ,p_vep_attribute5
445 => p_rec.vep_attribute5
446 ,p_vep_attribute6
447 => p_rec.vep_attribute6
448 ,p_vep_attribute7
449 => p_rec.vep_attribute7
450 ,p_vep_attribute8
451 => p_rec.vep_attribute8
452 ,p_vep_attribute9
453 => p_rec.vep_attribute9
454 ,p_vep_attribute10
455 => p_rec.vep_attribute10
456 ,p_vep_attribute11
457 => p_rec.vep_attribute11
458 ,p_vep_attribute12
459 => p_rec.vep_attribute12
460 ,p_vep_attribute13
461 => p_rec.vep_attribute13
462 ,p_vep_attribute14
463 => p_rec.vep_attribute14
464 ,p_vep_attribute15
465 => p_rec.vep_attribute15
466 ,p_vep_attribute16
467 => p_rec.vep_attribute16
468 ,p_vep_attribute17
469 => p_rec.vep_attribute17
470 ,p_vep_attribute18
471 => p_rec.vep_attribute18
472 ,p_vep_attribute19
473 => p_rec.vep_attribute19
474 ,p_vep_attribute20
475 => p_rec.vep_attribute20
476 ,p_vep_attribute21
477 => p_rec.vep_attribute21
478 ,p_vep_attribute22
479 => p_rec.vep_attribute22
480 ,p_vep_attribute23
481 => p_rec.vep_attribute23
482 ,p_vep_attribute24
483 => p_rec.vep_attribute24
484 ,p_vep_attribute25
485 => p_rec.vep_attribute25
486 ,p_vep_attribute26
487 => p_rec.vep_attribute26
488 ,p_vep_attribute27
489 => p_rec.vep_attribute27
490 ,p_vep_attribute28
491 => p_rec.vep_attribute28
492 ,p_vep_attribute29
493 => p_rec.vep_attribute29
494 ,p_vep_attribute30
495 => p_rec.vep_attribute30
496 ,p_object_version_number
497 => p_rec.object_version_number
498 ,p_effective_start_date_o
499 => ben_vep_shd.g_old_rec.effective_start_date
500 ,p_effective_end_date_o
501 => ben_vep_shd.g_old_rec.effective_end_date
502 ,p_business_group_id_o
503 => ben_vep_shd.g_old_rec.business_group_id
504 ,p_vrbl_rt_prfl_id_o
505 => ben_vep_shd.g_old_rec.vrbl_rt_prfl_id
506 ,p_eligy_prfl_id_o
507 => ben_vep_shd.g_old_rec.eligy_prfl_id
508 ,p_mndtry_flag_o
509 => ben_vep_shd.g_old_rec.mndtry_flag
510 ,p_vep_attribute_category_o
511 => ben_vep_shd.g_old_rec.vep_attribute_category
512 ,p_vep_attribute1_o
513 => ben_vep_shd.g_old_rec.vep_attribute1
514 ,p_vep_attribute2_o
515 => ben_vep_shd.g_old_rec.vep_attribute2
516 ,p_vep_attribute3_o
517 => ben_vep_shd.g_old_rec.vep_attribute3
518 ,p_vep_attribute4_o
519 => ben_vep_shd.g_old_rec.vep_attribute4
520 ,p_vep_attribute5_o
521 => ben_vep_shd.g_old_rec.vep_attribute5
522 ,p_vep_attribute6_o
523 => ben_vep_shd.g_old_rec.vep_attribute6
524 ,p_vep_attribute7_o
525 => ben_vep_shd.g_old_rec.vep_attribute7
526 ,p_vep_attribute8_o
527 => ben_vep_shd.g_old_rec.vep_attribute8
528 ,p_vep_attribute9_o
529 => ben_vep_shd.g_old_rec.vep_attribute9
530 ,p_vep_attribute10_o
531 => ben_vep_shd.g_old_rec.vep_attribute10
532 ,p_vep_attribute11_o
533 => ben_vep_shd.g_old_rec.vep_attribute11
534 ,p_vep_attribute12_o
535 => ben_vep_shd.g_old_rec.vep_attribute12
536 ,p_vep_attribute13_o
537 => ben_vep_shd.g_old_rec.vep_attribute13
538 ,p_vep_attribute14_o
539 => ben_vep_shd.g_old_rec.vep_attribute14
540 ,p_vep_attribute15_o
541 => ben_vep_shd.g_old_rec.vep_attribute15
542 ,p_vep_attribute16_o
543 => ben_vep_shd.g_old_rec.vep_attribute16
544 ,p_vep_attribute17_o
545 => ben_vep_shd.g_old_rec.vep_attribute17
546 ,p_vep_attribute18_o
547 => ben_vep_shd.g_old_rec.vep_attribute18
548 ,p_vep_attribute19_o
549 => ben_vep_shd.g_old_rec.vep_attribute19
550 ,p_vep_attribute20_o
551 => ben_vep_shd.g_old_rec.vep_attribute20
552 ,p_vep_attribute21_o
553 => ben_vep_shd.g_old_rec.vep_attribute21
554 ,p_vep_attribute22_o
555 => ben_vep_shd.g_old_rec.vep_attribute22
556 ,p_vep_attribute23_o
557 => ben_vep_shd.g_old_rec.vep_attribute23
558 ,p_vep_attribute24_o
559 => ben_vep_shd.g_old_rec.vep_attribute24
560 ,p_vep_attribute25_o
561 => ben_vep_shd.g_old_rec.vep_attribute25
562 ,p_vep_attribute26_o
563 => ben_vep_shd.g_old_rec.vep_attribute26
564 ,p_vep_attribute27_o
565 => ben_vep_shd.g_old_rec.vep_attribute27
566 ,p_vep_attribute28_o
567 => ben_vep_shd.g_old_rec.vep_attribute28
568 ,p_vep_attribute29_o
569 => ben_vep_shd.g_old_rec.vep_attribute29
570 ,p_vep_attribute30_o
571 => ben_vep_shd.g_old_rec.vep_attribute30
572 ,p_object_version_number_o
573 => ben_vep_shd.g_old_rec.object_version_number
574 );
575 --
576 exception
577 --
578 when hr_api.cannot_find_prog_unit then
579 --
580 hr_api.cannot_find_prog_unit_error
581 (p_module_name => 'BEN_VRBL_RT_ELIG_PRFL_F'
582 ,p_hook_type => 'AU');
583 --
584 end;
585 --
586 hr_utility.set_location(' Leaving:'||l_proc, 10);
587 End post_update;
588 --
589 -- ----------------------------------------------------------------------------
590 -- |-----------------------------< convert_defs >-----------------------------|
591 -- ----------------------------------------------------------------------------
592 -- {Start Of Comments}
593 --
594 -- Description:
595 -- The Convert_Defs procedure has one very important function:
596 -- It must return the record structure for the row with all system defaulted
597 -- values converted into its corresponding parameter value for update. When
598 -- we attempt to update a row through the Upd process , certain
599 -- parameters can be defaulted which enables flexibility in the calling of
600 -- the upd process (e.g. only attributes which need to be updated need to be
601 -- specified). For the upd process to determine which attributes
602 -- have NOT been specified we need to check if the parameter has a reserved
603 -- system default value. Therefore, for all parameters which have a
604 -- corresponding reserved system default mechanism specified we need to
605 -- check if a system default is being used. If a system default is being
606 -- used then we convert the defaulted value into its corresponding attribute
607 -- value held in the g_old_rec data structure.
608 --
609 -- Prerequisites:
610 -- This private function can only be called from the upd process.
611 --
612 -- In Parameters:
613 -- A Pl/Sql record structure.
614 --
615 -- Post Success:
616 -- The record structure will be returned with all system defaulted parameter
617 -- values converted into its current row attribute value.
618 --
619 -- Post Failure:
620 -- No direct error handling is required within this function. Any possible
621 -- errors within this procedure will be a PL/SQL value error due to
622 -- conversion of datatypes or data lengths.
623 --
624 -- Developer Implementation Notes:
625 -- None.
626 --
627 -- Access Status:
628 -- Internal Row Handler Use Only.
629 --
630 -- {End Of Comments}
631 -- ----------------------------------------------------------------------------
632 Procedure convert_defs
633 (p_rec in out nocopy ben_vep_shd.g_rec_type
634 ) is
635 --
636 Begin
637 --
638 -- We must now examine each argument value in the
639 -- p_rec plsql record structure
640 -- to see if a system default is being used. If a system default
641 -- is being used then we must set to the 'current' argument value.
642 --
643 If (p_rec.business_group_id = hr_api.g_number) then
644 p_rec.business_group_id :=
645 ben_vep_shd.g_old_rec.business_group_id;
646 End If;
647 If (p_rec.vrbl_rt_prfl_id = hr_api.g_number) then
648 p_rec.vrbl_rt_prfl_id :=
649 ben_vep_shd.g_old_rec.vrbl_rt_prfl_id;
650 End If;
651 If (p_rec.eligy_prfl_id = hr_api.g_number) then
652 p_rec.eligy_prfl_id :=
653 ben_vep_shd.g_old_rec.eligy_prfl_id;
654 End If;
655 If (p_rec.mndtry_flag = hr_api.g_varchar2) then
656 p_rec.mndtry_flag :=
657 ben_vep_shd.g_old_rec.mndtry_flag;
658 End If;
659 If (p_rec.vep_attribute_category = hr_api.g_varchar2) then
660 p_rec.vep_attribute_category :=
661 ben_vep_shd.g_old_rec.vep_attribute_category;
662 End If;
663 If (p_rec.vep_attribute1 = hr_api.g_varchar2) then
664 p_rec.vep_attribute1 :=
665 ben_vep_shd.g_old_rec.vep_attribute1;
666 End If;
667 If (p_rec.vep_attribute2 = hr_api.g_varchar2) then
668 p_rec.vep_attribute2 :=
669 ben_vep_shd.g_old_rec.vep_attribute2;
670 End If;
671 If (p_rec.vep_attribute3 = hr_api.g_varchar2) then
672 p_rec.vep_attribute3 :=
673 ben_vep_shd.g_old_rec.vep_attribute3;
674 End If;
675 If (p_rec.vep_attribute4 = hr_api.g_varchar2) then
676 p_rec.vep_attribute4 :=
677 ben_vep_shd.g_old_rec.vep_attribute4;
678 End If;
679 If (p_rec.vep_attribute5 = hr_api.g_varchar2) then
680 p_rec.vep_attribute5 :=
681 ben_vep_shd.g_old_rec.vep_attribute5;
682 End If;
683 If (p_rec.vep_attribute6 = hr_api.g_varchar2) then
684 p_rec.vep_attribute6 :=
685 ben_vep_shd.g_old_rec.vep_attribute6;
686 End If;
687 If (p_rec.vep_attribute7 = hr_api.g_varchar2) then
688 p_rec.vep_attribute7 :=
689 ben_vep_shd.g_old_rec.vep_attribute7;
690 End If;
691 If (p_rec.vep_attribute8 = hr_api.g_varchar2) then
692 p_rec.vep_attribute8 :=
693 ben_vep_shd.g_old_rec.vep_attribute8;
694 End If;
695 If (p_rec.vep_attribute9 = hr_api.g_varchar2) then
696 p_rec.vep_attribute9 :=
697 ben_vep_shd.g_old_rec.vep_attribute9;
698 End If;
699 If (p_rec.vep_attribute10 = hr_api.g_varchar2) then
700 p_rec.vep_attribute10 :=
701 ben_vep_shd.g_old_rec.vep_attribute10;
702 End If;
703 If (p_rec.vep_attribute11 = hr_api.g_varchar2) then
704 p_rec.vep_attribute11 :=
705 ben_vep_shd.g_old_rec.vep_attribute11;
706 End If;
707 If (p_rec.vep_attribute12 = hr_api.g_varchar2) then
708 p_rec.vep_attribute12 :=
709 ben_vep_shd.g_old_rec.vep_attribute12;
710 End If;
711 If (p_rec.vep_attribute13 = hr_api.g_varchar2) then
712 p_rec.vep_attribute13 :=
713 ben_vep_shd.g_old_rec.vep_attribute13;
714 End If;
715 If (p_rec.vep_attribute14 = hr_api.g_varchar2) then
716 p_rec.vep_attribute14 :=
717 ben_vep_shd.g_old_rec.vep_attribute14;
718 End If;
719 If (p_rec.vep_attribute15 = hr_api.g_varchar2) then
720 p_rec.vep_attribute15 :=
721 ben_vep_shd.g_old_rec.vep_attribute15;
722 End If;
723 If (p_rec.vep_attribute16 = hr_api.g_varchar2) then
724 p_rec.vep_attribute16 :=
725 ben_vep_shd.g_old_rec.vep_attribute16;
726 End If;
727 If (p_rec.vep_attribute17 = hr_api.g_varchar2) then
728 p_rec.vep_attribute17 :=
729 ben_vep_shd.g_old_rec.vep_attribute17;
730 End If;
731 If (p_rec.vep_attribute18 = hr_api.g_varchar2) then
732 p_rec.vep_attribute18 :=
733 ben_vep_shd.g_old_rec.vep_attribute18;
734 End If;
735 If (p_rec.vep_attribute19 = hr_api.g_varchar2) then
736 p_rec.vep_attribute19 :=
737 ben_vep_shd.g_old_rec.vep_attribute19;
738 End If;
739 If (p_rec.vep_attribute20 = hr_api.g_varchar2) then
740 p_rec.vep_attribute20 :=
741 ben_vep_shd.g_old_rec.vep_attribute20;
742 End If;
743 If (p_rec.vep_attribute21 = hr_api.g_varchar2) then
744 p_rec.vep_attribute21 :=
745 ben_vep_shd.g_old_rec.vep_attribute21;
746 End If;
747 If (p_rec.vep_attribute22 = hr_api.g_varchar2) then
748 p_rec.vep_attribute22 :=
749 ben_vep_shd.g_old_rec.vep_attribute22;
750 End If;
751 If (p_rec.vep_attribute23 = hr_api.g_varchar2) then
752 p_rec.vep_attribute23 :=
753 ben_vep_shd.g_old_rec.vep_attribute23;
754 End If;
755 If (p_rec.vep_attribute24 = hr_api.g_varchar2) then
756 p_rec.vep_attribute24 :=
757 ben_vep_shd.g_old_rec.vep_attribute24;
758 End If;
759 If (p_rec.vep_attribute25 = hr_api.g_varchar2) then
760 p_rec.vep_attribute25 :=
761 ben_vep_shd.g_old_rec.vep_attribute25;
762 End If;
763 If (p_rec.vep_attribute26 = hr_api.g_varchar2) then
764 p_rec.vep_attribute26 :=
765 ben_vep_shd.g_old_rec.vep_attribute26;
766 End If;
767 If (p_rec.vep_attribute27 = hr_api.g_varchar2) then
768 p_rec.vep_attribute27 :=
769 ben_vep_shd.g_old_rec.vep_attribute27;
770 End If;
771 If (p_rec.vep_attribute28 = hr_api.g_varchar2) then
772 p_rec.vep_attribute28 :=
773 ben_vep_shd.g_old_rec.vep_attribute28;
774 End If;
775 If (p_rec.vep_attribute29 = hr_api.g_varchar2) then
776 p_rec.vep_attribute29 :=
777 ben_vep_shd.g_old_rec.vep_attribute29;
778 End If;
779 If (p_rec.vep_attribute30 = hr_api.g_varchar2) then
780 p_rec.vep_attribute30 :=
781 ben_vep_shd.g_old_rec.vep_attribute30;
782 End If;
783 --
784 End convert_defs;
785 --
786 -- ----------------------------------------------------------------------------
787 -- |---------------------------------< upd >----------------------------------|
788 -- ----------------------------------------------------------------------------
789 Procedure upd
790 (p_effective_date in date
791 ,p_datetrack_mode in varchar2
792 ,p_rec in out nocopy ben_vep_shd.g_rec_type
793 ) is
794 --
795 l_proc varchar2(72) := g_package||'upd';
796 l_validation_start_date date;
797 l_validation_end_date date;
798 --
799 Begin
800 hr_utility.set_location('Entering:'||l_proc, 5);
801 --
802 -- Ensure that the DateTrack update mode is valid
803 --
804 dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
805 --
806 -- We must lock the row which we need to update.
807 --
808 ben_vep_shd.lck
809 (p_effective_date => p_effective_date
810 ,p_datetrack_mode => p_datetrack_mode
811 ,p_vrbl_rt_elig_prfl_id => p_rec.vrbl_rt_elig_prfl_id
812 ,p_object_version_number => p_rec.object_version_number
813 ,p_validation_start_date => l_validation_start_date
814 ,p_validation_end_date => l_validation_end_date
815 );
816 --
817 -- 1. During an update system defaults are used to determine if
818 -- arguments have been defaulted or not. We must therefore
819 -- derive the full record structure values to be updated.
820 --
821 -- 2. Call the supporting update validate operations.
822 --
823 ben_vep_upd.convert_defs(p_rec);
824 --
825 ben_vep_bus.update_validate
826 (p_rec => p_rec
827 ,p_effective_date => p_effective_date
828 ,p_datetrack_mode => p_datetrack_mode
829 ,p_validation_start_date => l_validation_start_date
830 ,p_validation_end_date => l_validation_end_date
831 );
832 --
833 -- Call the supporting pre-update operation
834 --
835 pre_update
836 (p_rec => p_rec
837 ,p_effective_date => p_effective_date
838 ,p_datetrack_mode => p_datetrack_mode
839 ,p_validation_start_date => l_validation_start_date
840 ,p_validation_end_date => l_validation_end_date
841 );
842 --
843 -- Update the row.
844 --
845 update_dml
846 (p_rec => p_rec
847 ,p_effective_date => p_effective_date
848 ,p_datetrack_mode => p_datetrack_mode
849 ,p_validation_start_date => l_validation_start_date
850 ,p_validation_end_date => l_validation_end_date
851 );
852 --
853 -- Call the supporting post-update operation
854 --
855 post_update
856 (p_rec => p_rec
857 ,p_effective_date => p_effective_date
858 ,p_datetrack_mode => p_datetrack_mode
859 ,p_validation_start_date => l_validation_start_date
860 ,p_validation_end_date => l_validation_end_date
861 );
862 End upd;
863 --
864 -- ----------------------------------------------------------------------------
865 -- |------------------------------< upd >-------------------------------------|
866 -- ----------------------------------------------------------------------------
867 Procedure upd
868 (p_effective_date in date
869 ,p_datetrack_mode in varchar2
870 ,p_vrbl_rt_elig_prfl_id in number
871 ,p_object_version_number in out nocopy number
872 ,p_business_group_id in number default hr_api.g_number
873 ,p_vrbl_rt_prfl_id in number default hr_api.g_number
874 ,p_eligy_prfl_id in number default hr_api.g_number
875 ,p_mndtry_flag in varchar2 default hr_api.g_varchar2
876 ,p_vep_attribute_category in varchar2 default hr_api.g_varchar2
877 ,p_vep_attribute1 in varchar2 default hr_api.g_varchar2
878 ,p_vep_attribute2 in varchar2 default hr_api.g_varchar2
879 ,p_vep_attribute3 in varchar2 default hr_api.g_varchar2
880 ,p_vep_attribute4 in varchar2 default hr_api.g_varchar2
881 ,p_vep_attribute5 in varchar2 default hr_api.g_varchar2
882 ,p_vep_attribute6 in varchar2 default hr_api.g_varchar2
883 ,p_vep_attribute7 in varchar2 default hr_api.g_varchar2
884 ,p_vep_attribute8 in varchar2 default hr_api.g_varchar2
885 ,p_vep_attribute9 in varchar2 default hr_api.g_varchar2
886 ,p_vep_attribute10 in varchar2 default hr_api.g_varchar2
887 ,p_vep_attribute11 in varchar2 default hr_api.g_varchar2
888 ,p_vep_attribute12 in varchar2 default hr_api.g_varchar2
889 ,p_vep_attribute13 in varchar2 default hr_api.g_varchar2
890 ,p_vep_attribute14 in varchar2 default hr_api.g_varchar2
891 ,p_vep_attribute15 in varchar2 default hr_api.g_varchar2
892 ,p_vep_attribute16 in varchar2 default hr_api.g_varchar2
893 ,p_vep_attribute17 in varchar2 default hr_api.g_varchar2
894 ,p_vep_attribute18 in varchar2 default hr_api.g_varchar2
895 ,p_vep_attribute19 in varchar2 default hr_api.g_varchar2
896 ,p_vep_attribute20 in varchar2 default hr_api.g_varchar2
897 ,p_vep_attribute21 in varchar2 default hr_api.g_varchar2
898 ,p_vep_attribute22 in varchar2 default hr_api.g_varchar2
899 ,p_vep_attribute23 in varchar2 default hr_api.g_varchar2
900 ,p_vep_attribute24 in varchar2 default hr_api.g_varchar2
901 ,p_vep_attribute25 in varchar2 default hr_api.g_varchar2
902 ,p_vep_attribute26 in varchar2 default hr_api.g_varchar2
903 ,p_vep_attribute27 in varchar2 default hr_api.g_varchar2
904 ,p_vep_attribute28 in varchar2 default hr_api.g_varchar2
905 ,p_vep_attribute29 in varchar2 default hr_api.g_varchar2
906 ,p_vep_attribute30 in varchar2 default hr_api.g_varchar2
907 ,p_effective_start_date out nocopy date
908 ,p_effective_end_date out nocopy date
909 ) is
910 --
911 l_rec ben_vep_shd.g_rec_type;
912 l_proc varchar2(72) := g_package||'upd';
913 --
914 Begin
915 hr_utility.set_location('Entering:'||l_proc, 5);
916 --
917 -- Call conversion function to turn arguments into the
918 -- l_rec structure.
919 --
920 l_rec :=
921 ben_vep_shd.convert_args
922 (p_vrbl_rt_elig_prfl_id
923 ,null
924 ,null
925 ,p_business_group_id
926 ,p_vrbl_rt_prfl_id
927 ,p_eligy_prfl_id
928 ,p_mndtry_flag
929 ,p_vep_attribute_category
930 ,p_vep_attribute1
931 ,p_vep_attribute2
932 ,p_vep_attribute3
933 ,p_vep_attribute4
934 ,p_vep_attribute5
935 ,p_vep_attribute6
936 ,p_vep_attribute7
937 ,p_vep_attribute8
938 ,p_vep_attribute9
939 ,p_vep_attribute10
940 ,p_vep_attribute11
941 ,p_vep_attribute12
942 ,p_vep_attribute13
943 ,p_vep_attribute14
944 ,p_vep_attribute15
945 ,p_vep_attribute16
946 ,p_vep_attribute17
947 ,p_vep_attribute18
948 ,p_vep_attribute19
949 ,p_vep_attribute20
950 ,p_vep_attribute21
951 ,p_vep_attribute22
952 ,p_vep_attribute23
953 ,p_vep_attribute24
954 ,p_vep_attribute25
955 ,p_vep_attribute26
956 ,p_vep_attribute27
957 ,p_vep_attribute28
958 ,p_vep_attribute29
959 ,p_vep_attribute30
960 ,p_object_version_number
961 );
962 --
963 -- Having converted the arguments into the
964 -- plsql record structure we call the corresponding record
965 -- business process.
966 --
967 ben_vep_upd.upd
968 (p_effective_date
969 ,p_datetrack_mode
970 ,l_rec
971 );
972 --
973 -- Set the out parameters
974 --
975 p_object_version_number := l_rec.object_version_number;
976 p_effective_start_date := l_rec.effective_start_date;
977 p_effective_end_date := l_rec.effective_end_date;
978 --
979 --
980 hr_utility.set_location(' Leaving:'||l_proc, 10);
981 End upd;
982 --
983 end ben_vep_upd;