[Home] [Help]
1: package body ben_ext_thread as
2: /* $Header: benxthrd.pkb 120.49.12020000.3 2012/07/03 13:02:08 amnaraya ship $ */
3:
4: /*
5: +==============================================================================+
423: p_cm_display_flag
424: ;
425: --
426: if ext_dfn_c%notfound then
427: ben_ext_thread.g_err_num := 91873;
428: ben_ext_thread.g_err_name := 'BEN_91873_EXT_NOT_FOUND';
429: close ext_dfn_c;
430: raise g_job_failure_error;
431: end if;
424: ;
425: --
426: if ext_dfn_c%notfound then
427: ben_ext_thread.g_err_num := 91873;
428: ben_ext_thread.g_err_name := 'BEN_91873_EXT_NOT_FOUND';
429: close ext_dfn_c;
430: raise g_job_failure_error;
431: end if;
432: --
974: close c_rule_type;
975:
976: if g_debug then
977: hr_utility.set_location(' rule type :'||l_rule_type.formula_type_id, 39);
978: hr_utility.set_location(' ext_dfn_id :'||ben_ext_thread.g_ext_dfn_id, 39);
979: hr_utility.set_location(' rslt id :'||ben_ext_thread.g_ext_rslt_id, 39);
980: end if;
981: if l_rule_type.formula_type_id = -546 then
982: l_outputs := benutils.formula
975:
976: if g_debug then
977: hr_utility.set_location(' rule type :'||l_rule_type.formula_type_id, 39);
978: hr_utility.set_location(' ext_dfn_id :'||ben_ext_thread.g_ext_dfn_id, 39);
979: hr_utility.set_location(' rslt id :'||ben_ext_thread.g_ext_rslt_id, 39);
980: end if;
981: if l_rule_type.formula_type_id = -546 then
982: l_outputs := benutils.formula
983: (p_formula_id => p_data_elmt_rl,
983: (p_formula_id => p_data_elmt_rl,
984: p_effective_date => p_effective_date ,
985: p_business_group_id => nvl(p_ext_per_bg_id, p_business_group_id)
986: ,p_param1 => 'EXT_DFN_ID'
987: ,p_param1_value => to_char(nvl(ben_ext_thread.g_ext_dfn_id, -1))
988: ,p_param2 => 'EXT_RSLT_ID'
989: ,p_param2_value => to_char(nvl(ben_ext_thread.g_ext_rslt_id, -1))
990: ,p_param3 => 'EXT_USER_VALUE'
991: ,p_param3_value => p_string_val
985: p_business_group_id => nvl(p_ext_per_bg_id, p_business_group_id)
986: ,p_param1 => 'EXT_DFN_ID'
987: ,p_param1_value => to_char(nvl(ben_ext_thread.g_ext_dfn_id, -1))
988: ,p_param2 => 'EXT_RSLT_ID'
989: ,p_param2_value => to_char(nvl(ben_ext_thread.g_ext_rslt_id, -1))
990: ,p_param3 => 'EXT_USER_VALUE'
991: ,p_param3_value => p_string_val
992: ,p_param4 => 'EXT_PROCESS_BUSINESS_GROUP'
993: ,p_param4_value => to_char(p_business_group_id)
1307:
1308: END IF;
1309:
1310: if p_rcd_typ_cd <> 'L' and g_subtrl_cnt = 0 and
1311: ben_ext_thread.g_ext_group_elmt1 is not null then
1312: open get_subtrl_cnt ;
1313: fetch get_subtrl_cnt into g_subtrl_cnt ;
1314: close get_subtrl_cnt ;
1315: end if ;
1885: p_request_id => fnd_global.conc_request_id,
1886: p_ext_rslt_id => p_ext_rslt_id,
1887: p_business_group_id => p_business_group_id
1888: );
1889: raise ben_ext_thread.g_job_failure_error;
1890: --
1891: when others then
1892:
1893: rollback to head_trail;
2304: ,p_chunk_size => l_chunk_size
2305: ,p_max_errors => g_max_errors_allowed);
2306: --
2307: --
2308: -- MH moved call to thread level (ben_ext_thread.do_multithread)
2309: -- rather than chunk level to minimize
2310: -- memory consumption
2311: --
2312: -- Determine extract Levels
2406: l_line := 6;
2407: --
2408: -- halt all other threads when job failure.
2409: if l_failure_in_other_thread then
2410: ben_ext_thread.g_err_num := 92184;
2411: ben_ext_thread.g_err_name := 'BEN_92184_THREAD_HALTED';
2412: raise g_job_failure_error;
2413: end if;
2414: --
2407: --
2408: -- halt all other threads when job failure.
2409: if l_failure_in_other_thread then
2410: ben_ext_thread.g_err_num := 92184;
2411: ben_ext_thread.g_err_name := 'BEN_92184_THREAD_HALTED';
2412: raise g_job_failure_error;
2413: end if;
2414: --
2415: l_line := 7;
2439: where range_id = l_range_id;
2440: --
2441: -- write to the extract error table, so error will be reported
2442: -- on the error report and viewed on the extract result form.
2443: if ben_ext_thread.g_err_num <> 92184 then --don't write if halt warning.
2444: write_error(p_err_num => ben_ext_thread.g_err_num,
2445: p_err_name => null , --ben_ext_thread.g_err_name,
2446: p_typ_cd => 'F',
2447: p_person_id => null,
2440: --
2441: -- write to the extract error table, so error will be reported
2442: -- on the error report and viewed on the extract result form.
2443: if ben_ext_thread.g_err_num <> 92184 then --don't write if halt warning.
2444: write_error(p_err_num => ben_ext_thread.g_err_num,
2445: p_err_name => null , --ben_ext_thread.g_err_name,
2446: p_typ_cd => 'F',
2447: p_person_id => null,
2448: p_request_id => p_request_id,
2441: -- write to the extract error table, so error will be reported
2442: -- on the error report and viewed on the extract result form.
2443: if ben_ext_thread.g_err_num <> 92184 then --don't write if halt warning.
2444: write_error(p_err_num => ben_ext_thread.g_err_num,
2445: p_err_name => null , --ben_ext_thread.g_err_name,
2446: p_typ_cd => 'F',
2447: p_person_id => null,
2448: p_request_id => p_request_id,
2449: p_ext_rslt_id => p_ext_rslt_id,
2460: fnd_file.put_line(fnd_file.log, fnd_message.get || ' ' ||to_char(p_thread_id));
2461: --
2462: -- write the error message to the log file.
2463: --
2464: if ben_ext_thread.g_err_num <> 92184 then
2465: fnd_message.set_name('BEN', 'BEN_92186_THREAD_FAILURE');
2466: fnd_file.put_line(fnd_file.log, fnd_message.get);
2467: fnd_file.put_line(fnd_file.log, ' ');
2468: end if;
2465: fnd_message.set_name('BEN', 'BEN_92186_THREAD_FAILURE');
2466: fnd_file.put_line(fnd_file.log, fnd_message.get);
2467: fnd_file.put_line(fnd_file.log, ' ');
2468: end if;
2469: fnd_message.set_name('BEN', ben_ext_thread.g_err_name);
2470: fnd_file.put_line(fnd_file.log, fnd_message.get);
2471: --
2472: -- if slave process, we are done. If master process, raise job failure in
2473: -- calling program (ben_ext_thread.process)
2469: fnd_message.set_name('BEN', ben_ext_thread.g_err_name);
2470: fnd_file.put_line(fnd_file.log, fnd_message.get);
2471: --
2472: -- if slave process, we are done. If master process, raise job failure in
2473: -- calling program (ben_ext_thread.process)
2474: --
2475: end if;
2476: --
2477: if p_master_process_flag = 'Y' then
2491: --
2492: fnd_message.set_name('BEN', 'BEN_92190_THREAD_LABEL');
2493: fnd_file.put_line(fnd_file.log, fnd_message.get || ' ' ||to_char(p_thread_id));
2494: -- if slave process, we are done. If master process, raise job failure in
2495: -- calling program (ben_ext_thread.process)
2496: --
2497: if p_master_process_flag = 'Y' then
2498: raise;
2499: else -- slave
3534:
3535: if g_chg_ext_from_pay = 'Y' and ( l_cpe_exclude = 'Y' or l_cad_exclude = 'Y' or l_ced_exclude = 'Y' ) then
3536: -- with payroll cahnge event exclude criteria on Event groups or Effective date or Actaul date is not allowed
3537:
3538: ben_ext_thread.g_err_num := 94264;
3539: ben_ext_thread.g_err_name := 'BEN_94264_EXT_PAY_CHG_EXCLD';
3540: raise g_job_failure_error;
3541: end if ;
3542:
3535: if g_chg_ext_from_pay = 'Y' and ( l_cpe_exclude = 'Y' or l_cad_exclude = 'Y' or l_ced_exclude = 'Y' ) then
3536: -- with payroll cahnge event exclude criteria on Event groups or Effective date or Actaul date is not allowed
3537:
3538: ben_ext_thread.g_err_num := 94264;
3539: ben_ext_thread.g_err_name := 'BEN_94264_EXT_PAY_CHG_EXCLD';
3540: raise g_job_failure_error;
3541: end if ;
3542:
3543:
5623: -- if customer pass one parameter errro
5624: if ( p_eff_start_date is not null and p_eff_end_date is null )
5625: or ( p_act_start_date is not null and p_act_end_date is null )
5626: then
5627: ben_ext_thread.g_err_num := 91919;
5628: ben_ext_thread.g_err_name := 'BEN_91919_EXT_END_DT_NULL';
5629: raise g_job_failure_error;
5630:
5631: end if ;
5624: if ( p_eff_start_date is not null and p_eff_end_date is null )
5625: or ( p_act_start_date is not null and p_act_end_date is null )
5626: then
5627: ben_ext_thread.g_err_num := 91919;
5628: ben_ext_thread.g_err_name := 'BEN_91919_EXT_END_DT_NULL';
5629: raise g_job_failure_error;
5630:
5631: end if ;
5632:
5685: );
5686: --
5687: if l_ext_file_id is null then
5688: --
5689: ben_ext_thread.g_err_num := 91917;
5690: ben_ext_thread.g_err_name := 'BEN_91917_EXT_FILE_NULL';
5691: raise g_job_failure_error;
5692: --
5693: end if;
5686: --
5687: if l_ext_file_id is null then
5688: --
5689: ben_ext_thread.g_err_num := 91917;
5690: ben_ext_thread.g_err_name := 'BEN_91917_EXT_FILE_NULL';
5691: raise g_job_failure_error;
5692: --
5693: end if;
5694:
5743: --
5744: END IF;
5745: --
5746: if l_ext_end_dt < l_ext_strt_dt then
5747: ben_ext_thread.g_err_num := 92080;
5748: ben_ext_thread.g_err_name := 'BEN_92080_EXT_STRT_END_DT';
5749: raise g_job_failure_error;
5750: end if;
5751: --
5744: END IF;
5745: --
5746: if l_ext_end_dt < l_ext_strt_dt then
5747: ben_ext_thread.g_err_num := 92080;
5748: ben_ext_thread.g_err_name := 'BEN_92080_EXT_STRT_END_DT';
5749: raise g_job_failure_error;
5750: end if;
5751: --
5752: g_ext_end_dt := l_ext_end_dt;
5751: --
5752: g_ext_end_dt := l_ext_end_dt;
5753: --
5754: if l_ext_strt_dt is null then
5755: ben_ext_thread.g_err_num := 91918;
5756: ben_ext_thread.g_err_name := 'BEN_91918_EXT_STRT_DT_NULL';
5757: raise g_job_failure_error;
5758: end if;
5759: --
5752: g_ext_end_dt := l_ext_end_dt;
5753: --
5754: if l_ext_strt_dt is null then
5755: ben_ext_thread.g_err_num := 91918;
5756: ben_ext_thread.g_err_name := 'BEN_91918_EXT_STRT_DT_NULL';
5757: raise g_job_failure_error;
5758: end if;
5759: --
5760: if l_ext_end_dt is null then
5757: raise g_job_failure_error;
5758: end if;
5759: --
5760: if l_ext_end_dt is null then
5761: ben_ext_thread.g_err_num := 91919;
5762: ben_ext_thread.g_err_name := 'BEN_91919_EXT_END_DT_NULL';
5763: raise g_job_failure_error;
5764: end if;
5765: --
5758: end if;
5759: --
5760: if l_ext_end_dt is null then
5761: ben_ext_thread.g_err_num := 91919;
5762: ben_ext_thread.g_err_name := 'BEN_91919_EXT_END_DT_NULL';
5763: raise g_job_failure_error;
5764: end if;
5765: --
5766: */
6277: p_rcd_typ_cd => 'L',
6278: p_business_group_id => p_business_group_id,
6279: p_effective_date => l_effective_date,
6280: p_request_id => l_conc_request_id,
6281: p_ext_group_elmt1 => ben_ext_thread.g_ext_group_elmt1,
6282: p_ext_group_elmt2 => ben_ext_thread.g_ext_group_elmt2,
6283: p_ext_crit_prfl_id => l_ext_crit_prfl_id);
6284: --
6285: -- Process Footer Records
6278: p_business_group_id => p_business_group_id,
6279: p_effective_date => l_effective_date,
6280: p_request_id => l_conc_request_id,
6281: p_ext_group_elmt1 => ben_ext_thread.g_ext_group_elmt1,
6282: p_ext_group_elmt2 => ben_ext_thread.g_ext_group_elmt2,
6283: p_ext_crit_prfl_id => l_ext_crit_prfl_id);
6284: --
6285: -- Process Footer Records
6286:
6326: p_param1 => 'EXT_RSLT_ID',
6327: p_param1_value => to_char(l_ext_rslt_id)
6328: --RChase pass extract definition id as input value
6329: ,p_param2 => 'EXT_DFN_ID'
6330: ,p_param2_value => to_char(nvl(ben_ext_thread.g_ext_dfn_id, -1)));
6331: --
6332: end if;
6333: --
6334: commit; -- anything that the formula did.
7333: end Load_extract;
7334:
7335:
7336: --
7337: End ben_ext_thread;