[Home] [Help]
PACKAGE BODY: APPS.BEN_BFT_SHD
Source
1 Package Body ben_bft_shd as
2 /* $Header: bebftrhi.pkb 115.23 2003/08/18 05:05:29 rpgupta ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_bft_shd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< return_api_dml_status >-------------------------|
12 -- ----------------------------------------------------------------------------
13 Function return_api_dml_status Return Boolean Is
14 --
15 l_proc varchar2(72) := g_package||'return_api_dml_status';
16 --
17 Begin
18 hr_utility.set_location('Entering:'||l_proc, 5);
19 --
20 Return (nvl(g_api_dml, false));
21 --
22 hr_utility.set_location(' Leaving:'||l_proc, 10);
23 End return_api_dml_status;
24 --
25 -- ----------------------------------------------------------------------------
26 -- |---------------------------< constraint_error >---------------------------|
27 -- ----------------------------------------------------------------------------
28 Procedure constraint_error
29 (p_constraint_name in all_constraints.constraint_name%TYPE) Is
30 --
31 l_proc varchar2(72) := g_package||'constraint_error';
32 --
33 Begin
34 hr_utility.set_location('Entering:'||l_proc, 5);
35 --
36 If (p_constraint_name = 'BEN_BENEFIT_ACTIONS_PK') Then
37 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
38 hr_utility.set_message_token('PROCEDURE', l_proc);
39 hr_utility.set_message_token('STEP','5');
40 hr_utility.raise_error;
41 ElsIf (p_constraint_name = 'BEN_BENEFIT_ACTIONS_DT9') then
42 ben_utility.child_exists_error(p_table_name => 'BEN_BENEFIT_ACTIONS');
43 Else
44 hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
45 hr_utility.set_message_token('PROCEDURE', l_proc);
46 hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
50 hr_utility.set_location(' Leaving:'||l_proc, 10);
47 hr_utility.raise_error;
48 End If;
49 --
51 End constraint_error;
52 --
53 -- ----------------------------------------------------------------------------
54 -- |-----------------------------< api_updating >-----------------------------|
55 -- ----------------------------------------------------------------------------
56 Function api_updating
57 (
58 p_benefit_action_id in number,
59 p_object_version_number in number
60 ) Return Boolean Is
61 --
62 --
63 -- Cursor selects the 'current' row from the HR Schema
64 --
65 Cursor C_Sel1 is
66 select
67 benefit_action_id,
68 process_date,
69 uneai_effective_date,
70 mode_cd,
71 derivable_factors_flag,
72 close_uneai_flag,
73 validate_flag,
74 person_id,
75 person_type_id,
76 pgm_id,
77 business_group_id,
78 pl_id,
79 popl_enrt_typ_cycl_id,
80 no_programs_flag,
81 no_plans_flag,
82 comp_selection_rl,
83 person_selection_rl,
84 ler_id,
85 organization_id,
86 benfts_grp_id,
87 location_id,
88 pstl_zip_rng_id,
89 rptg_grp_id,
90 pl_typ_id,
91 opt_id,
92 eligy_prfl_id,
93 vrbl_rt_prfl_id,
94 legal_entity_id,
95 payroll_id,
96 debug_messages_flag,
97 cm_trgr_typ_cd,
98 cm_typ_id,
99 age_fctr_id,
100 min_age,
101 max_age,
102 los_fctr_id,
103 min_los,
104 max_los,
105 cmbn_age_los_fctr_id,
106 min_cmbn,
107 max_cmbn,
108 date_from,
109 elig_enrol_cd,
110 actn_typ_id,
111 use_fctr_to_sel_flag,
112 los_det_to_use_cd,
113 audit_log_flag,
114 lmt_prpnip_by_org_flag,
115 lf_evt_ocrd_dt,
116 ptnl_ler_for_per_stat_cd,
117 bft_attribute_category,
118 bft_attribute1,
119 bft_attribute3,
120 bft_attribute4,
121 bft_attribute5,
122 bft_attribute6,
123 bft_attribute7,
124 bft_attribute8,
125 bft_attribute9,
126 bft_attribute10,
127 bft_attribute11,
128 bft_attribute12,
129 bft_attribute13,
130 bft_attribute14,
131 bft_attribute15,
132 bft_attribute16,
133 bft_attribute17,
134 bft_attribute18,
135 bft_attribute19,
136 bft_attribute20,
137 bft_attribute21,
138 bft_attribute22,
139 bft_attribute23,
140 bft_attribute24,
141 bft_attribute25,
142 bft_attribute26,
143 bft_attribute27,
144 bft_attribute28,
145 bft_attribute29,
146 bft_attribute30,
147 request_id,
148 program_application_id,
149 program_id,
150 program_update_date,
151 object_version_number,
152 enrt_perd_id,
153 inelg_action_cd,
154 org_hierarchy_id,
155 org_starting_node_id,
156 grade_ladder_id,
157 asg_events_to_all_sel_dt,
158 rate_id,
159 per_sel_dt_cd,
160 per_sel_freq_cd,
161 per_sel_dt_from,
162 per_sel_dt_to,
163 year_from,
164 year_to,
165 cagr_id,
166 qual_type,
167 qual_status,
168 concat_segs,
169 grant_price_val
170 from ben_benefit_actions
171 where benefit_action_id = p_benefit_action_id;
172 --
173 l_proc varchar2(72) := g_package||'api_updating';
174 l_fct_ret boolean;
175 --
176 Begin
177 hr_utility.set_location('Entering:'||l_proc, 5);
178 --
179 If (
180 p_benefit_action_id is null and
181 p_object_version_number is null
182 ) Then
183 --
184 -- One of the primary key arguments is null therefore we must
185 -- set the returning function value to false
186 --
187 l_fct_ret := false;
188 Else
189 If (
190 p_benefit_action_id = g_old_rec.benefit_action_id and
191 p_object_version_number = g_old_rec.object_version_number
192 ) Then
193 hr_utility.set_location(l_proc, 10);
194 --
195 -- The g_old_rec is current therefore we must
196 -- set the returning function to true
197 --
198 l_fct_ret := true;
199 Else
200 --
201 -- Select the current row into g_old_rec
202 --
203 Open C_Sel1;
204 Fetch C_Sel1 Into g_old_rec;
205 If C_Sel1%notfound Then
206 Close C_Sel1;
207 --
208 -- The primary key is invalid therefore we must error
209 --
210 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
211 hr_utility.raise_error;
212 End If;
213 Close C_Sel1;
214 If (p_object_version_number <> g_old_rec.object_version_number) Then
215 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
216 hr_utility.raise_error;
217 End If;
218 hr_utility.set_location(l_proc, 15);
219 l_fct_ret := true;
220 End If;
221 End If;
222 hr_utility.set_location(' Leaving:'||l_proc, 20);
223 Return (l_fct_ret);
224 --
225 End api_updating;
226 --
227 -- ----------------------------------------------------------------------------
228 -- |---------------------------------< lck >----------------------------------|
229 -- ----------------------------------------------------------------------------
230 Procedure lck
231 (
232 p_benefit_action_id in number,
233 p_object_version_number in number
234 ) is
235 --
236 -- Cursor selects the 'current' row from the HR Schema
240 process_date,
237 --
238 Cursor C_Sel1 is
239 select benefit_action_id,
241 uneai_effective_date,
242 mode_cd,
243 derivable_factors_flag,
244 close_uneai_flag,
245 validate_flag,
246 person_id,
247 person_type_id,
248 pgm_id,
249 business_group_id,
250 pl_id,
251 popl_enrt_typ_cycl_id,
252 no_programs_flag,
253 no_plans_flag,
254 comp_selection_rl,
255 person_selection_rl,
256 ler_id,
257 organization_id,
258 benfts_grp_id,
259 location_id,
260 pstl_zip_rng_id,
261 rptg_grp_id,
262 pl_typ_id,
263 opt_id,
264 eligy_prfl_id,
265 vrbl_rt_prfl_id,
266 legal_entity_id,
267 payroll_id,
268 debug_messages_flag,
269 cm_trgr_typ_cd,
270 cm_typ_id,
271 age_fctr_id,
272 min_age,
273 max_age,
274 los_fctr_id,
275 min_los,
276 max_los,
277 cmbn_age_los_fctr_id,
278 min_cmbn,
279 max_cmbn,
280 date_from,
281 elig_enrol_cd,
282 actn_typ_id,
283 use_fctr_to_sel_flag,
284 los_det_to_use_cd,
285 audit_log_flag,
286 lmt_prpnip_by_org_flag,
287 lf_evt_ocrd_dt,
288 ptnl_ler_for_per_stat_cd,
289 bft_attribute_category,
290 bft_attribute1,
291 bft_attribute3,
292 bft_attribute4,
293 bft_attribute5,
294 bft_attribute6,
295 bft_attribute7,
296 bft_attribute8,
297 bft_attribute9,
298 bft_attribute10,
299 bft_attribute11,
300 bft_attribute12,
301 bft_attribute13,
302 bft_attribute14,
303 bft_attribute15,
304 bft_attribute16,
305 bft_attribute17,
306 bft_attribute18,
307 bft_attribute19,
308 bft_attribute20,
309 bft_attribute21,
310 bft_attribute22,
311 bft_attribute23,
312 bft_attribute24,
313 bft_attribute25,
314 bft_attribute26,
315 bft_attribute27,
316 bft_attribute28,
317 bft_attribute29,
318 bft_attribute30,
319 request_id,
320 program_application_id,
321 program_id,
322 program_update_date,
323 object_version_number,
324 enrt_perd_id,
325 inelg_action_cd,
326 org_hierarchy_id,
327 org_starting_node_id,
328 grade_ladder_id,
329 asg_events_to_all_sel_dt,
330 rate_id,
331 per_sel_dt_cd,
332 per_sel_freq_cd,
333 per_sel_dt_from,
334 per_sel_dt_to,
335 year_from,
336 year_to,
337 cagr_id,
338 qual_type,
339 qual_status,
340 concat_segs,
341 grant_price_val
342 from ben_benefit_actions
343 where benefit_action_id = p_benefit_action_id
344 for update nowait;
345 --
346 l_proc varchar2(72) := g_package||'lck';
347 --
348 Begin
349 hr_utility.set_location('Entering:'||l_proc, 5);
350 --
351 -- Add any mandatory argument checking here:
352 -- Example:
353 -- hr_api.mandatory_arg_error
354 -- (p_api_name => l_proc,
355 -- p_argument => 'object_version_number',
356 -- p_argument_value => p_object_version_number);
357 --
358 Open C_Sel1;
359 Fetch C_Sel1 Into g_old_rec;
360 If C_Sel1%notfound then
361 Close C_Sel1;
362 --
363 -- The primary key is invalid therefore we must error
364 --
365 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
366 hr_utility.raise_error;
367 End If;
368 Close C_Sel1;
369 If (p_object_version_number <> g_old_rec.object_version_number) Then
370 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
371 hr_utility.raise_error;
372 End If;
373 --
374 hr_utility.set_location(' Leaving:'||l_proc, 10);
375 --
376 -- We need to trap the ORA LOCK exception
377 --
378 Exception
379 When HR_Api.Object_Locked then
380 --
381 -- The object is locked therefore we need to supply a meaningful
382 -- error message.
383 --
384 hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
385 hr_utility.set_message_token('TABLE_NAME', 'ben_benefit_actions');
386 hr_utility.raise_error;
387 End lck;
388 --
389 -- ----------------------------------------------------------------------------
390 -- |-----------------------------< convert_args >-----------------------------|
391 -- ----------------------------------------------------------------------------
392 Function convert_args
393 (
394 p_benefit_action_id in number,
395 p_process_date in date,
396 p_uneai_effective_date in date,
397 p_mode_cd in varchar2,
398 p_derivable_factors_flag in varchar2,
399 p_close_uneai_flag in varchar2,
400 p_validate_flag in varchar2,
401 p_person_id in number,
402 p_person_type_id in number,
403 p_pgm_id in number,
404 p_business_group_id in number,
405 p_pl_id in number,
406 p_popl_enrt_typ_cycl_id in number,
407 p_no_programs_flag in varchar2,
408 p_no_plans_flag in varchar2,
409 p_comp_selection_rl in number,
410 p_person_selection_rl in number,
411 p_ler_id in number,
412 p_organization_id in number,
413 p_benfts_grp_id in number,
414 p_location_id in number,
415 p_pstl_zip_rng_id in number,
419 p_eligy_prfl_id in number,
416 p_rptg_grp_id in number,
417 p_pl_typ_id in number,
418 p_opt_id in number,
420 p_vrbl_rt_prfl_id in number,
421 p_legal_entity_id in number,
422 p_payroll_id in number,
423 p_debug_messages_flag in varchar2,
424 p_cm_trgr_typ_cd in varchar2,
425 p_cm_typ_id in number,
426 p_age_fctr_id in number,
427 p_min_age in number,
428 p_max_age in number,
429 p_los_fctr_id in number,
430 p_min_los in number,
431 p_max_los in number,
432 p_cmbn_age_los_fctr_id in number,
433 p_min_cmbn in number,
434 p_max_cmbn in number,
435 p_date_from in date,
436 p_elig_enrol_cd in varchar2,
437 p_actn_typ_id in number,
438 p_use_fctr_to_sel_flag in varchar2,
439 p_los_det_to_use_cd in varchar2,
440 p_audit_log_flag in varchar2,
441 p_lmt_prpnip_by_org_flag in varchar2,
442 p_lf_evt_ocrd_dt in date,
443 p_ptnl_ler_for_per_stat_cd in varchar2,
444 p_bft_attribute_category in varchar2,
445 p_bft_attribute1 in varchar2,
446 p_bft_attribute3 in varchar2,
447 p_bft_attribute4 in varchar2,
448 p_bft_attribute5 in varchar2,
449 p_bft_attribute6 in varchar2,
450 p_bft_attribute7 in varchar2,
451 p_bft_attribute8 in varchar2,
452 p_bft_attribute9 in varchar2,
453 p_bft_attribute10 in varchar2,
454 p_bft_attribute11 in varchar2,
455 p_bft_attribute12 in varchar2,
456 p_bft_attribute13 in varchar2,
457 p_bft_attribute14 in varchar2,
458 p_bft_attribute15 in varchar2,
459 p_bft_attribute16 in varchar2,
460 p_bft_attribute17 in varchar2,
461 p_bft_attribute18 in varchar2,
462 p_bft_attribute19 in varchar2,
463 p_bft_attribute20 in varchar2,
464 p_bft_attribute21 in varchar2,
465 p_bft_attribute22 in varchar2,
466 p_bft_attribute23 in varchar2,
467 p_bft_attribute24 in varchar2,
468 p_bft_attribute25 in varchar2,
469 p_bft_attribute26 in varchar2,
470 p_bft_attribute27 in varchar2,
471 p_bft_attribute28 in varchar2,
472 p_bft_attribute29 in varchar2,
473 p_bft_attribute30 in varchar2,
474 p_request_id in number,
475 p_program_application_id in number,
476 p_program_id in number,
477 p_program_update_date in date,
478 p_object_version_number in number,
479 p_enrt_perd_id in number,
480 p_inelg_action_cd in varchar2,
481 p_org_hierarchy_id in number ,
482 p_org_starting_node_id in number,
483 p_grade_ladder_id in number,
484 p_asg_events_to_all_sel_dt in varchar2,
485 p_rate_id in number,
486 p_per_sel_dt_cd in varchar2,
487 p_per_sel_freq_cd in varchar2,
488 p_per_sel_dt_from in date,
489 p_per_sel_dt_to in date,
490 p_year_from in number,
491 p_year_to in number,
492 p_cagr_id in number,
493 p_qual_type in number,
494 p_qual_status in varchar2,
495 p_concat_segs in varchar2,
496 p_grant_price_val in number
497 )
498 Return g_rec_type is
499 --
500 l_rec g_rec_type;
501 l_proc varchar2(72) := g_package||'convert_args';
502 --
503 Begin
504 --
505 hr_utility.set_location('Entering:'||l_proc, 5);
506 --
507 -- Convert arguments into local l_rec structure.
508 --
509 l_rec.benefit_action_id := p_benefit_action_id;
510 l_rec.process_date := p_process_date;
511 l_rec.uneai_effective_date := p_uneai_effective_date;
512 l_rec.mode_cd := p_mode_cd;
513 l_rec.derivable_factors_flag := p_derivable_factors_flag;
514 l_rec.close_uneai_flag := p_close_uneai_flag;
515 l_rec.validate_flag := p_validate_flag;
516 l_rec.person_id := p_person_id;
517 l_rec.person_type_id := p_person_type_id;
518 l_rec.pgm_id := p_pgm_id;
519 l_rec.business_group_id := p_business_group_id;
520 l_rec.pl_id := p_pl_id;
521 l_rec.popl_enrt_typ_cycl_id := p_popl_enrt_typ_cycl_id;
522 l_rec.no_programs_flag := p_no_programs_flag;
523 l_rec.no_plans_flag := p_no_plans_flag;
524 l_rec.comp_selection_rl := p_comp_selection_rl;
525 l_rec.person_selection_rl := p_person_selection_rl;
526 l_rec.ler_id := p_ler_id;
527 l_rec.organization_id := p_organization_id;
528 l_rec.benfts_grp_id := p_benfts_grp_id;
529 l_rec.location_id := p_location_id;
530 l_rec.pstl_zip_rng_id := p_pstl_zip_rng_id;
531 l_rec.rptg_grp_id := p_rptg_grp_id;
532 l_rec.pl_typ_id := p_pl_typ_id;
533 l_rec.opt_id := p_opt_id;
534 l_rec.eligy_prfl_id := p_eligy_prfl_id;
535 l_rec.vrbl_rt_prfl_id := p_vrbl_rt_prfl_id;
536 l_rec.legal_entity_id := p_legal_entity_id;
537 l_rec.payroll_id := p_payroll_id;
538 l_rec.debug_messages_flag := p_debug_messages_flag;
539 l_rec.cm_trgr_typ_cd := p_cm_trgr_typ_cd;
540 l_rec.cm_typ_id := p_cm_typ_id;
541 l_rec.age_fctr_id := p_age_fctr_id;
542 l_rec.min_age := p_min_age;
543 l_rec.max_age := p_max_age;
544 l_rec.los_fctr_id := p_los_fctr_id;
545 l_rec.min_los := p_min_los;
546 l_rec.max_los := p_max_los;
547 l_rec.cmbn_age_los_fctr_id := p_cmbn_age_los_fctr_id;
548 l_rec.min_cmbn := p_min_cmbn;
549 l_rec.max_cmbn := p_max_cmbn;
550 l_rec.date_from := p_date_from;
551 l_rec.elig_enrol_cd := p_elig_enrol_cd;
552 l_rec.actn_typ_id := p_actn_typ_id;
553 l_rec.use_fctr_to_sel_flag := p_use_fctr_to_sel_flag;
554 l_rec.los_det_to_use_cd := p_los_det_to_use_cd;
555 l_rec.audit_log_flag := p_audit_log_flag;
556 l_rec.lmt_prpnip_by_org_flag := p_lmt_prpnip_by_org_flag;
557 l_rec.lf_evt_ocrd_dt := p_lf_evt_ocrd_dt;
558 l_rec.ptnl_ler_for_per_stat_cd := p_ptnl_ler_for_per_stat_cd;
559 l_rec.bft_attribute_category := p_bft_attribute_category;
560 l_rec.bft_attribute1 := p_bft_attribute1;
561 l_rec.bft_attribute3 := p_bft_attribute3;
562 l_rec.bft_attribute4 := p_bft_attribute4;
563 l_rec.bft_attribute5 := p_bft_attribute5;
564 l_rec.bft_attribute6 := p_bft_attribute6;
565 l_rec.bft_attribute7 := p_bft_attribute7;
566 l_rec.bft_attribute8 := p_bft_attribute8;
567 l_rec.bft_attribute9 := p_bft_attribute9;
568 l_rec.bft_attribute10 := p_bft_attribute10;
569 l_rec.bft_attribute11 := p_bft_attribute11;
570 l_rec.bft_attribute12 := p_bft_attribute12;
571 l_rec.bft_attribute13 := p_bft_attribute13;
572 l_rec.bft_attribute14 := p_bft_attribute14;
573 l_rec.bft_attribute15 := p_bft_attribute15;
574 l_rec.bft_attribute16 := p_bft_attribute16;
575 l_rec.bft_attribute17 := p_bft_attribute17;
576 l_rec.bft_attribute18 := p_bft_attribute18;
577 l_rec.bft_attribute19 := p_bft_attribute19;
578 l_rec.bft_attribute20 := p_bft_attribute20;
579 l_rec.bft_attribute21 := p_bft_attribute21;
580 l_rec.bft_attribute22 := p_bft_attribute22;
581 l_rec.bft_attribute23 := p_bft_attribute23;
582 l_rec.bft_attribute24 := p_bft_attribute24;
583 l_rec.bft_attribute25 := p_bft_attribute25;
584 l_rec.bft_attribute26 := p_bft_attribute26;
585 l_rec.bft_attribute27 := p_bft_attribute27;
586 l_rec.bft_attribute28 := p_bft_attribute28;
587 l_rec.bft_attribute29 := p_bft_attribute29;
588 l_rec.bft_attribute30 := p_bft_attribute30;
589 l_rec.request_id := p_request_id;
590 l_rec.program_application_id := p_program_application_id;
591 l_rec.program_id := p_program_id;
592 l_rec.program_update_date := p_program_update_date;
593 l_rec.object_version_number := p_object_version_number;
594 l_rec.enrt_perd_id := p_enrt_perd_id;
595 l_rec.inelg_action_cd := p_inelg_action_cd;
596 l_rec.org_hierarchy_id := p_org_hierarchy_id;
597 l_rec.org_starting_node_id := p_org_starting_node_id;
598 l_rec.grade_ladder_id := p_grade_ladder_id;
599 l_rec.asg_events_to_all_sel_dt := p_asg_events_to_all_sel_dt;
600 l_rec.rate_id := p_rate_id;
601 l_rec.per_sel_dt_cd := p_per_sel_dt_cd;
602 l_rec.per_sel_freq_cd := p_per_sel_freq_cd;
603 l_rec.per_sel_dt_from := p_per_sel_dt_from;
604 l_rec.per_sel_dt_to := p_per_sel_dt_to;
605 l_rec.year_from := p_year_from;
606 l_rec.year_to := p_year_to;
607 l_rec.cagr_id := p_cagr_id;
608 l_rec.qual_type := p_qual_type;
609 l_rec.qual_status := p_qual_status;
610 l_rec.concat_segs := p_concat_segs;
611 l_rec.grant_price_val := p_grant_price_val;
612 --
613 -- Return the plsql record structure.
614 --
615 hr_utility.set_location(' Leaving:'||l_proc, 10);
616 Return(l_rec);
617 --
618 End convert_args;
619 --
620 end ben_bft_shd;