93: g_persons_passed number(9) := 0;
94: g_persons_errored number(9) := 0;
95: g_max_errors_allowed number(9) := 200;
96: g_rec ben_type.g_report_rec;
97: g_debug boolean := hr_utility.debug_enabled;
98: --
99: /*
100: procedure backout_heirarchy_data
101: (p_per_in_ler_id in number
107: --
108: l_proc varchar2(50) := g_package||'.cwb_delete_routine';
109: begin
110: --
111: hr_utility.set_location( 'Entering '|| l_proc, 5);
112: --
113: -- Delete heirarchy data : bug 4021004
114: --
115: delete from ben_cwb_group_hrchy hrc
128: null;
129: end;
130: end loop;
131: --
132: hr_utility.set_location( 'Leaving '||l_proc, 50);
133: --
134: end backout_heirarchy_data;
135: */
136: --
145: --
146: l_proc varchar2(50) := g_package||'.cwb_delete_routine';
147: begin
148: --
149: hr_utility.set_location( 'Entering '|| l_proc, 5);
150: --
151: -- Delete heirarchy data : bug 4021004
152: --
153: delete from ben_cwb_group_hrchy hrc
171: null;
172: end;
173: end loop;
174: --
175: hr_utility.set_location( 'Leaving '||l_proc, 50);
176: --
177: end backout_heirarchy_data;
178: --
179: -- ----------------------------------------------------------------------------
218: p_del_future_end_date => l_del_future_end_date,
219: p_del_next_start_date => l_del_next_start_date,
220: p_del_next_end_date => l_del_next_end_date);*/
221: --
222: hr_utility.set_location('l_zap_start_date = ' || l_zap_start_date, 12);
223: hr_utility.set_location('l_zap_end_date = ' || l_zap_end_date, 12);
224: hr_utility.set_location('l_delete_start_date = ' || l_delete_start_date, 12);
225: hr_utility.set_location('l_delete_end_date = ' || l_delete_end_date, 12);
226: hr_utility.set_location('l_del_future_start_date = ' || l_del_future_start_date, 12);
219: p_del_next_start_date => l_del_next_start_date,
220: p_del_next_end_date => l_del_next_end_date);*/
221: --
222: hr_utility.set_location('l_zap_start_date = ' || l_zap_start_date, 12);
223: hr_utility.set_location('l_zap_end_date = ' || l_zap_end_date, 12);
224: hr_utility.set_location('l_delete_start_date = ' || l_delete_start_date, 12);
225: hr_utility.set_location('l_delete_end_date = ' || l_delete_end_date, 12);
226: hr_utility.set_location('l_del_future_start_date = ' || l_del_future_start_date, 12);
227: hr_utility.set_location('l_del_future_end_date = ' || l_del_future_end_date, 12);
220: p_del_next_end_date => l_del_next_end_date);*/
221: --
222: hr_utility.set_location('l_zap_start_date = ' || l_zap_start_date, 12);
223: hr_utility.set_location('l_zap_end_date = ' || l_zap_end_date, 12);
224: hr_utility.set_location('l_delete_start_date = ' || l_delete_start_date, 12);
225: hr_utility.set_location('l_delete_end_date = ' || l_delete_end_date, 12);
226: hr_utility.set_location('l_del_future_start_date = ' || l_del_future_start_date, 12);
227: hr_utility.set_location('l_del_future_end_date = ' || l_del_future_end_date, 12);
228: hr_utility.set_location('l_del_next_start_date = ' || l_del_next_start_date, 12);
221: --
222: hr_utility.set_location('l_zap_start_date = ' || l_zap_start_date, 12);
223: hr_utility.set_location('l_zap_end_date = ' || l_zap_end_date, 12);
224: hr_utility.set_location('l_delete_start_date = ' || l_delete_start_date, 12);
225: hr_utility.set_location('l_delete_end_date = ' || l_delete_end_date, 12);
226: hr_utility.set_location('l_del_future_start_date = ' || l_del_future_start_date, 12);
227: hr_utility.set_location('l_del_future_end_date = ' || l_del_future_end_date, 12);
228: hr_utility.set_location('l_del_next_start_date = ' || l_del_next_start_date, 12);
229: hr_utility.set_location('l_del_next_end_date = ' || l_del_next_end_date, 12);
222: hr_utility.set_location('l_zap_start_date = ' || l_zap_start_date, 12);
223: hr_utility.set_location('l_zap_end_date = ' || l_zap_end_date, 12);
224: hr_utility.set_location('l_delete_start_date = ' || l_delete_start_date, 12);
225: hr_utility.set_location('l_delete_end_date = ' || l_delete_end_date, 12);
226: hr_utility.set_location('l_del_future_start_date = ' || l_del_future_start_date, 12);
227: hr_utility.set_location('l_del_future_end_date = ' || l_del_future_end_date, 12);
228: hr_utility.set_location('l_del_next_start_date = ' || l_del_next_start_date, 12);
229: hr_utility.set_location('l_del_next_end_date = ' || l_del_next_end_date, 12);
230:
223: hr_utility.set_location('l_zap_end_date = ' || l_zap_end_date, 12);
224: hr_utility.set_location('l_delete_start_date = ' || l_delete_start_date, 12);
225: hr_utility.set_location('l_delete_end_date = ' || l_delete_end_date, 12);
226: hr_utility.set_location('l_del_future_start_date = ' || l_del_future_start_date, 12);
227: hr_utility.set_location('l_del_future_end_date = ' || l_del_future_end_date, 12);
228: hr_utility.set_location('l_del_next_start_date = ' || l_del_next_start_date, 12);
229: hr_utility.set_location('l_del_next_end_date = ' || l_del_next_end_date, 12);
230:
231: if l_zap_mode then
224: hr_utility.set_location('l_delete_start_date = ' || l_delete_start_date, 12);
225: hr_utility.set_location('l_delete_end_date = ' || l_delete_end_date, 12);
226: hr_utility.set_location('l_del_future_start_date = ' || l_del_future_start_date, 12);
227: hr_utility.set_location('l_del_future_end_date = ' || l_del_future_end_date, 12);
228: hr_utility.set_location('l_del_next_start_date = ' || l_del_next_start_date, 12);
229: hr_utility.set_location('l_del_next_end_date = ' || l_del_next_end_date, 12);
230:
231: if l_zap_mode then
232: hr_utility.set_location('l_zap true', 13);
225: hr_utility.set_location('l_delete_end_date = ' || l_delete_end_date, 12);
226: hr_utility.set_location('l_del_future_start_date = ' || l_del_future_start_date, 12);
227: hr_utility.set_location('l_del_future_end_date = ' || l_del_future_end_date, 12);
228: hr_utility.set_location('l_del_next_start_date = ' || l_del_next_start_date, 12);
229: hr_utility.set_location('l_del_next_end_date = ' || l_del_next_end_date, 12);
230:
231: if l_zap_mode then
232: hr_utility.set_location('l_zap true', 13);
233: end if;
228: hr_utility.set_location('l_del_next_start_date = ' || l_del_next_start_date, 12);
229: hr_utility.set_location('l_del_next_end_date = ' || l_del_next_end_date, 12);
230:
231: if l_zap_mode then
232: hr_utility.set_location('l_zap true', 13);
233: end if;
234: if l_delete_mode then
235: hr_utility.set_location('l_delete_mode true', 13);
236: end if;
231: if l_zap_mode then
232: hr_utility.set_location('l_zap true', 13);
233: end if;
234: if l_delete_mode then
235: hr_utility.set_location('l_delete_mode true', 13);
236: end if;
237: if l_future_change_mode then
238: hr_utility.set_location('l_future_change_mode true', 13);
239: end if;
234: if l_delete_mode then
235: hr_utility.set_location('l_delete_mode true', 13);
236: end if;
237: if l_future_change_mode then
238: hr_utility.set_location('l_future_change_mode true', 13);
239: end if;
240: if l_delete_next_change_mode then
241: hr_utility.set_location('l_delete_next_change_mode true', 13);
242: end if;
237: if l_future_change_mode then
238: hr_utility.set_location('l_future_change_mode true', 13);
239: end if;
240: if l_delete_next_change_mode then
241: hr_utility.set_location('l_delete_next_change_mode true', 13);
242: end if;
243: if l_delete_next_change_mode = true or l_future_change_mode = true then
244: l_del_mode := hr_api.g_future_change;
245: else
358: order by pee.effective_start_date ;
359: --
360: begin
361: --
362: g_debug := hr_utility.debug_enabled;
363: if g_debug then
364: hr_utility.set_location('Entering :'||l_proc,5);
365: hr_utility.set_location('Element_link_id='||to_char(p_element_link_id),6);
366: hr_utility.set_location('p_element_entry_value_id='||to_char(p_element_entry_value_id),6);
360: begin
361: --
362: g_debug := hr_utility.debug_enabled;
363: if g_debug then
364: hr_utility.set_location('Entering :'||l_proc,5);
365: hr_utility.set_location('Element_link_id='||to_char(p_element_link_id),6);
366: hr_utility.set_location('p_element_entry_value_id='||to_char(p_element_entry_value_id),6);
367: hr_utility.set_location('Effective_date='||to_char(p_effective_date),6);
368: hr_utility.set_location('p_rt_end_date='||to_char(p_rt_end_date),6);
361: --
362: g_debug := hr_utility.debug_enabled;
363: if g_debug then
364: hr_utility.set_location('Entering :'||l_proc,5);
365: hr_utility.set_location('Element_link_id='||to_char(p_element_link_id),6);
366: hr_utility.set_location('p_element_entry_value_id='||to_char(p_element_entry_value_id),6);
367: hr_utility.set_location('Effective_date='||to_char(p_effective_date),6);
368: hr_utility.set_location('p_rt_end_date='||to_char(p_rt_end_date),6);
369: end if;
362: g_debug := hr_utility.debug_enabled;
363: if g_debug then
364: hr_utility.set_location('Entering :'||l_proc,5);
365: hr_utility.set_location('Element_link_id='||to_char(p_element_link_id),6);
366: hr_utility.set_location('p_element_entry_value_id='||to_char(p_element_entry_value_id),6);
367: hr_utility.set_location('Effective_date='||to_char(p_effective_date),6);
368: hr_utility.set_location('p_rt_end_date='||to_char(p_rt_end_date),6);
369: end if;
370: --
363: if g_debug then
364: hr_utility.set_location('Entering :'||l_proc,5);
365: hr_utility.set_location('Element_link_id='||to_char(p_element_link_id),6);
366: hr_utility.set_location('p_element_entry_value_id='||to_char(p_element_entry_value_id),6);
367: hr_utility.set_location('Effective_date='||to_char(p_effective_date),6);
368: hr_utility.set_location('p_rt_end_date='||to_char(p_rt_end_date),6);
369: end if;
370: --
371: -- After discussing with CWB team decide to go with simple approach.
364: hr_utility.set_location('Entering :'||l_proc,5);
365: hr_utility.set_location('Element_link_id='||to_char(p_element_link_id),6);
366: hr_utility.set_location('p_element_entry_value_id='||to_char(p_element_entry_value_id),6);
367: hr_utility.set_location('Effective_date='||to_char(p_effective_date),6);
368: hr_utility.set_location('p_rt_end_date='||to_char(p_rt_end_date),6);
369: end if;
370: --
371: -- After discussing with CWB team decide to go with simple approach.
372: -- Issues to consider
383: --
384: -- if no element entry was created to start with, return
385: --
386: if p_element_entry_value_id is null then
387: hr_utility.set_location('no element entry '||l_proc,7);
388: hr_utility.set_location('Leaving: '||l_proc,7);
389: return;
390: end if;
391: --
384: -- if no element entry was created to start with, return
385: --
386: if p_element_entry_value_id is null then
387: hr_utility.set_location('no element entry '||l_proc,7);
388: hr_utility.set_location('Leaving: '||l_proc,7);
389: return;
390: end if;
391: --
392: -- find the element type and input value based on element_entry_value_id
406: --
407: -- entry_value_id attached to prtt rt does not exist. This is possible
408: -- prior to FP C when ct. could delete the entries
409: --
410: hr_utility.set_location('Leaving: '||l_proc,7);
411: end if;
412: return;
413: end if;
414: close c_ele_info;
415: --
416: l_effective_date := p_effective_date;
417: --
418: if g_debug then
419: hr_utility.set_location('ele type='||l_element_type_id,7);
420: hr_utility.set_location('inp val='||l_input_value_id,7);
421: hr_utility.set_location('l_effective_date='||l_effective_date,7);
422: end if;
423: --
416: l_effective_date := p_effective_date;
417: --
418: if g_debug then
419: hr_utility.set_location('ele type='||l_element_type_id,7);
420: hr_utility.set_location('inp val='||l_input_value_id,7);
421: hr_utility.set_location('l_effective_date='||l_effective_date,7);
422: end if;
423: --
424: -- find the element entry that needs to be deleted.
417: --
418: if g_debug then
419: hr_utility.set_location('ele type='||l_element_type_id,7);
420: hr_utility.set_location('inp val='||l_input_value_id,7);
421: hr_utility.set_location('l_effective_date='||l_effective_date,7);
422: end if;
423: --
424: -- find the element entry that needs to be deleted.
425: --
443: if get_element_entry_id%notfound then
444: close get_element_entry_id;
445: if g_debug then
446: -- element entry already ended.
447: hr_utility.set_location('element entry already ended',8);
448: hr_utility.set_location('Leaving: '||l_proc,7);
449: end if;
450:
451: -- 9999 is it needed.
444: close get_element_entry_id;
445: if g_debug then
446: -- element entry already ended.
447: hr_utility.set_location('element entry already ended',8);
448: hr_utility.set_location('Leaving: '||l_proc,7);
449: end if;
450:
451: -- 9999 is it needed.
452: ben_warnings.load_warning
469: if g_debug then
470: --
471: -- Could delete the entries
472: --
473: hr_utility.set_location('Leaving: '||l_proc,8);
474: --
475: end if;
476: --
477: return;
500: end if;
501: end if;
502: --
503:
504: hr_utility.set_location('l_dt_delete_mode = ' || l_dt_delete_mode, 9);
505: hr_utility.set_location('l_element_entry_id = ' || l_element_entry_id, 9);
506: hr_utility.set_location('l_processing_type = ' || l_processing_type, 9);
507: --
508: -- If procesing type id Non Recussring then zap the element entry.
501: end if;
502: --
503:
504: hr_utility.set_location('l_dt_delete_mode = ' || l_dt_delete_mode, 9);
505: hr_utility.set_location('l_element_entry_id = ' || l_element_entry_id, 9);
506: hr_utility.set_location('l_processing_type = ' || l_processing_type, 9);
507: --
508: -- If procesing type id Non Recussring then zap the element entry.
509: -- If it is recurring then check whether the min effective_start date
502: --
503:
504: hr_utility.set_location('l_dt_delete_mode = ' || l_dt_delete_mode, 9);
505: hr_utility.set_location('l_element_entry_id = ' || l_element_entry_id, 9);
506: hr_utility.set_location('l_processing_type = ' || l_processing_type, 9);
507: --
508: -- If procesing type id Non Recussring then zap the element entry.
509: -- If it is recurring then check whether the min effective_start date
510: -- less than the p_effective date, if so then do a future change, otherwise
520: ,p_effective_end_date => l_effective_end_date
521: ,p_delete_warning => l_delete_warning);
522: --
523: if g_debug then
524: hr_utility.set_location('Leaving :'||l_proc,5);
525: end if;
526: --
527: end backout_cwb_element;
528: --
558: l_retcode number;
559: --
560: Begin
561: --
562: hr_utility.set_location ('Entering '||l_proc,10);
563: --
564: -- get the parameters for a previous run and do a restart
565: --
566: open c_parameters;
591: ,p_group_pl_id => l_parameters.pl_id
592: ,p_person_selection_rule_id => l_parameters.person_selection_rl
593: ,p_debug_messages => l_parameters.debug_messages_flag);
594: --
595: hr_utility.set_location ('Leaving '||l_proc,70);
596: --
597: end restart;
598: --
599:
723: order by effective_start_date desc;
724: --
725: Begin
726: --
727: hr_utility.set_location ('Entering '||l_proc,10);
728: --
729: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
730: fnd_message.set_token('PROC','dt_fndate.change_ses_date');
731: dt_fndate.change_ses_date
742: ,p_threads => l_threads
743: ,p_chunk_size => l_chunk_size
744: ,p_max_errors => g_max_errors_allowed);
745: --
746: hr_utility.set_location ('l_threads '||l_threads,10);
747: hr_utility.set_location ('l_chunk_size '||l_chunk_size,10);
748: --
749: --
750: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
743: ,p_chunk_size => l_chunk_size
744: ,p_max_errors => g_max_errors_allowed);
745: --
746: hr_utility.set_location ('l_threads '||l_threads,10);
747: hr_utility.set_location ('l_chunk_size '||l_chunk_size,10);
748: --
749: --
750: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
751: fnd_message.set_token('PROC','ben_env_object.init');
795: -- 3) Put each row into the person cache.
796: -- 4) Process the person cache
797: -- 5) Go to number 1 again.
798: --
799: hr_utility.set_location('getting range',10);
800: --
801: Loop
802: --
803: open c_range_thread;
804: --
805: fetch c_range_thread into l_range_id
806: ,l_start_person_action_id
807: ,l_end_person_action_id;
808: hr_utility.set_location('doing range fetch',10);
809: --
810: if c_range_thread%notfound then
811: --
812: hr_utility.set_location('range not Found',10);
808: hr_utility.set_location('doing range fetch',10);
809: --
810: if c_range_thread%notfound then
811: --
812: hr_utility.set_location('range not Found',10);
813: --
814: close c_range_thread;
815: exit;
816: --
815: exit;
816: --
817: end if;
818: --
819: hr_utility.set_location('range Found',10);
820: --
821: close c_range_thread;
822: --
823: update ben_batch_ranges ran
833: loop
834: --
835: fetch c_person_thread into l_person_id,
836: l_person_action_id;
837: hr_utility.set_location('person id'||l_person_id,10);
838: --
839: exit when c_person_thread%notfound;
840: --
841: savepoint last_place;
861: close c_person;
862: --
863: begin
864: --
865: hr_utility.set_location('Before open',10);
866: open c_ler_thread;
867: --
868: Loop
869: --
869: --
870: fetch c_ler_thread into l_ler_thread;
871: exit when c_ler_thread%notfound;
872: --
873: hr_utility.set_location ('per_in_ler_id '||l_ler_thread.per_in_ler_id,10);
874: hr_utility.set_location ('typ_cd '||l_ler_thread.typ_cd,10);
875: hr_utility.set_location ('bg id '||l_ler_thread.business_group_id,10);
876: --
877: --
870: fetch c_ler_thread into l_ler_thread;
871: exit when c_ler_thread%notfound;
872: --
873: hr_utility.set_location ('per_in_ler_id '||l_ler_thread.per_in_ler_id,10);
874: hr_utility.set_location ('typ_cd '||l_ler_thread.typ_cd,10);
875: hr_utility.set_location ('bg id '||l_ler_thread.business_group_id,10);
876: --
877: --
878: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
871: exit when c_ler_thread%notfound;
872: --
873: hr_utility.set_location ('per_in_ler_id '||l_ler_thread.per_in_ler_id,10);
874: hr_utility.set_location ('typ_cd '||l_ler_thread.typ_cd,10);
875: hr_utility.set_location ('bg id '||l_ler_thread.business_group_id,10);
876: --
877: --
878: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
879: fnd_message.set_token('PROC','ben_back_out_life_event');
876: --
877: --
878: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
879: fnd_message.set_token('PROC','ben_back_out_life_event');
880: hr_utility.set_location ('calling bolfe ',10);
881: ben_back_out_life_event.g_enrt_made_flag := Null;
882: ben_back_out_life_event.back_out_life_events
883: (p_per_in_ler_id => l_ler_thread.per_in_ler_id
884: ,p_business_group_id => l_ler_thread.business_group_id
891: --
892: -- Check if the current pil is the group pil. If so, call
893: -- delete_cwb_data.
894: --
895: hr_utility.set_location ('this ler is '||l_ler_thread.per_in_ler_id||
896: 'group pil is '||p_life_event_id,777);
897: --
898: -- Bug 3517726 : CWB data is not getting deleted.
899: hr_utility.set_location ('calling delete_cwb_data',10);
895: hr_utility.set_location ('this ler is '||l_ler_thread.per_in_ler_id||
896: 'group pil is '||p_life_event_id,777);
897: --
898: -- Bug 3517726 : CWB data is not getting deleted.
899: hr_utility.set_location ('calling delete_cwb_data',10);
900: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
901: fnd_message.set_token('PROC','delete_cwb_data');
902: delete_cwb_data
903: (p_per_in_ler_id => l_ler_thread.per_in_ler_id
948: exception
949: --
950: when others then
951: --
952: hr_utility.set_location('Super Error exception level',10);
953: hr_utility.set_location(sqlerrm,10);
954:
955: if c_latest_ler_cwb%isopen then
956:
949: --
950: when others then
951: --
952: hr_utility.set_location('Super Error exception level',10);
953: hr_utility.set_location(sqlerrm,10);
954:
955: if c_latest_ler_cwb%isopen then
956:
957: close c_latest_ler_cwb;
984: g_rec.national_identifier := l_per_rec.national_identifier;
985: g_rec.error_message_code := benutils.get_message_name;
986: g_rec.text := fnd_message.get;
987:
988: hr_utility.set_location('Error Message '||g_rec.text,10);
989: benutils.write(l_per_rec.full_name||' processed unsuccessfully');
990: benutils.write(g_rec.text);
991: benutils.write(p_rec => g_rec);
992: --
989: benutils.write(l_per_rec.full_name||' processed unsuccessfully');
990: benutils.write(g_rec.text);
991: benutils.write(p_rec => g_rec);
992: --
993: hr_utility.set_location('Max Errors = '||g_max_errors_allowed,10);
994: hr_utility.set_location('Num Errors = '||g_persons_errored,10);
995: if g_persons_errored > g_max_errors_allowed then
996: --
997: fnd_message.set_name('BEN','BEN_92431_BENBOCON_ERROR_LIMIT');
990: benutils.write(g_rec.text);
991: benutils.write(p_rec => g_rec);
992: --
993: hr_utility.set_location('Max Errors = '||g_max_errors_allowed,10);
994: hr_utility.set_location('Num Errors = '||g_persons_errored,10);
995: if g_persons_errored > g_max_errors_allowed then
996: --
997: fnd_message.set_name('BEN','BEN_92431_BENBOCON_ERROR_LIMIT');
998: benutils.write(p_text => fnd_message.get);
1002: end if;
1003: --
1004: end;
1005: --
1006: hr_utility.set_location('Closing c_person_thread',10);
1007: --
1008: end loop;
1009: --
1010: close c_person_thread;
1012: -- Commit chunk
1013: --
1014: if p_validate = 'Y' then
1015: --
1016: hr_utility.set_location('Rolling back transaction ',10);
1017: --
1018: rollback;
1019: --
1020: end if;
1032: ,p_num_pers_errored => g_persons_errored);
1033: --
1034: commit;
1035: --
1036: hr_utility.set_location ('Leaving '||l_proc,70);
1037: --
1038: Exception
1039: --
1040: When others then
1038: Exception
1039: --
1040: When others then
1041: --
1042: hr_utility.set_location('Super Error',10);
1043: hr_utility.set_location(sqlerrm,10);
1044: hr_utility.set_location('Super Error',10);
1045: rollback;
1046: benutils.rollback_cache;
1039: --
1040: When others then
1041: --
1042: hr_utility.set_location('Super Error',10);
1043: hr_utility.set_location(sqlerrm,10);
1044: hr_utility.set_location('Super Error',10);
1045: rollback;
1046: benutils.rollback_cache;
1047: --
1040: When others then
1041: --
1042: hr_utility.set_location('Super Error',10);
1043: hr_utility.set_location(sqlerrm,10);
1044: hr_utility.set_location('Super Error',10);
1045: rollback;
1046: benutils.rollback_cache;
1047: --
1048: g_rec.ler_id := nvl(p_life_event_id,l_ler_thread.ler_id);
1207: l_head number := 0 ;
1208:
1209: begin
1210: --
1211: hr_utility.set_location ('Entering '||l_proc,10);
1212: --
1213:
1214: hr_utility.set_location ('p_business_group_id '||p_business_group_id,10);
1215: hr_utility.set_location ('p_life_event_id '||p_life_event_id,10);
1210: --
1211: hr_utility.set_location ('Entering '||l_proc,10);
1212: --
1213:
1214: hr_utility.set_location ('p_business_group_id '||p_business_group_id,10);
1215: hr_utility.set_location ('p_life_event_id '||p_life_event_id,10);
1216: hr_utility.set_location ('p_ocrd_date '||p_ocrd_date,10);
1217: hr_utility.set_location ('p_group_pl_id '||p_group_pl_id,10);
1218: hr_utility.set_location ('p_person_selection_rule_id '||p_person_selection_rule_id,10);
1211: hr_utility.set_location ('Entering '||l_proc,10);
1212: --
1213:
1214: hr_utility.set_location ('p_business_group_id '||p_business_group_id,10);
1215: hr_utility.set_location ('p_life_event_id '||p_life_event_id,10);
1216: hr_utility.set_location ('p_ocrd_date '||p_ocrd_date,10);
1217: hr_utility.set_location ('p_group_pl_id '||p_group_pl_id,10);
1218: hr_utility.set_location ('p_person_selection_rule_id '||p_person_selection_rule_id,10);
1219: --
1212: --
1213:
1214: hr_utility.set_location ('p_business_group_id '||p_business_group_id,10);
1215: hr_utility.set_location ('p_life_event_id '||p_life_event_id,10);
1216: hr_utility.set_location ('p_ocrd_date '||p_ocrd_date,10);
1217: hr_utility.set_location ('p_group_pl_id '||p_group_pl_id,10);
1218: hr_utility.set_location ('p_person_selection_rule_id '||p_person_selection_rule_id,10);
1219: --
1220:
1213:
1214: hr_utility.set_location ('p_business_group_id '||p_business_group_id,10);
1215: hr_utility.set_location ('p_life_event_id '||p_life_event_id,10);
1216: hr_utility.set_location ('p_ocrd_date '||p_ocrd_date,10);
1217: hr_utility.set_location ('p_group_pl_id '||p_group_pl_id,10);
1218: hr_utility.set_location ('p_person_selection_rule_id '||p_person_selection_rule_id,10);
1219: --
1220:
1221: --
1214: hr_utility.set_location ('p_business_group_id '||p_business_group_id,10);
1215: hr_utility.set_location ('p_life_event_id '||p_life_event_id,10);
1216: hr_utility.set_location ('p_ocrd_date '||p_ocrd_date,10);
1217: hr_utility.set_location ('p_group_pl_id '||p_group_pl_id,10);
1218: hr_utility.set_location ('p_person_selection_rule_id '||p_person_selection_rule_id,10);
1219: --
1220:
1221: --
1222: l_effective_date:=trunc(fnd_date.canonical_to_date(p_effective_date));
1284: ,p_uneai_effective_date => null);
1285: --
1286: benutils.g_benefit_action_id := l_benefit_action_id;
1287: --
1288: hr_utility.set_location ('l_benefit_action_id created is '||l_benefit_action_id,30);
1289: -- Delete/clear ranges from ben_batch_ranges table
1290: --
1291: Delete from ben_batch_ranges
1292: Where benefit_action_id = l_benefit_action_id;
1302: loop
1303: --
1304: l_person_selection := null;
1305: fetch c_person into l_person_id, l_business_group_id;
1306: hr_utility.set_location ('next person selected is '||l_person_id,30);
1307: exit when c_person%notfound;
1308: --
1309: l_cnt := l_cnt + 1;
1310: --
1352: -- Store person_id into person actions table.
1353: --
1354: If l_person_ok = 'Y' then
1355: --
1356: hr_utility.set_location ('person passed selection rule '||l_person_id,35);
1357: Ben_person_actions_api.create_person_actions
1358: (p_validate => false
1359: ,p_person_action_id => l_person_action_id
1360: ,p_person_id => l_person_id
1364: ,p_chunk_number => l_chunk_num
1365: ,p_object_version_number => l_object_version_number
1366: ,p_effective_date => l_effective_date);
1367: --
1368: hr_utility.set_location ('person action created is '||l_person_action_id,40);
1369: --
1370: l_num_row := l_num_row + 1;
1371: l_person_cnt := l_person_cnt + 1;
1372: l_end_person_action_id := l_person_action_id;
1390: ,p_ending_person_action_id => l_end_person_action_id
1391: ,p_object_version_number => l_object_version_number
1392: ,p_effective_date => l_effective_date);
1393: --
1394: hr_utility.set_location ('person action range created is '||l_range_id,45);
1395: --
1396: l_start_person_action_id := 0;
1397: l_end_person_action_id := 0;
1398: l_num_row := 0;
1406: --
1407: close c_person;
1408: --
1409: --
1410: hr_utility.set_location('l_num_row='||to_char(l_num_row),48);
1411: --
1412: If l_num_row <> 0 then
1413: --
1414: Ben_batch_ranges_api.create_batch_ranges
1422: ,p_effective_date => l_effective_date);
1423: --
1424: l_num_range := l_num_range + 1;
1425: --
1426: hr_utility.set_location('l_num_row='||to_char(l_num_row),50);
1427: hr_utility.set_location ('person action range created is '||l_range_id,55);
1428: --
1429: End if;
1430: --
1423: --
1424: l_num_range := l_num_range + 1;
1425: --
1426: hr_utility.set_location('l_num_row='||to_char(l_num_row),50);
1427: hr_utility.set_location ('person action range created is '||l_range_id,55);
1428: --
1429: End if;
1430: --
1431: Else
1445: If l_num_range > 1 then
1446: --
1447: For l_count in 1..least(l_threads,l_num_range)-1 loop
1448: --
1449: hr_utility.set_location('spawning thread #'||l_count,60);
1450: --
1451: l_request_id := fnd_request.submit_request
1452: (application => 'BEN'
1453: ,program => 'BENCWBBT'
1508: ,p_life_event_id => p_life_event_id
1509: ,p_bckt_stat_cd => p_bckt_stat_cd
1510: );
1511: --
1512: hr_utility.set_location('waiting for slaves',65);
1513: --
1514: ben_batch_utils.check_all_slaves_finished(p_rpt_flag => TRUE);
1515: hr_utility.set_location('hurray my slaves are done',70);
1516: --
1511: --
1512: hr_utility.set_location('waiting for slaves',65);
1513: --
1514: ben_batch_utils.check_all_slaves_finished(p_rpt_flag => TRUE);
1515: hr_utility.set_location('hurray my slaves are done',70);
1516: --
1517: -- Once all slaves are done go and delete heirarchy data.
1518: --
1519: if p_validate = 'N' then
1526: backout_heirarchy_data
1527: (p_per_in_ler_id => l_group_pil_rec.per_in_ler_id);
1528: end loop;
1529: --
1530: hr_utility.set_location('Deleting data from ben_cwb_pl_dsgn ',10);
1531: BEN_CWB_PL_DSGN_PKG.delete_pl_dsgn
1532: (p_group_pl_id => p_group_pl_id
1533: ,p_lf_evt_ocrd_dt => l_ocrd_date);
1534: --
1531: BEN_CWB_PL_DSGN_PKG.delete_pl_dsgn
1532: (p_group_pl_id => p_group_pl_id
1533: ,p_lf_evt_ocrd_dt => l_ocrd_date);
1534: --
1535: hr_utility.set_location('Refreshing Summary ',20);
1536: ben_cwb_summary_pkg.refresh_summary_group_pl
1537: (p_group_pl_id => p_group_pl_id
1538: ,p_lf_evt_ocrd_dt => l_ocrd_date);
1539: --
1538: ,p_lf_evt_ocrd_dt => l_ocrd_date);
1539: --
1540: commit;
1541: --
1542: hr_utility.set_location('Refreshing Summary Complete',30);
1543:
1544: end if;
1545: --
1546: ben_batch_utils.end_process(p_benefit_action_id => l_benefit_action_id
1567: fnd_file.put_line(which => fnd_file.log,
1568: buff => i.full_name ||' ('||'person_id = ' || i.person_id||')' );
1569: end loop;
1570: --
1571: hr_utility.set_location('Submitting reports',72);
1572: --
1573: -- submit summary report here
1574: --
1575: l_request_id := fnd_request.submit_request
1594: description => null,
1595: sub_request => false,
1596: argument1 => fnd_global.conc_request_id);
1597: --
1598: hr_utility.set_location ('Leaving '||l_proc,75);
1599: --
1600: -- hr_utility.trace_off;
1601: Exception
1602:
1596: argument1 => fnd_global.conc_request_id);
1597: --
1598: hr_utility.set_location ('Leaving '||l_proc,75);
1599: --
1600: -- hr_utility.trace_off;
1601: Exception
1602:
1603: when l_no_one_to_process then
1604: if c_person%isopen then
1611: --
1612: if c_person%isopen then
1613: close c_person;
1614: end if;
1615: hr_utility.set_location('Super Error',10);
1616: rollback;
1617: benutils.write(p_text => fnd_message.get);
1618: benutils.write(p_text => sqlerrm);
1619: benutils.write_table_and_file(p_table => TRUE, p_file => TRUE);
1702: l_person_id number;
1703: --
1704: begin
1705:
1706: hr_utility.set_location( 'Entering '|| l_proc, 5);
1707: --
1708: -- CWBGLOBAL
1709: --
1710: if p_routine = 'BEN_CWB_PERSON_TASKS' then
1777: end if;
1778: --
1779: -- Delete element entry if attached to rate row.
1780: --
1781: hr_utility.set_location('l_ELEMENT_ENTRY_VALUE_ID = '
1782: || l_ELEMENT_ENTRY_VALUE_ID, 88);
1783: hr_utility.set_location('l_business_group_id_prop = '
1784: || l_business_group_id_prop, 88);
1785: hr_utility.set_location('l_person_id = ' || l_person_id, 88);
1779: -- Delete element entry if attached to rate row.
1780: --
1781: hr_utility.set_location('l_ELEMENT_ENTRY_VALUE_ID = '
1782: || l_ELEMENT_ENTRY_VALUE_ID, 88);
1783: hr_utility.set_location('l_business_group_id_prop = '
1784: || l_business_group_id_prop, 88);
1785: hr_utility.set_location('l_person_id = ' || l_person_id, 88);
1786: hr_utility.set_location('l_COMP_POSTING_DATE = '
1787: || l_COMP_POSTING_DATE, 88);
1781: hr_utility.set_location('l_ELEMENT_ENTRY_VALUE_ID = '
1782: || l_ELEMENT_ENTRY_VALUE_ID, 88);
1783: hr_utility.set_location('l_business_group_id_prop = '
1784: || l_business_group_id_prop, 88);
1785: hr_utility.set_location('l_person_id = ' || l_person_id, 88);
1786: hr_utility.set_location('l_COMP_POSTING_DATE = '
1787: || l_COMP_POSTING_DATE, 88);
1788: if l_ELEMENT_ENTRY_VALUE_ID is not null and
1789: l_COMP_POSTING_DATE is not null then
1782: || l_ELEMENT_ENTRY_VALUE_ID, 88);
1783: hr_utility.set_location('l_business_group_id_prop = '
1784: || l_business_group_id_prop, 88);
1785: hr_utility.set_location('l_person_id = ' || l_person_id, 88);
1786: hr_utility.set_location('l_COMP_POSTING_DATE = '
1787: || l_COMP_POSTING_DATE, 88);
1788: if l_ELEMENT_ENTRY_VALUE_ID is not null and
1789: l_COMP_POSTING_DATE is not null then
1790:
1831: close c_cwb_person_rates;
1832:
1833: elsif p_routine = 'BEN_CWB_PERSON_INFO' then
1834:
1835: hr_utility.set_location( 'in audit changes BEN_CWB_PERSON_INFO'
1836: || l_proc, 500);
1837:
1838: open c_cwb_person_info;
1839: loop
1847: );
1848:
1849: end loop;
1850: close c_cwb_person_info;
1851: hr_utility.set_location( 'LEAVING audit changes BEN_CWB_PERSON_INFO'
1852: || l_proc, 600);
1853:
1854: end if;
1855: hr_utility.set_location( 'Leaving '||l_proc, 50);
1851: hr_utility.set_location( 'LEAVING audit changes BEN_CWB_PERSON_INFO'
1852: || l_proc, 600);
1853:
1854: end if;
1855: hr_utility.set_location( 'Leaving '||l_proc, 50);
1856:
1857: exception
1858: --
1859: when others then
1857: exception
1858: --
1859: when others then
1860: --
1861: hr_utility.set_location('Super Error exception level',10);
1862: hr_utility.set_location(sqlerrm,10);
1863: --
1864: if c_cwb_person_info%isopen then
1865: close c_cwb_person_info;
1858: --
1859: when others then
1860: --
1861: hr_utility.set_location('Super Error exception level',10);
1862: hr_utility.set_location(sqlerrm,10);
1863: --
1864: if c_cwb_person_info%isopen then
1865: close c_cwb_person_info;
1866: end if;
1895: l_proc varchar2(50) := g_package||'.delete_cwb_data';
1896: p_object_version_number ben_cwb_person_info.object_version_number%type;
1897: begin
1898:
1899: hr_utility.set_location( 'Entering '||l_proc, 5);
1900:
1901: --1. BEN_CWB_PERSON_TASKS
1902: hr_utility.set_location( 'Calling delete for BEN_CWB_PERSON_TASKS', 10);
1903: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
1898:
1899: hr_utility.set_location( 'Entering '||l_proc, 5);
1900:
1901: --1. BEN_CWB_PERSON_TASKS
1902: hr_utility.set_location( 'Calling delete for BEN_CWB_PERSON_TASKS', 10);
1903: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
1904: fnd_message.set_token('PROC','delete_person_tasks');
1905: cwb_delete_routine
1906: (p_routine => 'BEN_CWB_PERSON_TASKS'
1908: ,p_update_summary => p_update_summary
1909: );
1910:
1911: --2. BEN_CWB_PERSON_RATES
1912: hr_utility.set_location( 'Calling delete for BEN_CWB_PERSON_RATES', 15);
1913: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
1914: fnd_message.set_token('PROC','delete_person_rates');
1915: cwb_delete_routine
1916: (p_routine => 'BEN_CWB_PERSON_RATES'
1918: ,p_update_summary => p_update_summary
1919: );
1920:
1921: --3. BEN_CWB_PERSON_GROUPS
1922: hr_utility.set_location( 'BEN_CWB_PERSON_GROUPS', 20);
1923: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
1924: fnd_message.set_token('PROC','delete_person_groups');
1925: cwb_delete_routine
1926: (p_routine => 'BEN_CWB_PERSON_GROUPS'
1928: ,p_update_summary => p_update_summary
1929: );
1930:
1931: --4. BEN_CWB_PERSON_INFO
1932: hr_utility.set_location( 'Calling delete for BEN_CWB_PERSON_INFO', 25);
1933: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
1934: fnd_message.set_token('PROC','delete_person_info');
1935: cwb_delete_routine
1936: (p_routine => 'BEN_CWB_PERSON_INFO'
1938: ,p_update_summary => p_update_summary
1939: );
1940: --************************************************************ --
1941:
1942: hr_utility.set_location( 'Leaving '||l_proc, 50);
1943: --
1944: end delete_cwb_data;
1945: --
1946: procedure delete_summary(p_group_per_in_ler_id in number) is
2027: l_proc varchar2(50) := g_package||'.p_backout_global_cwb_event';
2028: --
2029: begin
2030: --
2031: hr_utility.set_location( 'Entering '||l_proc, 10);
2032: open c_pil(p_person_id,
2033: p_lf_evt_ocrd_dt,
2034: p_group_pl_id,
2035: p_lf_evt_ocrd_dt);
2038: --
2039: fetch c_pil into l_pil_rec;
2040: exit when c_pil%notfound;
2041: --
2042: hr_utility.set_location ('per_in_ler_id '||l_pil_rec.per_in_ler_id,10);
2043: hr_utility.set_location ('typ_cd '||l_pil_rec.typ_cd,10);
2044: hr_utility.set_location ('bg id '||l_pil_rec.business_group_id,10);
2045: --
2046: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
2039: fetch c_pil into l_pil_rec;
2040: exit when c_pil%notfound;
2041: --
2042: hr_utility.set_location ('per_in_ler_id '||l_pil_rec.per_in_ler_id,10);
2043: hr_utility.set_location ('typ_cd '||l_pil_rec.typ_cd,10);
2044: hr_utility.set_location ('bg id '||l_pil_rec.business_group_id,10);
2045: --
2046: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
2047: fnd_message.set_token('PROC','ben_back_out_life_event');
2040: exit when c_pil%notfound;
2041: --
2042: hr_utility.set_location ('per_in_ler_id '||l_pil_rec.per_in_ler_id,10);
2043: hr_utility.set_location ('typ_cd '||l_pil_rec.typ_cd,10);
2044: hr_utility.set_location ('bg id '||l_pil_rec.business_group_id,10);
2045: --
2046: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
2047: fnd_message.set_token('PROC','ben_back_out_life_event');
2048: hr_utility.set_location ('calling bolfe ',10);
2044: hr_utility.set_location ('bg id '||l_pil_rec.business_group_id,10);
2045: --
2046: fnd_message.set_name('BEN','BEN_91333_CALLING_PROC');
2047: fnd_message.set_token('PROC','ben_back_out_life_event');
2048: hr_utility.set_location ('calling bolfe ',10);
2049: --
2050: ben_back_out_life_event.g_enrt_made_flag := Null;
2051: --
2052: ben_back_out_life_event.back_out_life_events
2074: End loop;
2075: --
2076: close c_pil;
2077: --
2078: hr_utility.set_location('Leaving '||l_proc, 50);
2079: exception
2080: --
2081: when others then
2082: --
2079: exception
2080: --
2081: when others then
2082: --
2083: hr_utility.set_location('Super Error exception level',10);
2084: hr_utility.set_location(sqlerrm,10);
2085: --
2086: if c_pil%isopen then
2087: --
2080: --
2081: when others then
2082: --
2083: hr_utility.set_location('Super Error exception level',10);
2084: hr_utility.set_location(sqlerrm,10);
2085: --
2086: if c_pil%isopen then
2087: --
2088: close c_pil;