69: open c1;
70: fetch c1 into l_assignment_id;
71: If c1%notfound then
72: close c1;
73: raise ben_batch_utils.g_record_error;
74: End if;
75: close c1;
76: -- Call formula initialise routine
77: --
95: Raise value_exception ;
96: End if;
97: hr_utility.set_location ('Leaving '||l_proc,10);
98: Exception
99: When ben_batch_utils.g_record_error then
100: p_return := 'N' ;
101: fnd_message.set_name('BEN','BEN_91698_NO_ASSIGNMENT_FND');
102: fnd_message.set_token('ID' ,to_char(p_person_id) );
103: fnd_message.set_token('PROC',l_proc ) ;
145: l_string varchar2(80);
146: l_actn varchar2(80);
147: begin
148: hr_utility.set_location ('Entering '||l_proc,10);
149: ben_batch_utils.write(p_text => 'Runtime Parameters');
150: ben_batch_utils.write(p_text => '------------------');
151: ben_batch_utils.write(p_text => 'Thread ID :'||to_char(p_thread_id));
152: ben_batch_utils.write(p_text => 'Validation Mode :' ||
153: hr_general.decode_lookup('YES_NO',p_validate));
146: l_actn varchar2(80);
147: begin
148: hr_utility.set_location ('Entering '||l_proc,10);
149: ben_batch_utils.write(p_text => 'Runtime Parameters');
150: ben_batch_utils.write(p_text => '------------------');
151: ben_batch_utils.write(p_text => 'Thread ID :'||to_char(p_thread_id));
152: ben_batch_utils.write(p_text => 'Validation Mode :' ||
153: hr_general.decode_lookup('YES_NO',p_validate));
154: ben_batch_utils.write(p_text => 'Benefit Action ID :' ||
147: begin
148: hr_utility.set_location ('Entering '||l_proc,10);
149: ben_batch_utils.write(p_text => 'Runtime Parameters');
150: ben_batch_utils.write(p_text => '------------------');
151: ben_batch_utils.write(p_text => 'Thread ID :'||to_char(p_thread_id));
152: ben_batch_utils.write(p_text => 'Validation Mode :' ||
153: hr_general.decode_lookup('YES_NO',p_validate));
154: ben_batch_utils.write(p_text => 'Benefit Action ID :' ||
155: to_char(p_benefit_action_id));
148: hr_utility.set_location ('Entering '||l_proc,10);
149: ben_batch_utils.write(p_text => 'Runtime Parameters');
150: ben_batch_utils.write(p_text => '------------------');
151: ben_batch_utils.write(p_text => 'Thread ID :'||to_char(p_thread_id));
152: ben_batch_utils.write(p_text => 'Validation Mode :' ||
153: hr_general.decode_lookup('YES_NO',p_validate));
154: ben_batch_utils.write(p_text => 'Benefit Action ID :' ||
155: to_char(p_benefit_action_id));
156: ben_batch_utils.write(p_text => 'Effective Date :' ||
150: ben_batch_utils.write(p_text => '------------------');
151: ben_batch_utils.write(p_text => 'Thread ID :'||to_char(p_thread_id));
152: ben_batch_utils.write(p_text => 'Validation Mode :' ||
153: hr_general.decode_lookup('YES_NO',p_validate));
154: ben_batch_utils.write(p_text => 'Benefit Action ID :' ||
155: to_char(p_benefit_action_id));
156: ben_batch_utils.write(p_text => 'Effective Date :' ||
157: to_char(p_effective_date,'DD/MM/YYYY'));
158: ben_batch_utils.write(p_text =>'Business Group ID :' || p_business_group_id);
152: ben_batch_utils.write(p_text => 'Validation Mode :' ||
153: hr_general.decode_lookup('YES_NO',p_validate));
154: ben_batch_utils.write(p_text => 'Benefit Action ID :' ||
155: to_char(p_benefit_action_id));
156: ben_batch_utils.write(p_text => 'Effective Date :' ||
157: to_char(p_effective_date,'DD/MM/YYYY'));
158: ben_batch_utils.write(p_text =>'Business Group ID :' || p_business_group_id);
159: --
160: If (nvl(p_person_selection_rule_id,-1) <> hr_api.g_number) then
154: ben_batch_utils.write(p_text => 'Benefit Action ID :' ||
155: to_char(p_benefit_action_id));
156: ben_batch_utils.write(p_text => 'Effective Date :' ||
157: to_char(p_effective_date,'DD/MM/YYYY'));
158: ben_batch_utils.write(p_text =>'Business Group ID :' || p_business_group_id);
159: --
160: If (nvl(p_person_selection_rule_id,-1) <> hr_api.g_number) then
161: ben_batch_utils.write(p_text => 'Person Selection Rule :'||
162: benutils.iftrue
157: to_char(p_effective_date,'DD/MM/YYYY'));
158: ben_batch_utils.write(p_text =>'Business Group ID :' || p_business_group_id);
159: --
160: If (nvl(p_person_selection_rule_id,-1) <> hr_api.g_number) then
161: ben_batch_utils.write(p_text => 'Person Selection Rule :'||
162: benutils.iftrue
163: (p_expression => p_person_selection_rule_id is null
164: ,p_true => 'None'
165: ,p_false => p_person_selection_rule_id));
166: End if;
167: --
168: l_actn := 'Printing p_person_id...';
169: If (nvl(p_person_id,-1) <> hr_api.g_number) then
170: ben_batch_utils.write(p_text => 'Person ID :'||
171: benutils.iftrue
172: (p_expression => p_person_id is null
173: ,p_true => 'None'
174: ,p_false => p_person_id));
176: --
177: --
178: l_actn := 'Printing p_ler_id...';
179: If (nvl(p_ler_id,-1) <> hr_api.g_number) then
180: ben_batch_utils.write(p_text => 'Ler ID :'||
181: benutils.iftrue
182: (p_expression => p_ler_id is null
183: ,p_true => 'None'
184: ,p_false => p_ler_id));
185: End if;
186: --
187: l_actn := 'Printing p_organization_id...';
188: If (nvl(p_organization_id,-1) <> hr_api.g_number) then
189: ben_batch_utils.write(p_text => 'Organization ID :'||
190: benutils.iftrue
191: (p_expression => p_organization_id is null
192: ,p_true => 'None'
193: ,p_false => p_organization_id));
194: End if;
195: --
196: l_actn := 'Printing p_benfts_grp_id...';
197: If (nvl(p_benfts_grp_id,-1) <> hr_api.g_number) then
198: ben_batch_utils.write(p_text => 'Benefits Group ID :'||
199: benutils.iftrue
200: (p_expression => p_benfts_grp_id is null
201: ,p_true => 'None'
202: ,p_false => p_benfts_grp_id));
203: End if;
204: --
205: l_actn := 'Printing p_location_id...';
206: If (nvl(p_location_id,-1) <> hr_api.g_number) then
207: ben_batch_utils.write(p_text => 'Location ID :'||
208: benutils.iftrue
209: (p_expression => p_location_id is null
210: ,p_true => 'None'
211: ,p_false => p_location_id));
212: End if;
213: --
214: l_actn := 'Printing p_legal_entity_id...';
215: If (nvl(p_legal_entity_id,-1) <> hr_api.g_number) then
216: ben_batch_utils.write(p_text => 'Legal Entity ID :'||
217: benutils.iftrue
218: (p_expression => p_legal_entity_id is null
219: ,p_true => 'None'
220: ,p_false => p_legal_entity_id));
221: End if;
222: --
223: l_actn := 'Printing p_payroll_id...';
224: If (nvl(p_payroll_id,-1) <> hr_api.g_number) then
225: ben_batch_utils.write(p_text => 'Payroll ID :'||
226: benutils.iftrue
227: (p_expression => p_payroll_id is null
228: ,p_true => 'None'
229: ,p_false => p_payroll_id));
230: End if;
231: --
232: --
233: If p_life_evt_typ_cd is not null then
234: ben_batch_utils.write(p_text => 'Life Event Type Code :' ||p_life_evt_typ_cd);
235: end if;
236: --
237: if p_from_ocrd_date is not null then
238: ben_batch_utils.write(p_text => 'From Occurred Date :' || to_char(p_from_ocrd_date, 'DD/MM/YYYY'));
234: ben_batch_utils.write(p_text => 'Life Event Type Code :' ||p_life_evt_typ_cd);
235: end if;
236: --
237: if p_from_ocrd_date is not null then
238: ben_batch_utils.write(p_text => 'From Occurred Date :' || to_char(p_from_ocrd_date, 'DD/MM/YYYY'));
239: end if;
240: --
241: ben_batch_utils.write(p_text => 'To Occurred Date :' || to_char(p_to_ocrd_date, 'DD/MM/YYYY'));
242: ben_batch_utils.write(p_text => 'Backed Out Status Code :'||p_bckt_stat_cd);
237: if p_from_ocrd_date is not null then
238: ben_batch_utils.write(p_text => 'From Occurred Date :' || to_char(p_from_ocrd_date, 'DD/MM/YYYY'));
239: end if;
240: --
241: ben_batch_utils.write(p_text => 'To Occurred Date :' || to_char(p_to_ocrd_date, 'DD/MM/YYYY'));
242: ben_batch_utils.write(p_text => 'Backed Out Status Code :'||p_bckt_stat_cd);
243: ben_batch_utils.write(p_text => 'Delete Life Events :'||
244: hr_general.decode_lookup('YES_NO',p_delete_life_evt));
245:
238: ben_batch_utils.write(p_text => 'From Occurred Date :' || to_char(p_from_ocrd_date, 'DD/MM/YYYY'));
239: end if;
240: --
241: ben_batch_utils.write(p_text => 'To Occurred Date :' || to_char(p_to_ocrd_date, 'DD/MM/YYYY'));
242: ben_batch_utils.write(p_text => 'Backed Out Status Code :'||p_bckt_stat_cd);
243: ben_batch_utils.write(p_text => 'Delete Life Events :'||
244: hr_general.decode_lookup('YES_NO',p_delete_life_evt));
245:
246: If (nvl(p_audit_log,'xxxx') <> hr_api.g_varchar2) then
239: end if;
240: --
241: ben_batch_utils.write(p_text => 'To Occurred Date :' || to_char(p_to_ocrd_date, 'DD/MM/YYYY'));
242: ben_batch_utils.write(p_text => 'Backed Out Status Code :'||p_bckt_stat_cd);
243: ben_batch_utils.write(p_text => 'Delete Life Events :'||
244: hr_general.decode_lookup('YES_NO',p_delete_life_evt));
245:
246: If (nvl(p_audit_log,'xxxx') <> hr_api.g_varchar2) then
247: ben_batch_utils.write(p_text => 'Audit log flag :'||
243: ben_batch_utils.write(p_text => 'Delete Life Events :'||
244: hr_general.decode_lookup('YES_NO',p_delete_life_evt));
245:
246: If (nvl(p_audit_log,'xxxx') <> hr_api.g_varchar2) then
247: ben_batch_utils.write(p_text => 'Audit log flag :'||
248: hr_general.decode_lookup('YES_NO',p_audit_log));
249: End if;
250: hr_utility.set_location ('Leaving '||l_proc,10);
251: exception
249: End if;
250: hr_utility.set_location ('Leaving '||l_proc,10);
251: exception
252: when others then
253: ben_batch_utils.rpt_error(p_proc => l_proc
254: ,p_last_actn => l_actn );
255: raise;
256: end print_parameters;
257: --
386: dt_fndate.change_ses_date
387: (p_ses_date => l_effective_date,
388: p_commit => l_commit);
389:
390: ben_batch_utils.ini(p_actn_cd => 'PROC_INFO');
391: --
392: -- Get the parameters defined for the batch process.
393: --
394: benutils.get_parameter
463: ,p_err_message => l_err_message );
464:
465: if l_err_message is not null
466: then
467: Ben_batch_utils.write(p_text =>
468: '<< Person id : '||to_char(l_rec.person_id)||' failed.'||
469: ' Reason : '|| l_err_message ||' >>' );
470: end if ;
471: --
560: l_benefit_action_id := p_benefit_action_id;
561: --
562: hr_utility.set_location('Restarting for benefit action id : ' ||
563: to_char(l_benefit_action_id), 10);
564: ben_batch_utils.create_restart_person_actions
565: (p_benefit_action_id => p_benefit_action_id
566: ,p_effective_date => l_effective_date
567: ,p_chunk_size => l_chunk_size
568: ,p_threads => l_threads
620: );
621: --
622: -- Store the request id of the concurrent request
623: --
624: ben_batch_utils.g_num_processes := ben_batch_utils.g_num_processes + 1;
625: ben_batch_utils.g_processes_tbl(ben_batch_utils.g_num_processes)
626: := l_request_id;
627: commit;
628: --
621: --
622: -- Store the request id of the concurrent request
623: --
624: ben_batch_utils.g_num_processes := ben_batch_utils.g_num_processes + 1;
625: ben_batch_utils.g_processes_tbl(ben_batch_utils.g_num_processes)
626: := l_request_id;
627: commit;
628: --
629: end loop;
641: ,p_person_id => p_person_id
642: ,p_person_selection_rule_id => p_person_selection_rl
643: );
644: --
645: ben_batch_utils.write(p_text =>
646: 'No person got selected with above selection criteria.');
647: --
648: fnd_message.set_name('BEN','BEN_91769_NOONE_TO_PROCESS');
649: fnd_message.set_token('PROC',l_proc);
677: );
678: --
679: -- Check if all the slave processes are finished.
680: --
681: ben_batch_utils.check_all_slaves_finished(p_rpt_flag => TRUE);
682: --
683: --
684: benutils.write(p_text => benutils.g_banner_minus);
685: if p_delete_ptnl_life_evt = 'Y' and p_delete_life_evt = 'Y'
692: and (p_person_id is null or person_id = p_person_id);
693:
694: -- end if;
695: --
696: ben_batch_utils.write(p_text => ' No. of Voided Potentials Deleted = ' || sql%rowcount );
697: elsif p_delete_ptnl_life_evt = 'Y' and p_delete_life_evt = 'N'
698: then
699: If p_person_id is not null then
700: delete from ben_ptnl_ler_for_per p
712: from ben_per_in_ler pil
713: where pil.PTNL_LER_FOR_PER_ID = p.PTNL_LER_FOR_PER_ID);
714: end if;
715: --
716: ben_batch_utils.write(p_text => ' No. of Voided Potentials Deleted = ' || sql%rowcount );
717: --
718: end if;
719: --
720: benutils.write(p_text => benutils.g_banner_minus);
735: where p.per_in_ler_id = t.per_in_ler_id );
736: --
737: -- End the process.
738: --
739: ben_batch_utils.end_process
740: (p_benefit_action_id => l_benefit_action_id
741: ,p_person_selected => l_person_actn_cnt
742: ,p_business_group_id => p_business_group_id);
743: --
748: exception
749: --
750: when others then
751: --
752: ben_batch_utils.rpt_error(p_proc => l_proc
753: ,p_last_actn => l_actn
754: ,p_rpt_flag => TRUE);
755: --
756: benutils.write(p_text => fnd_message.get);
758: benutils.write_table_and_file(p_table => TRUE, p_file => TRUE);
759: --
760: if l_num_ranges > 0 then
761: --
762: ben_batch_utils.check_all_slaves_finished(p_rpt_flag => TRUE);
763: --
764: ben_batch_utils.end_process(p_benefit_action_id => l_benefit_action_id
765: ,p_person_selected => l_person_actn_cnt
766: ,p_business_group_id => p_business_group_id);
760: if l_num_ranges > 0 then
761: --
762: ben_batch_utils.check_all_slaves_finished(p_rpt_flag => TRUE);
763: --
764: ben_batch_utils.end_process(p_benefit_action_id => l_benefit_action_id
765: ,p_person_selected => l_person_actn_cnt
766: ,p_business_group_id => p_business_group_id);
767: --
768: --submit_all_reports(p_audit_log => 'N');
922: g_per_in_ler_rows := 0;
923: g_ptnl_ler_rows := 0;
924: g_le_clsn_rows := 0;
925: --
926: ben_batch_utils.ini;
927: --
928: benutils.g_benefit_action_id := p_benefit_action_id;
929: benutils.g_thread_id := p_thread_id;
930: --
1126: --
1127: commit;
1128: --
1129: --
1130: ben_batch_utils.write_logfile(p_num_pers_processed => g_persons_procd
1131: ,p_num_pers_errored => g_persons_errored);
1132: --
1133: hr_utility.set_location ('Leaving '||l_proc,70);
1134: --
1140: benutils.write(p_text => sqlerrm);
1141: --
1142: hr_utility.set_location('BENPRBCK Super Error ' || l_proc, 10);
1143: --
1144: ben_batch_utils.rpt_error(p_proc => l_proc
1145: ,p_last_actn => l_actn
1146: ,p_rpt_flag => TRUE);
1147: --
1148: ben_batch_utils.write_logfile(p_num_pers_processed => g_persons_procd
1144: ben_batch_utils.rpt_error(p_proc => l_proc
1145: ,p_last_actn => l_actn
1146: ,p_rpt_flag => TRUE);
1147: --
1148: ben_batch_utils.write_logfile(p_num_pers_processed => g_persons_procd
1149: ,p_num_pers_errored => g_persons_errored);
1150: --
1151: benutils.write_table_and_file(p_table => TRUE, p_file => TRUE);
1152: --