651:
652: BEGIN
653: -- Cancel notifications from previous plan run and force completion of
654: -- workflows.
655: msc_util.msc_debug('****** Start of Program MSC_EXP_WF******');
656: msc_util.msc_debug('PlanId: ' || to_char(p_plan_id));
657: msc_util.msc_debug('ExceptionId: ' || to_char(p_exception_id));
658:
659: DeleteActivities(p_plan_id);
652: BEGIN
653: -- Cancel notifications from previous plan run and force completion of
654: -- workflows.
655: msc_util.msc_debug('****** Start of Program MSC_EXP_WF******');
656: msc_util.msc_debug('PlanId: ' || to_char(p_plan_id));
657: msc_util.msc_debug('ExceptionId: ' || to_char(p_exception_id));
658:
659: DeleteActivities(p_plan_id);
660: msc_util.msc_debug('deleted entries');
653: -- Cancel notifications from previous plan run and force completion of
654: -- workflows.
655: msc_util.msc_debug('****** Start of Program MSC_EXP_WF******');
656: msc_util.msc_debug('PlanId: ' || to_char(p_plan_id));
657: msc_util.msc_debug('ExceptionId: ' || to_char(p_exception_id));
658:
659: DeleteActivities(p_plan_id);
660: msc_util.msc_debug('deleted entries');
661:
656: msc_util.msc_debug('PlanId: ' || to_char(p_plan_id));
657: msc_util.msc_debug('ExceptionId: ' || to_char(p_exception_id));
658:
659: DeleteActivities(p_plan_id);
660: msc_util.msc_debug('deleted entries');
661:
662: l_cursor := 'EXCEPTION_DETAILS_C';
663: msc_util.msc_debug('before the exception open');
664: if p_exception_id is null and p_query_id is null then
659: DeleteActivities(p_plan_id);
660: msc_util.msc_debug('deleted entries');
661:
662: l_cursor := 'EXCEPTION_DETAILS_C';
663: msc_util.msc_debug('before the exception open');
664: if p_exception_id is null and p_query_id is null then
665:
666: OPEN EXCEPTION_DETAILS_C3(p_plan_id);
667:
672: OPEN EXCEPTION_DETAILS_C2(p_plan_id,p_query_id);
673: end if;
674:
675: LOOP
676: msc_util.msc_debug('before the exception fetch');
677: if p_exception_id is null and p_query_id is null then
678: FETCH EXCEPTION_DETAILS_C3 INTO
679: l_exception_id,
680: l_organization_id,
802:
803: if (l_exception_type in (1, 2, 3, 12, 14, 16, 20, 26, 27)) then
804: l_workflow_process := 'EXCEPTION_PROCESS1';
805: elsif (l_exception_type in (28, 37)) then
806: msc_util.msc_debug('Within the 37 logic');
807: l_workflow_process := 'EXCEPTION_PROCESS5';
808: l_cursor := 'SUPPLIER_SITE_C';
809: OPEN SUPPLIER_SITE_C(l_exception_id,p_plan_id);
810: LOOP
914: l_qty_related_values,
915: l_sup_project_id,
916: l_sup_task_id );
917:
918: msc_util.msc_debug('After the start process');
919:
920: if l_counter >1000 then
921: commit;
922: msc_util.msc_debug('commit now');
918: msc_util.msc_debug('After the start process');
919:
920: if l_counter >1000 then
921: commit;
922: msc_util.msc_debug('commit now');
923: l_counter :=1;
924: else
925: l_counter := l_counter+1;
926: end if;
925: l_counter := l_counter+1;
926: end if;
927:
928: END LOOP;
929: msc_util.msc_debug('After loop');
930:
931: if p_exception_id is null and p_query_id is null then
932: CLOSE EXCEPTION_DETAILS_C3;
933: elsif p_exception_id is not null then
935: elsif p_query_id is not null then
936: CLOSE EXCEPTION_DETAILS_C2;
937: end if;
938:
939: msc_util.msc_debug('Completed:'|| to_char(l_counter -1));
940: retcode := 0;
941:
942: l_cursor := 'End of launch_workflow';
943:
945: WHEN NO_DATA_FOUND THEN
946: null;
947:
948: WHEN OTHERS THEN
949: msc_util.msc_debug('Error in launch wkflow:'|| sqlerrm);
950: errbuf := 'Error in msc_exp_wf.launch_workflow function' ||
951: ' Cursor: ' || l_cursor || ' Exception ID: '
952: || l_exception_id ||
953: ' SQL error: ' || sqlerrm;
1073:
1074: lv_organization_id := organization_id;
1075: lv_inventory_item_id :=inventory_item_id;
1076: lv_exception_type := exception_type;
1077: msc_util.msc_debug('Inside the start process');
1078: -- Note that with MSC the unique key is plan_id || exception_id
1079: --wf_engine.threshold := -1;
1080: wf_engine.CreateProcess( itemtype => item_type,
1081: itemkey => item_key,
1561: aname => 'PLANNING_GROUP',
1562: avalue => so_rec.atp_override_flag);
1563:
1564: end if; -- end of if (lv_exception_type = 70)
1565: msc_util.msc_debug('Before start process:'|| item_type || ':' || item_key);
1566:
1567: wf_engine.StartProcess( itemtype => item_type,
1568: itemkey => item_key);
1569:
1630: l_planner varchar2(100);
1631: l_msg varchar2(100);
1632: BEGIN
1633:
1634: msc_util.msc_debug('In the planner select logic');
1635:
1636: if (funcmode = 'RUN') then
1637:
1638: if (l_stage = 1) then
1655: wf_engine.GetItemAttrText( itemtype => itemtype,
1656: itemkey => itemkey,
1657: aname => 'PLANNER');
1658: end if;
1659: msc_util.msc_debug('planner:'||l_planner);
1660:
1661: if l_planner is not null THEN
1662: l_msg := GetPlannerMsgName(l_exception_type,
1663: l_order_type,
1666: wf_engine.SetItemAttrText( itemtype => itemtype,
1667: itemkey => itemkey,
1668: aname => 'MESSAGE_NAME',
1669: avalue => l_msg);
1670: msc_util.msc_debug('msg name:'||l_msg);
1671:
1672: resultout := 'COMPLETE:FOUND';
1673: else
1674: resultout := 'COMPLETE:NOT_FOUND';
1855:
1856:
1857: BEGIN
1858:
1859: msc_util.msc_debug('In determineordertype:'|| l_order_type);
1860:
1861: if (funcmode = 'RUN') then
1862:
1863: -- Purchase Order
2194:
2195: FETCH DELETE_ACTIVITIES_C INTO l_item_key, l_item_type;
2196: EXIT WHEN DELETE_ACTIVITIES_C%NOTFOUND;
2197:
2198: msc_util.msc_debug('DELETING dblink:' || l_db_link || ':' || l_item_key ||','||l_item_type);
2199: update
2200: wf_notifications
2201: set end_date = sysdate
2202: where group_id in
2237: return;
2238:
2239: EXCEPTION
2240: when others then
2241: msc_util.msc_debug('Error in delete activities:'|| to_char(sqlcode) || ':'
2242: || substr(sqlerrm,1,100));
2243:
2244: return;
2245: END DeleteActivities;