3: --
4: -- Package Variables
5: --
6: g_package varchar2(33) := ' PER_CHECKLIST_EVENTS.';
7: g_debug boolean := hr_utility.debug_enabled;
8:
9:
10: procedure check_approvers_exist
11: (itemtype in varchar2,
20: l_proc varchar2(72);
21: begin
22:
23: l_proc := g_package||'check_process';
24: hr_utility.set_location('Entering:'|| l_proc, 10);
25: hr_utility.set_location(l_proc,1);
26:
27: l_taskin_cklid := wf_engine.GetItemAttrNumber(
28: itemtype => itemtype
21: begin
22:
23: l_proc := g_package||'check_process';
24: hr_utility.set_location('Entering:'|| l_proc, 10);
25: hr_utility.set_location(l_proc,1);
26:
27: l_taskin_cklid := wf_engine.GetItemAttrNumber(
28: itemtype => itemtype
29: ,itemkey => itemkey
43: else
44: resultout:='COMPLETE:Y';
45: end if;
46:
47: hr_utility.set_location('retvalue:'|| resultout, 20);
48: hr_utility.set_location('Leaving:'|| l_proc, 10);
49:
50: end;
51:
44: resultout:='COMPLETE:Y';
45: end if;
46:
47: hr_utility.set_location('retvalue:'|| resultout, 20);
48: hr_utility.set_location('Leaving:'|| l_proc, 10);
49:
50: end;
51:
52:
156: wfn.notification_id=wfna.notification_id and context like cur_p_context and responder is not null and name ='RESULT';
157:
158: begin
159: l_proc := g_package||'PROCESS_VOTING';
160: hr_utility.set_location('Entering:'|| l_proc, 10);
161: hr_utility.set_location(l_proc,1);
162:
163: if(funcmode='RUN') then
164: open cur_check_wf_status(itemtype||':'|| itemkey ||':%');
157:
158: begin
159: l_proc := g_package||'PROCESS_VOTING';
160: hr_utility.set_location('Entering:'|| l_proc, 10);
161: hr_utility.set_location(l_proc,1);
162:
163: if(funcmode='RUN') then
164: open cur_check_wf_status(itemtype||':'|| itemkey ||':%');
165: fetch cur_check_wf_status into l_status,l_responder;
179: close cur_check_wf_status;
180: else
181: resultout:=null;
182: end if;
183: hr_utility.set_location('result:'|| resultout, 20);
184: hr_utility.set_location('Leaving:'|| l_proc, 10);
185: end;
186:
187: --
180: else
181: resultout:=null;
182: end if;
183: hr_utility.set_location('result:'|| resultout, 20);
184: hr_utility.set_location('Leaving:'|| l_proc, 10);
185: end;
186:
187: --
188: -- ------------------------------------------------------------------------
211: --
212: --
213: begin
214: --
215: g_debug := hr_utility.debug_enabled;
216: if g_debug then
217: l_proc := g_package||'create_event';
218: hr_utility.set_location('Entering:'|| l_proc, 10);
219: end if;
214: --
215: g_debug := hr_utility.debug_enabled;
216: if g_debug then
217: l_proc := g_package||'create_event';
218: hr_utility.set_location('Entering:'|| l_proc, 10);
219: end if;
220: --
221: open event_exists;
222: fetch event_exists into l_exists;
221: open event_exists;
222: fetch event_exists into l_exists;
223: if event_exists%notfound then
224: if g_debug then
225: hr_utility.set_location('Entering '||l_proc,20);
226: end if;
227: insert into per_ben_identified_events(
228: ben_identified_event_id,
229: event_reason_id,
242: 1);
243: end if;
244: close event_exists;
245: if g_debug then
246: hr_utility.set_location('Leaving '||l_proc,30);
247: end if;
248: End create_event;
249: --
250:
345: --
346: begin
347: --
348: --
349: g_debug := hr_utility.debug_enabled;
350: if g_debug then
351: l_proc := g_package||'create_event';
352: hr_utility.set_location('Entering:'|| l_proc, 10);
353: hr_utility.set_location('person_id '||to_char(p_person_id),10);
348: --
349: g_debug := hr_utility.debug_enabled;
350: if g_debug then
351: l_proc := g_package||'create_event';
352: hr_utility.set_location('Entering:'|| l_proc, 10);
353: hr_utility.set_location('person_id '||to_char(p_person_id),10);
354: hr_utility.set_location('asg id '||to_char(p_assignment_id),10);
355: hr_utility.set_location('event reason '||to_char(p_ler_event_id),10);
356: end if;
349: g_debug := hr_utility.debug_enabled;
350: if g_debug then
351: l_proc := g_package||'create_event';
352: hr_utility.set_location('Entering:'|| l_proc, 10);
353: hr_utility.set_location('person_id '||to_char(p_person_id),10);
354: hr_utility.set_location('asg id '||to_char(p_assignment_id),10);
355: hr_utility.set_location('event reason '||to_char(p_ler_event_id),10);
356: end if;
357: --
350: if g_debug then
351: l_proc := g_package||'create_event';
352: hr_utility.set_location('Entering:'|| l_proc, 10);
353: hr_utility.set_location('person_id '||to_char(p_person_id),10);
354: hr_utility.set_location('asg id '||to_char(p_assignment_id),10);
355: hr_utility.set_location('event reason '||to_char(p_ler_event_id),10);
356: end if;
357: --
358: --loop throught the number of records fetched which are pending to process.
351: l_proc := g_package||'create_event';
352: hr_utility.set_location('Entering:'|| l_proc, 10);
353: hr_utility.set_location('person_id '||to_char(p_person_id),10);
354: hr_utility.set_location('asg id '||to_char(p_assignment_id),10);
355: hr_utility.set_location('event reason '||to_char(p_ler_event_id),10);
356: end if;
357: --
358: --loop throught the number of records fetched which are pending to process.
359: --
359: --
360:
361: for x_cur in c1(p_ler_event_id) loop
362: if g_debug then
363: hr_utility.set_location('In the first loop',20);
364: end if;
365:
366: --
367: -- if not a concurrent request ben code BEN_PER_ASG_ELIG
385: x_cur.business_group_id,
386: false)
387: then
388: if g_debug then
389: hr_utility.set_location('In the first loop',30);
390: end if;
391: --
392: open chk_exists(p_person_id,x_cur.task_in_checklist_id);
393: fetch chk_exists into l_dummy;
392: open chk_exists(p_person_id,x_cur.task_in_checklist_id);
393: fetch chk_exists into l_dummy;
394: if chk_exists%notfound then
395: if g_debug then
396: hr_utility.set_location('In the first loop',40);
397: end if;
398: --
399: if nvl(x_cur.checklist_id,-1) <> nvl(current_checklist_id,-1) then
400: --
398: --
399: if nvl(x_cur.checklist_id,-1) <> nvl(current_checklist_id,-1) then
400: --
401: if g_debug then
402: hr_utility.set_location('In the first loop',50);
403: end if;
404: --
405: open alloc_ckl_exists (p_person_id,p_assignment_id,x_cur.checklist_id);
406: fetch alloc_ckl_exists into current_alloc_ckl_id;
424: end if;
425: close alloc_ckl_exists;
426: --
427: if g_debug then
428: hr_utility.set_location('In the first loop',80);
429: end if;
430: --
431: end if;
432: if g_debug then
429: end if;
430: --
431: end if;
432: if g_debug then
433: hr_utility.set_location('In the first loop',90);
434: end if;
435: --
436: -- ---------------------------------------------------------
437: -- ---------------------------------------------------------
447: begin
448: if x_cur.ame_attribute_identifier is not null then
449:
450: if g_debug then
451: hr_utility.set_location('before approver'||l_proc,75);
452: end if;
453: --
454: -- Get All approvers
455: --
459: TRANSACTIONIDIN => x_cur.task_in_checklist_id,
460: approvalProcessCompleteYNout => process_complete,
461: APPROVERSOUT => ALL_APPROVERS);
462: if g_debug then
463: hr_utility.set_location('after approver'||l_proc,76);
464: end if;
465:
466: if all_approvers.count > 0 then
467: i := 1; -- approver_count
488: -- ==============================================================================
489:
490: begin
491: if g_debug then
492: hr_utility.set_location('Before target date'||l_proc,200);
493: end if;
494:
495: --
496: -- Calculate target end date
518: l_orig_system := 'PER';
519: END IF;
520: --
521: if g_debug then
522: hr_utility.set_location('After Target Date'||l_proc,210);
523: hr_utility.set_location('Target date '||to_char(l_target_end_date),210);
524: hr_utility.set_location('alloc_task_id '||to_char(l_allocated_task_id),210);
525: end if;
526: --
519: END IF;
520: --
521: if g_debug then
522: hr_utility.set_location('After Target Date'||l_proc,210);
523: hr_utility.set_location('Target date '||to_char(l_target_end_date),210);
524: hr_utility.set_location('alloc_task_id '||to_char(l_allocated_task_id),210);
525: end if;
526: --
527: PER_ALLOCATED_TASK_API.CREATE_ALLOC_TASK
520: --
521: if g_debug then
522: hr_utility.set_location('After Target Date'||l_proc,210);
523: hr_utility.set_location('Target date '||to_char(l_target_end_date),210);
524: hr_utility.set_location('alloc_task_id '||to_char(l_allocated_task_id),210);
525: end if;
526: --
527: PER_ALLOCATED_TASK_API.CREATE_ALLOC_TASK
528: ( p_validate => false
542: ,p_allocated_task_id => l_allocated_task_id
543: ,p_object_version_number => l_alloc_task_ovn
544: );
545: -- TASK_STATUS ......!!!!!
546: hr_utility.set_location('In the first loop',110);
547: end;
548: --
549: hr_utility.set_location('after insert',70);
550: --
545: -- TASK_STATUS ......!!!!!
546: hr_utility.set_location('In the first loop',110);
547: end;
548: --
549: hr_utility.set_location('after insert',70);
550: --
551: -- ==============================================================================
552: -- ===============Begin of start workflow if eligible ===========================
553: -- ==============================================================================
555: -- call workflow only if an approver is found.
556: --
557: if l_approver_name is not null then
558: if g_debug then
559: hr_utility.set_location('Before wkflow'||l_proc,80);
560: hr_utility.set_location('approver_order num '||to_char(l_approver_order_number),999);
561: end if;
562: --
563: begin
556: --
557: if l_approver_name is not null then
558: if g_debug then
559: hr_utility.set_location('Before wkflow'||l_proc,80);
560: hr_utility.set_location('approver_order num '||to_char(l_approver_order_number),999);
561: end if;
562: --
563: begin
564: --
579: );
580:
581: --
582: if g_debug then
583: hr_utility.set_location('After wkflow'||l_proc,80);
584: end if;
585: --
586: end;
587: --
600: -- ========================= End of Workflow ====================================
601: -- ==============================================================================
602: end if; -- chk_exists
603: close chk_exists;
604: hr_utility.set_location('In the first loop',120);
605: --
606: end if; -- BEN Eligibility engine fetches an eligible object
607: --
608: hr_utility.set_location('In the first loop',130);
604: hr_utility.set_location('In the first loop',120);
605: --
606: end if; -- BEN Eligibility engine fetches an eligible object
607: --
608: hr_utility.set_location('In the first loop',130);
609: end loop;
610: --
611:
612: hr_utility.set_location('In the first loop',140);
608: hr_utility.set_location('In the first loop',130);
609: end loop;
610: --
611:
612: hr_utility.set_location('In the first loop',140);
613:
614: exception
615: when others then
616: --
646: begin
647: --
648: fnd_file.put_line(FND_FILE.LOG, ' Allocate Tasks Process Started');
649: --
650: g_debug := hr_utility.debug_enabled;
651: if g_debug then
652: l_proc := g_package||'Allocate_Tasks';
653: hr_utility.set_location('Entering:'|| l_proc, 10);
654: hr_utility.set_location('Before process call',1);
649: --
650: g_debug := hr_utility.debug_enabled;
651: if g_debug then
652: l_proc := g_package||'Allocate_Tasks';
653: hr_utility.set_location('Entering:'|| l_proc, 10);
654: hr_utility.set_location('Before process call',1);
655: end if;
656: --
657: FOR p_cur in pending_events loop
650: g_debug := hr_utility.debug_enabled;
651: if g_debug then
652: l_proc := g_package||'Allocate_Tasks';
653: hr_utility.set_location('Entering:'|| l_proc, 10);
654: hr_utility.set_location('Before process call',1);
655: end if;
656: --
657: FOR p_cur in pending_events loop
658: if nvl(p_cur.assignment_id,-1) <> -1 then
662: ,p_date => p_cur.effective_date
663: ,p_ler_event_id => p_cur.event_reason_id
664: );
665: if g_debug then
666: hr_utility.set_location(l_proc||'after process event call',2);
667: end if;
668: else
669: if g_debug then
670: hr_utility.set_location(l_proc||'Before Procecss with ASG',3);
666: hr_utility.set_location(l_proc||'after process event call',2);
667: end if;
668: else
669: if g_debug then
670: hr_utility.set_location(l_proc||'Before Procecss with ASG',3);
671: end if;
672: --
673: per_checklist_events.process_event
674: ( p_person_id => p_cur.person_id
677: ,p_ler_event_id => p_cur.event_reason_id
678: );
679: end if;
680: if g_debug then
681: hr_utility.set_location(l_proc||'After Procecss Call',4);
682: end if;
683: --
684: -- Update the status from PENDING to Processed
685: --
735: --
736: begin
737: --
738: --
739: g_debug := hr_utility.debug_enabled;
740: if g_debug then
741: l_proc := g_package||'Allocate_person_tasks';
742: hr_utility.set_location('Entering:'|| l_proc, 10);
743: hr_utility.set_location('Before process call',1);
738: --
739: g_debug := hr_utility.debug_enabled;
740: if g_debug then
741: l_proc := g_package||'Allocate_person_tasks';
742: hr_utility.set_location('Entering:'|| l_proc, 10);
743: hr_utility.set_location('Before process call',1);
744: end if;
745: --
746: FOR p_cur in pending_events loop
739: g_debug := hr_utility.debug_enabled;
740: if g_debug then
741: l_proc := g_package||'Allocate_person_tasks';
742: hr_utility.set_location('Entering:'|| l_proc, 10);
743: hr_utility.set_location('Before process call',1);
744: end if;
745: --
746: FOR p_cur in pending_events loop
747: if nvl(p_cur.assignment_id,-1) <> -1 then
750: ,p_assignment_id => p_cur.assignment_id
751: ,p_date => p_cur.effective_date
752: ,p_ler_event_id => p_cur.event_reason_id
753: );
754: hr_utility.set_location('after process call',2);
755: else
756: hr_utility.set_location('after process call',3);
757: per_checklist_events.process_event
758: ( p_person_id => p_cur.person_id
752: ,p_ler_event_id => p_cur.event_reason_id
753: );
754: hr_utility.set_location('after process call',2);
755: else
756: hr_utility.set_location('after process call',3);
757: per_checklist_events.process_event
758: ( p_person_id => p_cur.person_id
759: ,p_assignment_id => null
760: ,p_date => p_cur.effective_date
760: ,p_date => p_cur.effective_date
761: ,p_ler_event_id => p_cur.event_reason_id
762: );
763: end if;
764: hr_utility.set_location('after process call',4);
765: --
766: -- Update the status from PENDING to Processed
767: --
768: UPDATE per_ben_identified_events
773: --
774:
775: commit;
776: if g_debug then
777: hr_utility.set_location('Leaving:'|| l_proc, 100);
778: end if;
779: --
780: exception
781: when others then
828: l_performer_name varchar2(3000);
829:
830: begin
831: --
832: g_debug := hr_utility.debug_enabled;
833: if g_debug then
834: l_proc := g_package||'Start_WF_Process';
835: hr_utility.set_location('Entering:'|| l_proc, 10);
836: hr_utility.set_location('Before process call',1);
831: --
832: g_debug := hr_utility.debug_enabled;
833: if g_debug then
834: l_proc := g_package||'Start_WF_Process';
835: hr_utility.set_location('Entering:'|| l_proc, 10);
836: hr_utility.set_location('Before process call',1);
837: end if;
838: --
839: OPEN csr_person_name;
832: g_debug := hr_utility.debug_enabled;
833: if g_debug then
834: l_proc := g_package||'Start_WF_Process';
835: hr_utility.set_location('Entering:'|| l_proc, 10);
836: hr_utility.set_location('Before process call',1);
837: end if;
838: --
839: OPEN csr_person_name;
840: FETCH csr_person_name into l_person_name;
886: ,itemkey => l_Item_Key
887: );
888: --
889: if g_debug then
890: hr_utility.set_location('Leaving:'|| l_proc, 100);
891: end if;
892: --
893: end start_wf_process;
894: --
909: l_proc varchar2(72);
910: --
911: begin
912: --
913: g_debug := hr_utility.debug_enabled;
914: if g_debug then
915: l_proc := g_package||'APPROVE_WF_PROCESS';
916: hr_utility.set_location('Entering:'|| l_proc, 10);
917: hr_utility.set_location(l_proc,1);
912: --
913: g_debug := hr_utility.debug_enabled;
914: if g_debug then
915: l_proc := g_package||'APPROVE_WF_PROCESS';
916: hr_utility.set_location('Entering:'|| l_proc, 10);
917: hr_utility.set_location(l_proc,1);
918: end if;
919: -- Debug code added in 120.9 removed in 120.10
920: --my_test_pkg.ins_my_values(l_proc||'funmode',funcmode);
913: g_debug := hr_utility.debug_enabled;
914: if g_debug then
915: l_proc := g_package||'APPROVE_WF_PROCESS';
916: hr_utility.set_location('Entering:'|| l_proc, 10);
917: hr_utility.set_location(l_proc,1);
918: end if;
919: -- Debug code added in 120.9 removed in 120.10
920: --my_test_pkg.ins_my_values(l_proc||'funmode',funcmode);
921: --
944: --
945: end if;
946: --
947: if g_debug then
948: hr_utility.set_location('Leaving:'|| l_proc, 100);
949: end if;
950: --
951: end approve_wf_process;
952: --
965: l_proc varchar2(72);
966: --
967: begin
968: --
969: g_debug := hr_utility.debug_enabled;
970: if g_debug then
971: l_proc := g_package||'REJECT_WF_PROCESS';
972: hr_utility.set_location('Entering:'|| l_proc, 10);
973: hr_utility.set_location(l_proc,1);
968: --
969: g_debug := hr_utility.debug_enabled;
970: if g_debug then
971: l_proc := g_package||'REJECT_WF_PROCESS';
972: hr_utility.set_location('Entering:'|| l_proc, 10);
973: hr_utility.set_location(l_proc,1);
974: end if;
975: --
976: if (funcmode = 'RUN')
969: g_debug := hr_utility.debug_enabled;
970: if g_debug then
971: l_proc := g_package||'REJECT_WF_PROCESS';
972: hr_utility.set_location('Entering:'|| l_proc, 10);
973: hr_utility.set_location(l_proc,1);
974: end if;
975: --
976: if (funcmode = 'RUN')
977: then
995: --
996: end if;
997: --
998: if g_debug then
999: hr_utility.set_location('Leaving:'|| l_proc, 100);
1000: end if;
1001: --
1002: end rejected_wf_process;
1003: --
1028: l_proc varchar2(72);
1029: --
1030: begin
1031: --
1032: g_debug := hr_utility.debug_enabled;
1033: if g_debug then
1034: l_proc := g_package||'PROCESS_FYI';
1035: hr_utility.set_location('Entering:'|| l_proc, 10);
1036: hr_utility.set_location(l_proc,1);
1031: --
1032: g_debug := hr_utility.debug_enabled;
1033: if g_debug then
1034: l_proc := g_package||'PROCESS_FYI';
1035: hr_utility.set_location('Entering:'|| l_proc, 10);
1036: hr_utility.set_location(l_proc,1);
1037: end if;
1038: --
1039: --
1032: g_debug := hr_utility.debug_enabled;
1033: if g_debug then
1034: l_proc := g_package||'PROCESS_FYI';
1035: hr_utility.set_location('Entering:'|| l_proc, 10);
1036: hr_utility.set_location(l_proc,1);
1037: end if;
1038: --
1039: --
1040: if (funcmode = 'RUN')
1108: --
1109: end if;
1110: --
1111: if g_debug then
1112: hr_utility.set_location('Leaving:'|| l_proc, 100);
1113: end if;
1114: --
1115: end process_fyi;
1116: --
1185: --
1186: BEGIN
1187: --
1188: l_proc:= 'per_checklist_events.copy_tasks';
1189: hr_utility.set_location('Entering: '|| l_proc, 10);
1190: --
1191: OPEN c_tasks(p_from_ckl_id);
1192: --
1193: LOOP
1269: END LOOP;
1270: --
1271: CLOSE c_tasks;
1272: --
1273: hr_utility.set_location('Leaving: '|| l_proc, 20);
1274: --
1275: EXCEPTION
1276: --
1277: WHEN OTHERS THEN
1275: EXCEPTION
1276: --
1277: WHEN OTHERS THEN
1278: --
1279: hr_utility.set_location('Leaving: '|| l_proc, 30);
1280: hr_utility.set_location(SQLERRM, 35);
1281: RAISE;
1282: --
1283: END Copy_Tasks;
1276: --
1277: WHEN OTHERS THEN
1278: --
1279: hr_utility.set_location('Leaving: '|| l_proc, 30);
1280: hr_utility.set_location(SQLERRM, 35);
1281: RAISE;
1282: --
1283: END Copy_Tasks;
1284: --