293: l_actn varchar2(80);
294: l_request_id number;
295: Begin
296: hr_utility.set_location ('Entering '||l_proc,05);
297: l_actn := 'Calling ben_batch_utils.batch_report (BENPRSUM)...';
298: ben_batch_utils.batch_report
299: (p_concurrent_request_id => fnd_global.conc_request_id
300: ,p_program_name => 'BENFRSUM'
301: ,p_request_id => l_request_id
294: l_request_id number;
295: Begin
296: hr_utility.set_location ('Entering '||l_proc,05);
297: l_actn := 'Calling ben_batch_utils.batch_report (BENPRSUM)...';
298: ben_batch_utils.batch_report
299: (p_concurrent_request_id => fnd_global.conc_request_id
300: ,p_program_name => 'BENFRSUM'
301: ,p_request_id => l_request_id
302: );
299: (p_concurrent_request_id => fnd_global.conc_request_id
300: ,p_program_name => 'BENFRSUM'
301: ,p_request_id => l_request_id
302: );
303: l_actn := 'Calling ben_batch_utils.batch_report (BENFRAUD)...';
304: ben_batch_utils.batch_report
305: (p_concurrent_request_id => fnd_global.conc_request_id
306: ,p_program_name => 'BENFRAUD'
307: ,p_request_id => l_request_id
300: ,p_program_name => 'BENFRSUM'
301: ,p_request_id => l_request_id
302: );
303: l_actn := 'Calling ben_batch_utils.batch_report (BENFRAUD)...';
304: ben_batch_utils.batch_report
305: (p_concurrent_request_id => fnd_global.conc_request_id
306: ,p_program_name => 'BENFRAUD'
307: ,p_request_id => l_request_id
308: );
305: (p_concurrent_request_id => fnd_global.conc_request_id
306: ,p_program_name => 'BENFRAUD'
307: ,p_request_id => l_request_id
308: );
309: l_actn := 'Calling ben_batch_utils.batch_report (BENERTYP)...';
310: ben_batch_utils.batch_report
311: (p_concurrent_request_id => fnd_global.conc_request_id
312: ,p_program_name => 'BENERTYP'
313: ,p_request_id => l_request_id
306: ,p_program_name => 'BENFRAUD'
307: ,p_request_id => l_request_id
308: );
309: l_actn := 'Calling ben_batch_utils.batch_report (BENERTYP)...';
310: ben_batch_utils.batch_report
311: (p_concurrent_request_id => fnd_global.conc_request_id
312: ,p_program_name => 'BENERTYP'
313: ,p_request_id => l_request_id
314: );
311: (p_concurrent_request_id => fnd_global.conc_request_id
312: ,p_program_name => 'BENERTYP'
313: ,p_request_id => l_request_id
314: );
315: l_actn := 'Calling ben_batch_utils.batch_report (BENERPER)...';
316: ben_batch_utils.batch_report
317: (p_concurrent_request_id => fnd_global.conc_request_id
318: ,p_program_name => 'BENERPER'
319: ,p_request_id => l_request_id
312: ,p_program_name => 'BENERTYP'
313: ,p_request_id => l_request_id
314: );
315: l_actn := 'Calling ben_batch_utils.batch_report (BENERPER)...';
316: ben_batch_utils.batch_report
317: (p_concurrent_request_id => fnd_global.conc_request_id
318: ,p_program_name => 'BENERPER'
319: ,p_request_id => l_request_id
320: );
321:
322: hr_utility.set_location ('Leaving '||l_proc,10);
323: Exception
324: When others then
325: ben_batch_utils.rpt_error(p_proc => l_proc
326: ,p_last_actn => l_actn
327: ,p_rpt_flag => p_rpt_flag
328: );
329: raise;
1019: p_threads => l_threads,
1020: p_max_errors => g_max_errors_allowed,
1021: p_benefit_action_id => p_benefit_action_id);
1022: --
1023: l_actn := 'Calling ben_batch_utils.ini...';
1024: ben_batch_utils.ini; -- deletes g_cache_person, g_cache_comp, g_pgm_tbl etc.,
1025: --
1026: -- Copy benefit action id to global in benutils package
1027: --
1020: p_max_errors => g_max_errors_allowed,
1021: p_benefit_action_id => p_benefit_action_id);
1022: --
1023: l_actn := 'Calling ben_batch_utils.ini...';
1024: ben_batch_utils.ini; -- deletes g_cache_person, g_cache_comp, g_pgm_tbl etc.,
1025: --
1026: -- Copy benefit action id to global in benutils package
1027: --
1028: benutils.g_benefit_action_id := p_benefit_action_id;
1032: open c_parameter;
1033: fetch c_parameter into l_parm;
1034: close c_parameter;
1035: --
1036: l_actn := 'Calling ben_batch_utils.print_parameters...';
1037: --
1038: -- 9999 It calls the write routine in benrptut, in turn calls fnd_file.put_line
1039: ben_batch_utils.print_parameters
1040: (p_thread_id => p_thread_id
1035: --
1036: l_actn := 'Calling ben_batch_utils.print_parameters...';
1037: --
1038: -- 9999 It calls the write routine in benrptut, in turn calls fnd_file.put_line
1039: ben_batch_utils.print_parameters
1040: (p_thread_id => p_thread_id
1041: ,p_benefit_action_id => p_benefit_action_id
1042: ,p_effective_date => l_effective_date
1043: ,p_validate => p_validate
1179: -- 9999 Write only if requested by the user.
1180: benutils.write_table_and_file(p_table => TRUE, p_file => TRUE);
1181: --
1182: l_actn := 'Calling Log_statistics...';
1183: ben_batch_utils.write_logfile(p_num_pers_processed => g_persons_processed
1184: ,p_num_pers_errored => g_persons_errored
1185: );
1186: hr_utility.set_location ('Leaving '||l_proc,70);
1187: Exception
1185: );
1186: hr_utility.set_location ('Leaving '||l_proc,70);
1187: Exception
1188: When others then
1189: ben_batch_utils.rpt_error(p_proc => l_proc
1190: ,p_last_actn => l_actn
1191: ,p_rpt_flag => TRUE
1192: );
1193: ben_batch_utils.write_logfile(p_num_pers_processed => g_persons_processed
1189: ben_batch_utils.rpt_error(p_proc => l_proc
1190: ,p_last_actn => l_actn
1191: ,p_rpt_flag => TRUE
1192: );
1193: ben_batch_utils.write_logfile(p_num_pers_processed => g_persons_processed
1194: ,p_num_pers_errored => g_persons_errored
1195: );
1196: benutils.write_table_and_file(p_table => TRUE, p_file => TRUE);
1197: hr_utility.set_location ('HR_6153_ALL_PROCEDURE_FAIL',05);
1296: */
1297: l_effective_date := trunc(fnd_date.canonical_to_date(p_effective_date));
1298: --
1299: --
1300: --9999 Needed?? l_actn := 'Initialize the ben_batch_utils cache...';
1301: --9999 Needed?? ben_batch_utils.ini;
1302: --9999 Needed?? l_actn := 'Initialize the ben_batch_utils cache...';
1303: --9999 Needed?? ben_batch_utils.ini(p_actn_cd => 'PROC_INFO');
1304: --
1297: l_effective_date := trunc(fnd_date.canonical_to_date(p_effective_date));
1298: --
1299: --
1300: --9999 Needed?? l_actn := 'Initialize the ben_batch_utils cache...';
1301: --9999 Needed?? ben_batch_utils.ini;
1302: --9999 Needed?? l_actn := 'Initialize the ben_batch_utils cache...';
1303: --9999 Needed?? ben_batch_utils.ini(p_actn_cd => 'PROC_INFO');
1304: --
1305: -- Create actions if we are not doing a restart.
1298: --
1299: --
1300: --9999 Needed?? l_actn := 'Initialize the ben_batch_utils cache...';
1301: --9999 Needed?? ben_batch_utils.ini;
1302: --9999 Needed?? l_actn := 'Initialize the ben_batch_utils cache...';
1303: --9999 Needed?? ben_batch_utils.ini(p_actn_cd => 'PROC_INFO');
1304: --
1305: -- Create actions if we are not doing a restart.
1306: --
1299: --
1300: --9999 Needed?? l_actn := 'Initialize the ben_batch_utils cache...';
1301: --9999 Needed?? ben_batch_utils.ini;
1302: --9999 Needed?? l_actn := 'Initialize the ben_batch_utils cache...';
1303: --9999 Needed?? ben_batch_utils.ini(p_actn_cd => 'PROC_INFO');
1304: --
1305: -- Create actions if we are not doing a restart.
1306: --
1307: l_benefit_action_id := p_benefit_action_id;
1321: Loop
1322: fetch c_pl_subj_frfs into l_pl_subj_frfs;
1323: Exit when c_pl_subj_frfs%notfound;
1324: l_cnt := l_cnt + 1;
1325: l_actn := 'Calling ben_batch_utils.comp_obj_selection_rule...';
1326: hr_utility.set_location('pl_id='||to_char(l_pl_subj_frfs.pl_id)||
1327: ' l_cnt='||to_char(l_cnt),18);
1328: --
1329: -- if comp_obj_selection_rule is pass, test rule.
1481: l_num_range := l_num_range + 1;
1482: End if;
1483: Else
1484: hr_utility.set_location('This is a RESTART',42);
1485: l_actn := 'Calling Ben_batch_utils.create_restart_person_actions...';
1486: -- 9999 What this procedure does
1487: Ben_batch_utils.create_restart_person_actions
1488: (p_benefit_action_id => p_benefit_action_id
1489: ,p_effective_date => l_effective_date
1483: Else
1484: hr_utility.set_location('This is a RESTART',42);
1485: l_actn := 'Calling Ben_batch_utils.create_restart_person_actions...';
1486: -- 9999 What this procedure does
1487: Ben_batch_utils.create_restart_person_actions
1488: (p_benefit_action_id => p_benefit_action_id
1489: ,p_effective_date => l_effective_date
1490: ,p_chunk_size => p_chunk_size
1491: ,p_threads => p_threads
1518: );
1519: --
1520: -- Store the request id of the concurrent request
1521: --
1522: ben_batch_utils.g_num_processes := ben_batch_utils.g_num_processes + 1;
1523: ben_batch_utils.g_processes_tbl(ben_batch_utils.g_num_processes)
1524: := l_request_id;
1525: End loop;
1526: Elsif (l_num_range = 0 ) then
1519: --
1520: -- Store the request id of the concurrent request
1521: --
1522: ben_batch_utils.g_num_processes := ben_batch_utils.g_num_processes + 1;
1523: ben_batch_utils.g_processes_tbl(ben_batch_utils.g_num_processes)
1524: := l_request_id;
1525: End loop;
1526: Elsif (l_num_range = 0 ) then
1527: l_actn := 'Calling Ben_batch_utils.print_parameters...';
1523: ben_batch_utils.g_processes_tbl(ben_batch_utils.g_num_processes)
1524: := l_request_id;
1525: End loop;
1526: Elsif (l_num_range = 0 ) then
1527: l_actn := 'Calling Ben_batch_utils.print_parameters...';
1528: hr_utility.set_location('Calling Ben_batch_utils.print_parameters ',56);
1529: -- 9999 Add all other required params.
1530: Ben_batch_utils.print_parameters
1531: (p_thread_id => 99
1524: := l_request_id;
1525: End loop;
1526: Elsif (l_num_range = 0 ) then
1527: l_actn := 'Calling Ben_batch_utils.print_parameters...';
1528: hr_utility.set_location('Calling Ben_batch_utils.print_parameters ',56);
1529: -- 9999 Add all other required params.
1530: Ben_batch_utils.print_parameters
1531: (p_thread_id => 99
1532: ,p_benefit_action_id => l_benefit_action_id
1526: Elsif (l_num_range = 0 ) then
1527: l_actn := 'Calling Ben_batch_utils.print_parameters...';
1528: hr_utility.set_location('Calling Ben_batch_utils.print_parameters ',56);
1529: -- 9999 Add all other required params.
1530: Ben_batch_utils.print_parameters
1531: (p_thread_id => 99
1532: ,p_benefit_action_id => l_benefit_action_id
1533: ,p_validate => p_validate
1534: ,p_business_group_id => p_business_group_id
1552: -- Because there are other processes to run, do not error if first process finds
1553: -- noone to process.
1554:
1555: -- 9999 Why this is needed.
1556: Ben_batch_utils.write(p_text =>
1557: '<< No Plans For Forfeiture were selected with above selection criteria >>' );
1558: --fnd_message.set_name('BEN','BEN_92453_NO_PREMS_TO_PROCESS');
1559: --fnd_message.raise_error;
1560: End if;
1570: ,p_thread_id => p_threads+1
1571: ,p_effective_date => p_effective_date
1572: ,p_business_group_id => p_business_group_id
1573: );
1574: l_actn := 'Calling ben_batch_utils.check_all_slaves_finished...';
1575:
1576: hr_utility.set_location('Calling ben_batch_utils.check_all_slaves_finished ',64);
1577: ben_batch_utils.check_all_slaves_finished(p_rpt_flag => TRUE);
1578: ben_batch_utils.end_process(p_benefit_action_id => l_benefit_action_id
1572: ,p_business_group_id => p_business_group_id
1573: );
1574: l_actn := 'Calling ben_batch_utils.check_all_slaves_finished...';
1575:
1576: hr_utility.set_location('Calling ben_batch_utils.check_all_slaves_finished ',64);
1577: ben_batch_utils.check_all_slaves_finished(p_rpt_flag => TRUE);
1578: ben_batch_utils.end_process(p_benefit_action_id => l_benefit_action_id
1579: ,p_person_selected => l_person_cnt
1580: ,p_business_group_id => p_business_group_id
1573: );
1574: l_actn := 'Calling ben_batch_utils.check_all_slaves_finished...';
1575:
1576: hr_utility.set_location('Calling ben_batch_utils.check_all_slaves_finished ',64);
1577: ben_batch_utils.check_all_slaves_finished(p_rpt_flag => TRUE);
1578: ben_batch_utils.end_process(p_benefit_action_id => l_benefit_action_id
1579: ,p_person_selected => l_person_cnt
1580: ,p_business_group_id => p_business_group_id
1581: ,p_non_person_cd => 'FRFS'); -- used in benrptut
1574: l_actn := 'Calling ben_batch_utils.check_all_slaves_finished...';
1575:
1576: hr_utility.set_location('Calling ben_batch_utils.check_all_slaves_finished ',64);
1577: ben_batch_utils.check_all_slaves_finished(p_rpt_flag => TRUE);
1578: ben_batch_utils.end_process(p_benefit_action_id => l_benefit_action_id
1579: ,p_person_selected => l_person_cnt
1580: ,p_business_group_id => p_business_group_id
1581: ,p_non_person_cd => 'FRFS'); -- used in benrptut
1582: end if;
1583: hr_utility.set_location ('Leaving '||l_proc,99);
1584: --
1585: Exception
1586: when others then
1587: ben_batch_utils.rpt_error(p_proc => l_proc
1588: ,p_last_actn => l_actn
1589: ,p_rpt_flag => TRUE );
1590: --
1591: benutils.write(p_text => fnd_message.get);
1592: benutils.write(p_text => sqlerrm);
1593: benutils.write(p_text => 'Big Error Occured');
1594: benutils.write_table_and_file(p_table => TRUE, p_file => TRUE);
1595: If (l_num_range > 0) then
1596: ben_batch_utils.check_all_slaves_finished(p_rpt_flag => TRUE);
1597: ben_batch_utils.end_process(p_benefit_action_id => l_benefit_action_id
1598: ,p_person_selected => l_person_cnt
1599: ,p_business_group_id => p_business_group_id
1600: ) ;
1593: benutils.write(p_text => 'Big Error Occured');
1594: benutils.write_table_and_file(p_table => TRUE, p_file => TRUE);
1595: If (l_num_range > 0) then
1596: ben_batch_utils.check_all_slaves_finished(p_rpt_flag => TRUE);
1597: ben_batch_utils.end_process(p_benefit_action_id => l_benefit_action_id
1598: ,p_person_selected => l_person_cnt
1599: ,p_business_group_id => p_business_group_id
1600: ) ;
1601: End if;
1673: dt_fndate.change_ses_date
1674: (p_ses_date => l_effective_date,
1675: p_commit => l_commit);
1676: --
1677: l_actn := 'Initialize the ben_batch_utils cache...';
1678: ben_batch_utils.ini;
1679: l_actn := 'Initialize the ben_batch_utils cache...';
1680: ben_batch_utils.ini(p_actn_cd => 'PROC_INFO');
1681: --
1674: (p_ses_date => l_effective_date,
1675: p_commit => l_commit);
1676: --
1677: l_actn := 'Initialize the ben_batch_utils cache...';
1678: ben_batch_utils.ini;
1679: l_actn := 'Initialize the ben_batch_utils cache...';
1680: ben_batch_utils.ini(p_actn_cd => 'PROC_INFO');
1681: --
1682: -- Check that all the mandatory input parameters
1675: p_commit => l_commit);
1676: --
1677: l_actn := 'Initialize the ben_batch_utils cache...';
1678: ben_batch_utils.ini;
1679: l_actn := 'Initialize the ben_batch_utils cache...';
1680: ben_batch_utils.ini(p_actn_cd => 'PROC_INFO');
1681: --
1682: -- Check that all the mandatory input parameters
1683: -- such as p_business_group_id, p_mode, p_effective_date
1676: --
1677: l_actn := 'Initialize the ben_batch_utils cache...';
1678: ben_batch_utils.ini;
1679: l_actn := 'Initialize the ben_batch_utils cache...';
1680: ben_batch_utils.ini(p_actn_cd => 'PROC_INFO');
1681: --
1682: -- Check that all the mandatory input parameters
1683: -- such as p_business_group_id, p_mode, p_effective_date
1684: --
1768: --
1769: hr_utility.set_location('p_benefit_action_id is not null',30);
1770: l_restart := TRUE;
1771: l_benefit_action_id := p_benefit_action_id;
1772: l_actn := 'Calling Ben_batch_utils.create_restart_person_actions...';
1773: Ben_batch_utils.create_restart_person_actions
1774: (p_benefit_action_id => p_benefit_action_id
1775: ,p_effective_date => l_effective_date
1776: ,p_chunk_size => l_chunk_size
1769: hr_utility.set_location('p_benefit_action_id is not null',30);
1770: l_restart := TRUE;
1771: l_benefit_action_id := p_benefit_action_id;
1772: l_actn := 'Calling Ben_batch_utils.create_restart_person_actions...';
1773: Ben_batch_utils.create_restart_person_actions
1774: (p_benefit_action_id => p_benefit_action_id
1775: ,p_effective_date => l_effective_date
1776: ,p_chunk_size => l_chunk_size
1777: ,p_threads => l_threads
1816: --
1817: submit_all_reports;
1818: --
1819: /* Uncomment after future enhancement
1820: ben_batch_utils.end_process(p_benefit_action_id => l_benefit_action_id
1821: ,p_person_selected => l_person_cnt
1822: ,p_business_group_id => p_business_group_id);
1823: */
1824: hr_utility.set_location ('Leaving '||l_proc,70);
1824: hr_utility.set_location ('Leaving '||l_proc,70);
1825: --
1826: Exception
1827: when others then
1828: ben_batch_utils.rpt_error(p_proc => l_proc
1829: ,p_last_actn => l_actn
1830: ,p_rpt_flag => TRUE );
1831: --
1832: benutils.write(p_text => fnd_message.get);
1834: benutils.write(p_text => 'Big Error Occured');
1835: benutils.write_table_and_file(p_table => TRUE, p_file => TRUE);
1836: /* 999 Temporarily commented.
1837: If (l_num_range > 0) then
1838: ben_batch_utils.check_all_slaves_finished(p_rpt_flag => TRUE);
1839: ben_batch_utils.end_process(p_benefit_action_id => l_benefit_action_id
1840: ,p_person_selected => l_person_cnt
1841: ,p_business_group_id => p_business_group_id
1842: ) ;
1835: benutils.write_table_and_file(p_table => TRUE, p_file => TRUE);
1836: /* 999 Temporarily commented.
1837: If (l_num_range > 0) then
1838: ben_batch_utils.check_all_slaves_finished(p_rpt_flag => TRUE);
1839: ben_batch_utils.end_process(p_benefit_action_id => l_benefit_action_id
1840: ,p_person_selected => l_person_cnt
1841: ,p_business_group_id => p_business_group_id
1842: ) ;
1843: End if;