22: --
23: if (funcmode = 'RUN') then
24:
25: -- Get Chagne Id
26: Eng_Workflow_Util.GetChangeObject
27: ( p_item_type => itemtype
28: , p_item_key => itemkey
29: , x_change_id => l_change_id
30: ) ;
30: ) ;
31:
32:
33: -- Get Chagne Line Id
34: Eng_Workflow_Util.GetChangeLineObject
35: ( p_item_type => itemtype
36: , p_item_key => itemkey
37: , x_change_line_id => l_change_line_id
38: ) ;
145:
146: IF l_adhoc_party_list IS NULL THEN
147:
148: -- Get Action Id
149: Eng_Workflow_Util.GetActionId
150: ( p_item_type => itemtype
151: , p_item_key => itemkey
152: , x_action_id => l_action_id
153: ) ;
175: return;
176: END IF ;
177:
178: -- Set Adhoc Party Role
179: Eng_Workflow_Util.SetAdhocPartyRole
180: ( x_return_status => l_return_status
181: , x_msg_count => l_msg_count
182: , x_msg_data => l_msg_data
183: , p_item_type => itemtype
192: result := 'COMPLETE';
193: return;
194:
195: -- None
196: ELSIF l_return_status = Eng_Workflow_Util.G_RET_STS_NONE THEN
197:
198: -- set result
199: result := 'COMPLETE:NONE';
200: return;
278: --
279: if (funcmode = 'RUN') then
280:
281:
282: Eng_Workflow_Util.Get_Debug_Mode
283: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
284:
285: -- For Test/Debug
286: IF l_debug_flag THEN
283: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
284:
285: -- For Test/Debug
286: IF l_debug_flag THEN
287: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
288: , l_debug_filename || actid ) ;
289: END IF ;
290:
291:
289: END IF ;
290:
291:
292: -- Set Adhoc Party Role
293: Eng_Workflow_Util.SetAssigneeRole
294: ( x_return_status => l_return_status
295: , x_msg_count => l_msg_count
296: , x_msg_data => l_msg_data
297: , p_item_type => itemtype
302: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
303:
304:
305: IF l_debug_flag THEN
306: Eng_Workflow_Util.Close_Debug_Session ;
307: END IF ;
308:
309: -- set result
310: result := 'COMPLETE';
310: result := 'COMPLETE';
311: return;
312:
313: -- None
314: ELSIF l_return_status = Eng_Workflow_Util.G_RET_STS_NONE THEN
315:
316: -- set result
317: result := 'COMPLETE:NONE';
318:
316: -- set result
317: result := 'COMPLETE:NONE';
318:
319: IF l_debug_flag THEN
320: Eng_Workflow_Util.Close_Debug_Session ;
321: END IF ;
322:
323: return;
324: ELSE
361:
362: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
363:
364: IF l_debug_flag THEN
365: Eng_Workflow_Util.Close_Debug_Session ;
366: END IF ;
367:
368: -- The line below records this function call in the error system
369: -- in the case of an exception.
374:
375: WHEN OTHERS THEN
376:
377: IF l_debug_flag THEN
378: Eng_Workflow_Util.Close_Debug_Session ;
379: END IF ;
380:
381: -- The line below records this function call in the error system
382: -- in the case of an exception.
408: --
409: if (funcmode = 'RUN') then
410:
411: -- Set Reviewers Role
412: Eng_Workflow_Util.SetReviewersRole
413: ( x_return_status => l_return_status
414: , x_msg_count => l_msg_count
415: , x_msg_data => l_msg_data
416: , p_item_type => itemtype
425: result := 'COMPLETE';
426: return;
427:
428: -- None
429: ELSIF l_return_status = Eng_Workflow_Util.G_RET_STS_NONE THEN
430:
431: -- set result
432: result := 'COMPLETE:NONE';
433: return;
508: --
509: if (funcmode = 'RUN') then
510:
511: -- Set Reviewers Role
512: Eng_Workflow_Util.SetReviewersRole
513: ( x_return_status => l_return_status
514: , x_msg_count => l_msg_count
515: , x_msg_data => l_msg_data
516: , p_item_type => itemtype
525: result := 'COMPLETE';
526: return;
527:
528: -- None
529: ELSIF l_return_status = Eng_Workflow_Util.G_RET_STS_NONE THEN
530:
531: -- set result
532: result := 'COMPLETE:NONE';
533: return;
609: --
610: if (funcmode = 'RUN') then
611:
612:
613: Eng_Workflow_Util.Get_Debug_Mode
614: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
615:
616: -- For Test/Debug
617: IF l_debug_flag THEN
614: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
615:
616: -- For Test/Debug
617: IF l_debug_flag THEN
618: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
619: , l_debug_filename || actid ) ;
620: END IF ;
621:
622: -- Set Adhoc Party Role
619: , l_debug_filename || actid ) ;
620: END IF ;
621:
622: -- Set Adhoc Party Role
623: Eng_Workflow_Util.SetLineAssigneeRole
624: ( x_return_status => l_return_status
625: , x_msg_count => l_msg_count
626: , x_msg_data => l_msg_data
627: , p_item_type => itemtype
631:
632: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
633:
634: IF l_debug_flag THEN
635: Eng_Workflow_Util.Close_Debug_Session ;
636: END IF ;
637:
638: -- set result
639: result := 'COMPLETE';
639: result := 'COMPLETE';
640: return;
641:
642: -- None
643: ELSIF l_return_status = Eng_Workflow_Util.G_RET_STS_NONE THEN
644:
645: -- set result
646: result := 'COMPLETE:NONE';
647:
645: -- set result
646: result := 'COMPLETE:NONE';
647:
648: IF l_debug_flag THEN
649: Eng_Workflow_Util.Close_Debug_Session ;
650: END IF ;
651:
652: return;
653: ELSE
689:
690: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
691:
692: IF l_debug_flag THEN
693: Eng_Workflow_Util.Close_Debug_Session ;
694: END IF ;
695:
696: -- The line below records this function call in the error system
697: -- in the case of an exception.
702:
703: WHEN OTHERS THEN
704:
705: IF l_debug_flag THEN
706: Eng_Workflow_Util.Close_Debug_Session ;
707: END IF ;
708:
709: -- The line below records this function call in the error system
710: -- in the case of an exception.
738: -- RUN mode - normal process execution
739: --
740: if (funcmode = 'RUN') then
741:
742: Eng_Workflow_Util.Get_Debug_Mode
743: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
744:
745: -- For Test/Debug
746: IF l_debug_flag THEN
744:
745: -- For Test/Debug
746: IF l_debug_flag THEN
747:
748: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
749: , l_debug_filename || actid ) ;
750: END IF ;
751:
752: -- Set Reviewers Role
749: , l_debug_filename || actid ) ;
750: END IF ;
751:
752: -- Set Reviewers Role
753: Eng_Workflow_Util.SetLineReviewersRole
754: ( x_return_status => l_return_status
755: , x_msg_count => l_msg_count
756: , x_msg_data => l_msg_data
757: , p_item_type => itemtype
763:
764: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
765:
766: IF l_debug_flag THEN
767: Eng_Workflow_Util.Close_Debug_Session ;
768: END IF ;
769:
770:
771: -- set result
772: result := 'COMPLETE';
773: return;
774:
775: -- None
776: ELSIF l_return_status = Eng_Workflow_Util.G_RET_STS_NONE THEN
777:
778: IF l_debug_flag THEN
779: Eng_Workflow_Util.Close_Debug_Session ;
780: END IF ;
775: -- None
776: ELSIF l_return_status = Eng_Workflow_Util.G_RET_STS_NONE THEN
777:
778: IF l_debug_flag THEN
779: Eng_Workflow_Util.Close_Debug_Session ;
780: END IF ;
781:
782:
783: -- set result
822: EXCEPTION
823:
824: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
825: IF l_debug_flag THEN
826: Eng_Workflow_Util.Close_Debug_Session ;
827: END IF ;
828:
829: -- The line below records this function call in the error system
830: -- in the case of an exception.
834:
835:
836: WHEN OTHERS THEN
837: IF l_debug_flag THEN
838: Eng_Workflow_Util.Close_Debug_Session ;
839: END IF ;
840:
841: -- The line below records this function call in the error system
842: -- in the case of an exception.
868: --
869: if (funcmode = 'RUN') then
870:
871: -- Set Reviewers Role
872: Eng_Workflow_Util.SetLineReviewersRole
873: ( x_return_status => l_return_status
874: , x_msg_count => l_msg_count
875: , x_msg_data => l_msg_data
876: , p_item_type => itemtype
885: result := 'COMPLETE';
886: return;
887:
888: -- None
889: ELSIF l_return_status = Eng_Workflow_Util.G_RET_STS_NONE THEN
890:
891: -- set result
892: result := 'COMPLETE:NONE';
893: return;
970: if (funcmode = 'RUN') then
971:
972:
973: -- Get Chagne Id
974: Eng_Workflow_Util.GetChangeObject
975: ( p_item_type => itemtype
976: , p_item_key => itemkey
977: , x_change_id => l_change_id
978: ) ;
977: , x_change_id => l_change_id
978: ) ;
979:
980: -- Get Host URL
981: Eng_Workflow_Util.GetHostURL
982: ( p_item_type => itemtype
983: , p_item_key => itemkey
984: , x_host_url => l_host_url
985: ) ;
984: , x_host_url => l_host_url
985: ) ;
986:
987: -- Get WF User Id
988: Eng_Workflow_Util.GetWFUserId
989: ( p_item_type => itemtype
990: , p_item_key => itemkey
991: , x_wf_user_id => l_wf_user_id
992: ) ;
994:
995:
996: -- Start Change Lines Initiate Change Workflows
997: -- ENGCLACT:INITIATE_CHANGE
998: Eng_Workflow_Util.StartAllLineWorkflows
999: ( x_return_status => l_return_status
1000: , x_msg_count => l_msg_count
1001: , x_msg_data => l_msg_data
1002: , p_item_type => itemtype
1003: , p_item_key => itemkey
1004: , p_change_id => l_change_id
1005: , p_wf_user_id => l_wf_user_id
1006: , p_host_url => l_host_url
1007: , p_line_item_type => Eng_Workflow_Util.G_CHANGE_LINE_ACTION_ITEM_TYPE
1008: , p_line_process_name => Eng_Workflow_Util.G_CL_INITIATE_CHANGE_PROC
1009: ) ;
1010:
1011: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
1004: , p_change_id => l_change_id
1005: , p_wf_user_id => l_wf_user_id
1006: , p_host_url => l_host_url
1007: , p_line_item_type => Eng_Workflow_Util.G_CHANGE_LINE_ACTION_ITEM_TYPE
1008: , p_line_process_name => Eng_Workflow_Util.G_CL_INITIATE_CHANGE_PROC
1009: ) ;
1010:
1011: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
1012:
1088: --
1089: if (funcmode = 'RUN') then
1090:
1091: -- Set Adhoc Party Role
1092: Eng_Workflow_Util.SetRoutePeopleRole
1093: ( x_return_status => l_return_status
1094: , x_msg_count => l_msg_count
1095: , x_msg_data => l_msg_data
1096: , p_item_type => itemtype
1104: result := 'COMPLETE';
1105: return;
1106:
1107: -- None
1108: ELSIF l_return_status = Eng_Workflow_Util.G_RET_STS_NONE THEN
1109:
1110: -- set result
1111: result := 'COMPLETE:NONE';
1112: return;
1187: --
1188: if (funcmode = 'RUN') then
1189:
1190: -- Set Adhoc Party Role
1191: Eng_Workflow_Util.SetStepPeopleRole
1192: ( x_return_status => l_return_status
1193: , x_msg_count => l_msg_count
1194: , x_msg_data => l_msg_data
1195: , p_item_type => itemtype
1203: result := 'COMPLETE';
1204: return;
1205:
1206: -- None
1207: ELSIF l_return_status = Eng_Workflow_Util.G_RET_STS_NONE THEN
1208:
1209: -- set result
1210: result := 'COMPLETE:NONE';
1211: return;
1286: --
1287: if (funcmode = 'RUN') then
1288:
1289: -- Delete Workflow Adhoc Role and Local Users
1290: Eng_Workflow_Util.DeleteAdhocRolesAndUsers
1291: ( x_return_status => l_return_status
1292: , x_msg_count => l_msg_count
1293: , x_msg_data => l_msg_data
1294: , p_item_type => itemtype
1383: --
1384: if (funcmode = 'RUN') then
1385:
1386: -- Get Response Timeout Min
1387: Eng_Workflow_Util.GetNtfResponseTimeOut
1388: ( p_item_type => itemtype
1389: , p_item_key => itemkey
1390: , x_timeout_min => l_timeout_min
1391: ) ;
1392:
1393: IF l_timeout_min IS NULL
1394: THEN
1395: -- Get Action Id
1396: Eng_Workflow_Util.GetActionId
1397: ( p_item_type => itemtype
1398: , p_item_key => itemkey
1399: , x_action_id => l_action_id
1400: ) ;
1410: -- 115.10
1411: -- The Response By Date is still null for Reqeust Comment Action
1412: -- This call is just for fugure reference
1413: -- Set Response Timeout Min
1414: Eng_Workflow_Util.SetNtfResponseTimeOut
1415: ( p_item_type => itemtype
1416: , p_item_key => itemkey
1417: , p_response_by_date => l_response_by_date
1418: ) ;
1499: --
1500: if (funcmode = 'RUN') then
1501:
1502: -- Get Route Step Id
1503: Eng_Workflow_Util.GetRouteStepId
1504: ( p_item_type => itemtype
1505: , p_item_key => itemkey
1506: , x_route_step_id => l_route_step_id
1507: ) ;
1517: END LOOP ;
1518:
1519: -- Set Step Action Voting Option based on step condition type
1520: -- code
1521: Eng_Workflow_Util.SetStepActVotingOption
1522: ( p_item_type => itemtype
1523: , p_item_key => itemkey
1524: , p_condition_type_code => l_condition_type_code
1525: ) ;
1524: , p_condition_type_code => l_condition_type_code
1525: ) ;
1526:
1527: -- Get Response Timeout Min
1528: Eng_Workflow_Util.GetNtfResponseTimeOut
1529: ( p_item_type => itemtype
1530: , p_item_key => itemkey
1531: , x_timeout_min => l_timeout_min
1532: ) ;
1538: -- Comment out for reminder notification
1539: -- We disabled time out functionality
1540: --
1541: -- Set Response Timeout Min
1542: -- Eng_Workflow_Util.SetNtfResponseTimeOut
1543: -- ( p_item_type => itemtype
1544: -- , p_item_key => itemkey
1545: -- , p_response_by_date => l_response_by_date
1546: -- ) ;
1547: --
1548:
1549: -- Use the number of days to set Response TimeOut
1550: -- Set Response Timeout Min
1551: Eng_Workflow_Util.SetNtfResponseTimeOut
1552: ( p_item_type => itemtype
1553: , p_item_key => itemkey
1554: , p_required_relative_days => l_required_relative_days
1555: ) ;
1655: --
1656: if (funcmode = 'RUN') then
1657:
1658:
1659: Eng_Workflow_Util.Get_Debug_Mode
1660: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
1661:
1662: -- For Test/Debug
1663: IF l_debug_flag THEN
1660: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
1661:
1662: -- For Test/Debug
1663: IF l_debug_flag THEN
1664: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
1665: , 'RUN:RESPOND_TO_COMMENT_REQUEST-' || actid ) ;
1666: END IF ;
1667:
1668: IF l_debug_flag THEN
1665: , 'RUN:RESPOND_TO_COMMENT_REQUEST-' || actid ) ;
1666: END IF ;
1667:
1668: IF l_debug_flag THEN
1669: Eng_Workflow_Util.Write_Debug('calling VoteForReuslt. . . ' ) ;
1670: END IF ;
1671:
1672:
1673: /* Bug2885157
1677: , funcmode
1678: , result ) ;
1679: */
1680:
1681: Eng_Workflow_Util.RouteStepVoteForResultType
1682: ( itemtype
1683: , itemkey
1684: , actid
1685: , funcmode
1686: , result ) ;
1687:
1688:
1689: IF l_debug_flag THEN
1690: Eng_Workflow_Util.Close_Debug_Session ;
1691: END IF ;
1692:
1693: return;
1694:
1702: --
1703: if (funcmode = 'RESPOND') then
1704:
1705:
1706: Eng_Workflow_Util.Get_Debug_Mode
1707: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
1708:
1709: -- For Test/Debug
1710: IF l_debug_flag THEN
1707: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
1708:
1709: -- For Test/Debug
1710: IF l_debug_flag THEN
1711: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
1712: , l_debug_filename || actid ) ;
1713: END IF ;
1714:
1715:
1719: , aname => 'RESULT'
1720: );
1721:
1722: -- Record Action
1723: Eng_Workflow_Util.CreateAction
1724: ( x_return_status => l_return_status
1725: , x_msg_count => l_msg_count
1726: , x_msg_data => l_msg_data
1727: , p_item_type => itemtype
1726: , x_msg_data => l_msg_data
1727: , p_item_type => itemtype
1728: , p_item_key => itemkey
1729: , p_notification_id => WF_ENGINE.context_nid
1730: , p_action_type => Eng_Workflow_Util.G_ACT_REPLIED
1731: , x_action_id => l_created_action_id
1732: , p_raise_event_flag => FND_API.G_TRUE -- R12
1733: ) ;
1734:
1733: ) ;
1734:
1735:
1736: IF l_debug_flag THEN
1737: Eng_Workflow_Util.Write_Debug('After call Eng_Workflow_Util.CreateAction: Return: ' || l_return_status ) ;
1738: END IF ;
1739:
1740:
1741: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1748:
1749:
1750: -- Send Reponse FYI notification to original requestor of
1751: -- the comment request from Response FYI process
1752: Eng_Workflow_Util.START_RESPONSE_FYI_PROCESS
1753: ( p_itemtype => itemtype
1754: , p_itemkey => itemkey
1755: , p_orig_response_option => NULL
1756: , p_responded_ntf_id => WF_ENGINE.context_nid
1766: -- set result
1767: result := 'COMPLETE';
1768:
1769: IF l_debug_flag THEN
1770: Eng_Workflow_Util.Close_Debug_Session ;
1771: END IF ;
1772:
1773: return;
1774:
1825:
1826: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1827:
1828: IF l_debug_flag THEN
1829: Eng_Workflow_Util.Close_Debug_Session ;
1830: END IF ;
1831:
1832: -- The line below records this function call in the error system
1833: -- in the case of an exception.
1838:
1839: WHEN OTHERS THEN
1840:
1841: IF l_debug_flag THEN
1842: Eng_Workflow_Util.Close_Debug_Session ;
1843: END IF ;
1844:
1845: -- The line below records this function call in the error system
1846: -- in the case of an exception.
1877: -- RUN mode - normal process execution
1878: --
1879: if (funcmode = 'RUN') then
1880:
1881: Eng_Workflow_Util.Get_Debug_Mode
1882: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
1883:
1884: -- For Test/Debug
1885: IF l_debug_flag THEN
1882: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
1883:
1884: -- For Test/Debug
1885: IF l_debug_flag THEN
1886: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
1887: , l_debug_filename || '-' || funcmode || '-' || actid ) ;
1888: END IF ;
1889:
1890: IF l_debug_flag THEN
1887: , l_debug_filename || '-' || funcmode || '-' || actid ) ;
1888: END IF ;
1889:
1890: IF l_debug_flag THEN
1891: Eng_Workflow_Util.Write_Debug('calling VoteForReuslt. . . ' ) ;
1892: END IF ;
1893:
1894:
1895: /* Bug2885157
1899: , funcmode
1900: , result ) ;
1901: */
1902:
1903: Eng_Workflow_Util.RouteStepVoteForResultType
1904: ( itemtype
1905: , itemkey
1906: , actid
1907: , funcmode
1909:
1910:
1911: -- For Test/Debug
1912: IF l_debug_flag THEN
1913: Eng_Workflow_Util.Write_Debug('itemtype: ' || itemtype ) ;
1914: Eng_Workflow_Util.Write_Debug('itemkey: ' || itemkey ) ;
1915: Eng_Workflow_Util.Write_Debug('actid: ' || actid ) ;
1916: Eng_Workflow_Util.Write_Debug('funcmode: ' || funcmode ) ;
1917: Eng_Workflow_Util.Write_Debug('result: ' || result ) ;
1910:
1911: -- For Test/Debug
1912: IF l_debug_flag THEN
1913: Eng_Workflow_Util.Write_Debug('itemtype: ' || itemtype ) ;
1914: Eng_Workflow_Util.Write_Debug('itemkey: ' || itemkey ) ;
1915: Eng_Workflow_Util.Write_Debug('actid: ' || actid ) ;
1916: Eng_Workflow_Util.Write_Debug('funcmode: ' || funcmode ) ;
1917: Eng_Workflow_Util.Write_Debug('result: ' || result ) ;
1918: END IF ;
1911: -- For Test/Debug
1912: IF l_debug_flag THEN
1913: Eng_Workflow_Util.Write_Debug('itemtype: ' || itemtype ) ;
1914: Eng_Workflow_Util.Write_Debug('itemkey: ' || itemkey ) ;
1915: Eng_Workflow_Util.Write_Debug('actid: ' || actid ) ;
1916: Eng_Workflow_Util.Write_Debug('funcmode: ' || funcmode ) ;
1917: Eng_Workflow_Util.Write_Debug('result: ' || result ) ;
1918: END IF ;
1919:
1912: IF l_debug_flag THEN
1913: Eng_Workflow_Util.Write_Debug('itemtype: ' || itemtype ) ;
1914: Eng_Workflow_Util.Write_Debug('itemkey: ' || itemkey ) ;
1915: Eng_Workflow_Util.Write_Debug('actid: ' || actid ) ;
1916: Eng_Workflow_Util.Write_Debug('funcmode: ' || funcmode ) ;
1917: Eng_Workflow_Util.Write_Debug('result: ' || result ) ;
1918: END IF ;
1919:
1920:
1913: Eng_Workflow_Util.Write_Debug('itemtype: ' || itemtype ) ;
1914: Eng_Workflow_Util.Write_Debug('itemkey: ' || itemkey ) ;
1915: Eng_Workflow_Util.Write_Debug('actid: ' || actid ) ;
1916: Eng_Workflow_Util.Write_Debug('funcmode: ' || funcmode ) ;
1917: Eng_Workflow_Util.Write_Debug('result: ' || result ) ;
1918: END IF ;
1919:
1920:
1921: IF l_debug_flag THEN
1918: END IF ;
1919:
1920:
1921: IF l_debug_flag THEN
1922: Eng_Workflow_Util.Close_Debug_Session ;
1923: END IF ;
1924:
1925: return;
1926:
1933: --
1934: if (funcmode = 'RESPOND') then
1935:
1936:
1937: -- Eng_Workflow_Util.Get_Debug_Mode
1938: -- (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
1939:
1940: -- For Test/Debug
1941: IF l_debug_flag THEN
1938: -- (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
1939:
1940: -- For Test/Debug
1941: IF l_debug_flag THEN
1942: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
1943: , l_debug_filename || actid ) ;
1944: END IF ;
1945:
1946: l_response_code := WF_NOTIFICATION.GetAttrText
1948: , aname => 'RESULT'
1949: );
1950:
1951: -- Record Route Response
1952: Eng_Workflow_Util.SetRouteResponse
1953: ( x_return_status => l_return_status
1954: , x_msg_count => l_msg_count
1955: , x_msg_data => l_msg_data
1956: , p_item_type => itemtype
1962: ) ;
1963:
1964:
1965: IF l_debug_flag THEN
1966: Eng_Workflow_Util.Write_Debug('After call Eng_Workflow_Util.SetRouteResponse: Return: ' || l_return_status ) ;
1967: END IF ;
1968:
1969:
1970: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
1972: -- set result
1973: result := 'COMPLETE';
1974:
1975: IF l_debug_flag THEN
1976: Eng_Workflow_Util.Close_Debug_Session ;
1977: END IF ;
1978:
1979: return;
1980:
1996: -- Notificaction Reassignment
1997: --
1998: if (funcmode = 'TRANSFER' OR funcmode = 'FORWARD' )
1999: then
2000: Eng_Workflow_Util.reassignRoutePeople( x_return_status => l_return_status
2001: , x_msg_count => l_msg_count
2002: , x_msg_data => l_msg_data
2003: , p_item_type => itemtype
2004: , p_item_key => itemkey
2040:
2041: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2042:
2043: IF l_debug_flag THEN
2044: Eng_Workflow_Util.Close_Debug_Session ;
2045: END IF ;
2046:
2047: -- The line below records this function call in the error system
2048: -- in the case of an exception.
2053:
2054: WHEN OTHERS THEN
2055:
2056: IF l_debug_flag THEN
2057: Eng_Workflow_Util.Close_Debug_Session ;
2058: END IF ;
2059:
2060: -- The line below records this function call in the error system
2061: -- in the case of an exception.
2094: -- RUN mode - normal process execution
2095: --
2096: if (funcmode = 'RUN') then
2097:
2098: Eng_Workflow_Util.Get_Debug_Mode
2099: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
2100:
2101:
2102: -- For Test/Debug
2100:
2101:
2102: -- For Test/Debug
2103: IF l_debug_flag THEN
2104: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
2105: , l_debug_filename || actid ) ;
2106: END IF ;
2107:
2108: IF l_debug_flag THEN
2105: , l_debug_filename || actid ) ;
2106: END IF ;
2107:
2108: IF l_debug_flag THEN
2109: Eng_Workflow_Util.Write_Debug('calling VoteForReuslt. . . ' ) ;
2110: END IF ;
2111:
2112: /* Bug2885157
2113: WF_STANDARD.VoteForResultType ( itemtype
2116: , funcmode
2117: , result ) ;
2118: */
2119:
2120: Eng_Workflow_Util.RouteStepVoteForResultType
2121: ( itemtype
2122: , itemkey
2123: , actid
2124: , funcmode
2125: , result ) ;
2126:
2127:
2128: IF l_debug_flag THEN
2129: Eng_Workflow_Util.Close_Debug_Session ;
2130: END IF ;
2131:
2132: return;
2133:
2141: --
2142: if (funcmode = 'RESPOND') then
2143:
2144:
2145: Eng_Workflow_Util.Get_Debug_Mode
2146: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
2147:
2148: -- For Test/Debug
2149: IF l_debug_flag THEN
2146: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
2147:
2148: -- For Test/Debug
2149: IF l_debug_flag THEN
2150: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
2151: , l_debug_filename || actid ) ;
2152: END IF ;
2153:
2154:
2158: , aname => 'RESULT'
2159: );
2160:
2161: -- Record Route Response
2162: Eng_Workflow_Util.SetRouteResponse
2163: ( x_return_status => l_return_status
2164: , x_msg_count => l_msg_count
2165: , x_msg_data => l_msg_data
2166: , p_item_type => itemtype
2165: , x_msg_data => l_msg_data
2166: , p_item_type => itemtype
2167: , p_item_key => itemkey
2168: , p_notification_id => WF_ENGINE.context_nid
2169: , p_response_code => Eng_Workflow_Util.G_RT_REPLIED
2170: , p_actid => actid
2171: , p_funcmode => funcmode
2172: ) ;
2173:
2171: , p_funcmode => funcmode
2172: ) ;
2173:
2174: IF l_debug_flag THEN
2175: Eng_Workflow_Util.Write_Debug('After call Eng_Workflow_Util.SetRouteResponse: Return: ' || l_return_status ) ;
2176: END IF ;
2177:
2178:
2179: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
2181: -- set result
2182: result := 'COMPLETE';
2183:
2184: IF l_debug_flag THEN
2185: Eng_Workflow_Util.Close_Debug_Session ;
2186: END IF ;
2187:
2188:
2189: return;
2198:
2199: /*
2200: -- Send Reponse FYI notification to original requestor of
2201: -- the comment request from Response FYI process
2202: Eng_Workflow_Util.START_RESPONSE_FYI_PROCESS
2203: ( p_itemtype => itemtype
2204: , p_itemkey => itemkey
2205: , p_orig_response_option => NULL
2206: , p_responded_ntf_id => WF_ENGINE.context_nid
2216: -- set result
2217: result := 'COMPLETE';
2218:
2219: IF l_debug_flag THEN
2220: Eng_Workflow_Util.Close_Debug_Session ;
2221: END IF ;
2222:
2223: return;
2224:
2238: -- Notificaction Reassignment
2239: --
2240: if (funcmode = 'TRANSFER' OR funcmode = 'FORWARD' )
2241: then
2242: Eng_Workflow_Util.reassignRoutePeople( x_return_status => l_return_status
2243: , x_msg_count => l_msg_count
2244: , x_msg_data => l_msg_data
2245: , p_item_type => itemtype
2246: , p_item_key => itemkey
2283:
2284: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2285:
2286: IF l_debug_flag THEN
2287: Eng_Workflow_Util.Close_Debug_Session ;
2288: END IF ;
2289:
2290: -- The line below records this function call in the error system
2291: -- in the case of an exception.
2296:
2297: WHEN OTHERS THEN
2298:
2299: IF l_debug_flag THEN
2300: Eng_Workflow_Util.Close_Debug_Session ;
2301: END IF ;
2302:
2303: -- The line below records this function call in the error system
2304: -- in the case of an exception.
2340: -- RUN mode - normal process execution
2341: --
2342: if (funcmode = 'RUN') then
2343:
2344: Eng_Workflow_Util.Get_Debug_Mode
2345: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
2346:
2347:
2348: -- For Test/Debug
2346:
2347:
2348: -- For Test/Debug
2349: IF l_debug_flag THEN
2350: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
2351: , l_debug_filename || '-' || funcmode || '-' || actid ) ;
2352: END IF ;
2353:
2354: IF l_debug_flag THEN
2351: , l_debug_filename || '-' || funcmode || '-' || actid ) ;
2352: END IF ;
2353:
2354: IF l_debug_flag THEN
2355: Eng_Workflow_Util.Write_Debug('calling VoteForReuslt. . . ' ) ;
2356: END IF ;
2357:
2358:
2359: /* Bug2885157
2363: , funcmode
2364: , result ) ;
2365: */
2366:
2367: Eng_Workflow_Util.RouteStepVoteForResultType
2368: ( itemtype
2369: , itemkey
2370: , actid
2371: , funcmode
2373:
2374:
2375: -- For Test/Debug
2376: IF l_debug_flag THEN
2377: Eng_Workflow_Util.Write_Debug('itemtype: ' || itemtype ) ;
2378: Eng_Workflow_Util.Write_Debug('itemkey: ' || itemkey ) ;
2379: Eng_Workflow_Util.Write_Debug('actid: ' || actid ) ;
2380: Eng_Workflow_Util.Write_Debug('funcmode: ' || funcmode ) ;
2381: Eng_Workflow_Util.Write_Debug('result: ' || result ) ;
2374:
2375: -- For Test/Debug
2376: IF l_debug_flag THEN
2377: Eng_Workflow_Util.Write_Debug('itemtype: ' || itemtype ) ;
2378: Eng_Workflow_Util.Write_Debug('itemkey: ' || itemkey ) ;
2379: Eng_Workflow_Util.Write_Debug('actid: ' || actid ) ;
2380: Eng_Workflow_Util.Write_Debug('funcmode: ' || funcmode ) ;
2381: Eng_Workflow_Util.Write_Debug('result: ' || result ) ;
2382: END IF ;
2375: -- For Test/Debug
2376: IF l_debug_flag THEN
2377: Eng_Workflow_Util.Write_Debug('itemtype: ' || itemtype ) ;
2378: Eng_Workflow_Util.Write_Debug('itemkey: ' || itemkey ) ;
2379: Eng_Workflow_Util.Write_Debug('actid: ' || actid ) ;
2380: Eng_Workflow_Util.Write_Debug('funcmode: ' || funcmode ) ;
2381: Eng_Workflow_Util.Write_Debug('result: ' || result ) ;
2382: END IF ;
2383:
2376: IF l_debug_flag THEN
2377: Eng_Workflow_Util.Write_Debug('itemtype: ' || itemtype ) ;
2378: Eng_Workflow_Util.Write_Debug('itemkey: ' || itemkey ) ;
2379: Eng_Workflow_Util.Write_Debug('actid: ' || actid ) ;
2380: Eng_Workflow_Util.Write_Debug('funcmode: ' || funcmode ) ;
2381: Eng_Workflow_Util.Write_Debug('result: ' || result ) ;
2382: END IF ;
2383:
2384:
2377: Eng_Workflow_Util.Write_Debug('itemtype: ' || itemtype ) ;
2378: Eng_Workflow_Util.Write_Debug('itemkey: ' || itemkey ) ;
2379: Eng_Workflow_Util.Write_Debug('actid: ' || actid ) ;
2380: Eng_Workflow_Util.Write_Debug('funcmode: ' || funcmode ) ;
2381: Eng_Workflow_Util.Write_Debug('result: ' || result ) ;
2382: END IF ;
2383:
2384:
2385: IF l_debug_flag THEN
2382: END IF ;
2383:
2384:
2385: IF l_debug_flag THEN
2386: Eng_Workflow_Util.Close_Debug_Session ;
2387: END IF ;
2388:
2389: return;
2390:
2397: --
2398: if (funcmode = 'RESPOND') then
2399:
2400:
2401: Eng_Workflow_Util.Get_Debug_Mode
2402: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
2403:
2404: -- For Test/Debug
2405: IF l_debug_flag THEN
2402: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
2403:
2404: -- For Test/Debug
2405: IF l_debug_flag THEN
2406: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
2407: , l_debug_filename || actid ) ;
2408: END IF ;
2409:
2410: l_response_code := WF_NOTIFICATION.GetAttrText
2412: , aname => 'RESULT'
2413: );
2414:
2415: -- Record Route Response
2416: Eng_Workflow_Util.SetRouteResponse
2417: ( x_return_status => l_return_status
2418: , x_msg_count => l_msg_count
2419: , x_msg_data => l_msg_data
2420: , p_item_type => itemtype
2426: ) ;
2427:
2428:
2429: IF l_debug_flag THEN
2430: Eng_Workflow_Util.Write_Debug('After call Eng_Workflow_Util.SetRouteResponse: Return: ' || l_return_status ) ;
2431: END IF ;
2432:
2433: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2434: -- Unexpected Exception
2437: END IF ;
2438:
2439:
2440: -- Get Host URL
2441: Eng_Workflow_Util.GetHostURL
2442: ( p_item_type => itemtype
2443: , p_item_key => itemkey
2444: , x_host_url => l_host_url
2445: ) ;
2444: , x_host_url => l_host_url
2445: ) ;
2446:
2447: -- Get WF User Id
2448: Eng_Workflow_Util.GetWFUserId
2449: ( p_item_type => itemtype
2450: , p_item_key => itemkey
2451: , x_wf_user_id => l_wf_user_id
2452: ) ;
2451: , x_wf_user_id => l_wf_user_id
2452: ) ;
2453:
2454: -- Get Route Id
2455: Eng_Workflow_Util.GetRouteId
2456: ( p_item_type => itemtype
2457: , p_item_key => itemkey
2458: , x_route_id => l_route_id
2459: ) ;
2458: , x_route_id => l_route_id
2459: ) ;
2460:
2461: -- Get Route Step Id
2462: Eng_Workflow_Util.GetRouteStepId
2463: ( p_item_type => itemtype
2464: , p_item_key => itemkey
2465: , x_route_step_id => l_route_step_id
2466: ) ;
2472: -- Starting a place folder def process with no validation
2473: -- per each response does not seem to be right
2474: -- Also we don't document this yet
2475: -- Start Workflow to validate definitions
2476: -- Eng_Workflow_Util.StartValidateDefProcess
2477: -- ( x_msg_count => l_msg_count
2478: -- , x_msg_data => l_msg_data
2479: -- , x_return_status => l_return_status
2480: -- , x_val_def_item_key => l_val_def_item_key
2482: -- , p_step_item_key => itemkey
2483: -- , p_responded_ntf_id => WF_ENGINE.context_nid
2484: -- , p_route_id => l_route_id
2485: -- , p_route_step_id => l_route_step_id
2486: -- , p_val_def_item_type => Eng_Workflow_Util.G_CHANGE_ROUTE_STEP_ITEM_TYPE
2487: -- , p_val_def_process_name => Eng_Workflow_Util.G_VALIDATE_DEFINITION_PROC
2488: -- , p_host_url => l_host_url
2489: -- , p_orig_response => l_response_code
2490: -- ) ;
2483: -- , p_responded_ntf_id => WF_ENGINE.context_nid
2484: -- , p_route_id => l_route_id
2485: -- , p_route_step_id => l_route_step_id
2486: -- , p_val_def_item_type => Eng_Workflow_Util.G_CHANGE_ROUTE_STEP_ITEM_TYPE
2487: -- , p_val_def_process_name => Eng_Workflow_Util.G_VALIDATE_DEFINITION_PROC
2488: -- , p_host_url => l_host_url
2489: -- , p_orig_response => l_response_code
2490: -- ) ;
2491: --
2495: -- set result
2496: result := 'COMPLETE';
2497:
2498: IF l_debug_flag THEN
2499: Eng_Workflow_Util.Close_Debug_Session ;
2500: END IF ;
2501:
2502: return;
2503:
2519: -- Notificaction Reassignment
2520: --
2521: if (funcmode = 'TRANSFER' OR funcmode = 'FORWARD' )
2522: then
2523: Eng_Workflow_Util.reassignRoutePeople( x_return_status => l_return_status
2524: , x_msg_count => l_msg_count
2525: , x_msg_data => l_msg_data
2526: , p_item_type => itemtype
2527: , p_item_key => itemkey
2564:
2565: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2566:
2567: IF l_debug_flag THEN
2568: Eng_Workflow_Util.Close_Debug_Session ;
2569: END IF ;
2570:
2571: -- The line below records this function call in the error system
2572: -- in the case of an exception.
2577:
2578: WHEN OTHERS THEN
2579:
2580: IF l_debug_flag THEN
2581: Eng_Workflow_Util.Close_Debug_Session ;
2582: END IF ;
2583:
2584: -- The line below records this function call in the error system
2585: -- in the case of an exception.
2621: -- RUN mode - normal process execution
2622: --
2623: if (funcmode = 'RUN') then
2624:
2625: Eng_Workflow_Util.Get_Debug_Mode
2626: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
2627:
2628:
2629: -- For Test/Debug
2627:
2628:
2629: -- For Test/Debug
2630: IF l_debug_flag THEN
2631: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
2632: , l_debug_filename || '-' || funcmode || '-' || actid ) ;
2633: END IF ;
2634:
2635: IF l_debug_flag THEN
2632: , l_debug_filename || '-' || funcmode || '-' || actid ) ;
2633: END IF ;
2634:
2635: IF l_debug_flag THEN
2636: Eng_Workflow_Util.Write_Debug('calling VoteForReuslt. . . ' ) ;
2637: END IF ;
2638:
2639:
2640: /* Bug2885157
2644: , funcmode
2645: , result ) ;
2646: */
2647:
2648: Eng_Workflow_Util.RouteStepVoteForResultType
2649: ( itemtype
2650: , itemkey
2651: , actid
2652: , funcmode
2654:
2655:
2656: -- For Test/Debug
2657: IF l_debug_flag THEN
2658: Eng_Workflow_Util.Write_Debug('itemtype: ' || itemtype ) ;
2659: Eng_Workflow_Util.Write_Debug('itemkey: ' || itemkey ) ;
2660: Eng_Workflow_Util.Write_Debug('actid: ' || actid ) ;
2661: Eng_Workflow_Util.Write_Debug('funcmode: ' || funcmode ) ;
2662: Eng_Workflow_Util.Write_Debug('result: ' || result ) ;
2655:
2656: -- For Test/Debug
2657: IF l_debug_flag THEN
2658: Eng_Workflow_Util.Write_Debug('itemtype: ' || itemtype ) ;
2659: Eng_Workflow_Util.Write_Debug('itemkey: ' || itemkey ) ;
2660: Eng_Workflow_Util.Write_Debug('actid: ' || actid ) ;
2661: Eng_Workflow_Util.Write_Debug('funcmode: ' || funcmode ) ;
2662: Eng_Workflow_Util.Write_Debug('result: ' || result ) ;
2663: END IF ;
2656: -- For Test/Debug
2657: IF l_debug_flag THEN
2658: Eng_Workflow_Util.Write_Debug('itemtype: ' || itemtype ) ;
2659: Eng_Workflow_Util.Write_Debug('itemkey: ' || itemkey ) ;
2660: Eng_Workflow_Util.Write_Debug('actid: ' || actid ) ;
2661: Eng_Workflow_Util.Write_Debug('funcmode: ' || funcmode ) ;
2662: Eng_Workflow_Util.Write_Debug('result: ' || result ) ;
2663: END IF ;
2664:
2657: IF l_debug_flag THEN
2658: Eng_Workflow_Util.Write_Debug('itemtype: ' || itemtype ) ;
2659: Eng_Workflow_Util.Write_Debug('itemkey: ' || itemkey ) ;
2660: Eng_Workflow_Util.Write_Debug('actid: ' || actid ) ;
2661: Eng_Workflow_Util.Write_Debug('funcmode: ' || funcmode ) ;
2662: Eng_Workflow_Util.Write_Debug('result: ' || result ) ;
2663: END IF ;
2664:
2665:
2658: Eng_Workflow_Util.Write_Debug('itemtype: ' || itemtype ) ;
2659: Eng_Workflow_Util.Write_Debug('itemkey: ' || itemkey ) ;
2660: Eng_Workflow_Util.Write_Debug('actid: ' || actid ) ;
2661: Eng_Workflow_Util.Write_Debug('funcmode: ' || funcmode ) ;
2662: Eng_Workflow_Util.Write_Debug('result: ' || result ) ;
2663: END IF ;
2664:
2665:
2666: IF l_debug_flag THEN
2663: END IF ;
2664:
2665:
2666: IF l_debug_flag THEN
2667: Eng_Workflow_Util.Close_Debug_Session ;
2668: END IF ;
2669:
2670: return;
2671:
2678: --
2679: if (funcmode = 'RESPOND') then
2680:
2681:
2682: Eng_Workflow_Util.Get_Debug_Mode
2683: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
2684:
2685: -- For Test/Debug
2686: IF l_debug_flag THEN
2683: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
2684:
2685: -- For Test/Debug
2686: IF l_debug_flag THEN
2687: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
2688: , l_debug_filename || actid ) ;
2689: END IF ;
2690:
2691: l_response_code := WF_NOTIFICATION.GetAttrText
2693: , aname => 'RESULT'
2694: );
2695:
2696: -- Record Route Response
2697: Eng_Workflow_Util.SetRouteResponse
2698: ( x_return_status => l_return_status
2699: , x_msg_count => l_msg_count
2700: , x_msg_data => l_msg_data
2701: , p_item_type => itemtype
2707: ) ;
2708:
2709:
2710: IF l_debug_flag THEN
2711: Eng_Workflow_Util.Write_Debug('After call Eng_Workflow_Util.SetRouteResponse: Return: ' || l_return_status ) ;
2712: END IF ;
2713:
2714: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2715: -- Unexpected Exception
2718: END IF ;
2719:
2720:
2721: -- Need to call validation workflow only in case that response is Approved
2722: IF l_response_code = Eng_Workflow_Util.G_RT_APPROVED
2723: THEN
2724:
2725:
2726: -- Get Host URL
2723: THEN
2724:
2725:
2726: -- Get Host URL
2727: Eng_Workflow_Util.GetHostURL
2728: ( p_item_type => itemtype
2729: , p_item_key => itemkey
2730: , x_host_url => l_host_url
2731: ) ;
2730: , x_host_url => l_host_url
2731: ) ;
2732:
2733: -- Get WF User Id
2734: Eng_Workflow_Util.GetWFUserId
2735: ( p_item_type => itemtype
2736: , p_item_key => itemkey
2737: , x_wf_user_id => l_wf_user_id
2738: ) ;
2737: , x_wf_user_id => l_wf_user_id
2738: ) ;
2739:
2740: -- Get Route Id
2741: Eng_Workflow_Util.GetRouteId
2742: ( p_item_type => itemtype
2743: , p_item_key => itemkey
2744: , x_route_id => l_route_id
2745: ) ;
2744: , x_route_id => l_route_id
2745: ) ;
2746:
2747: -- Get Route Step Id
2748: Eng_Workflow_Util.GetRouteStepId
2749: ( p_item_type => itemtype
2750: , p_item_key => itemkey
2751: , x_route_step_id => l_route_step_id
2752: ) ;
2758: -- Starting a place folder def process with no validation
2759: -- per each response does not seem to be right
2760: -- Also we don't document this yet
2761: -- Start Workflow to validate definitions
2762: -- Eng_Workflow_Util.StartValidateDefProcess
2763: -- ( x_msg_count => l_msg_count
2764: -- , x_msg_data => l_msg_data
2765: -- , x_return_status => l_return_status
2766: -- , x_val_def_item_key => l_val_def_item_key
2768: -- , p_step_item_key => itemkey
2769: -- , p_responded_ntf_id => WF_ENGINE.context_nid
2770: -- , p_route_id => l_route_id
2771: -- , p_route_step_id => l_route_step_id
2772: -- , p_val_def_item_type => Eng_Workflow_Util.G_CHANGE_ROUTE_STEP_ITEM_TYPE
2773: -- , p_val_def_process_name => Eng_Workflow_Util.G_VALIDATE_DEFINITION_PROC
2774: -- , p_host_url => l_host_url
2775: -- , p_orig_response => l_response_code
2776: -- ) ;
2769: -- , p_responded_ntf_id => WF_ENGINE.context_nid
2770: -- , p_route_id => l_route_id
2771: -- , p_route_step_id => l_route_step_id
2772: -- , p_val_def_item_type => Eng_Workflow_Util.G_CHANGE_ROUTE_STEP_ITEM_TYPE
2773: -- , p_val_def_process_name => Eng_Workflow_Util.G_VALIDATE_DEFINITION_PROC
2774: -- , p_host_url => l_host_url
2775: -- , p_orig_response => l_response_code
2776: -- ) ;
2777: --
2785: -- set result
2786: result := 'COMPLETE';
2787:
2788: IF l_debug_flag THEN
2789: Eng_Workflow_Util.Close_Debug_Session ;
2790: END IF ;
2791:
2792: return;
2793:
2807: -- Notificaction Reassignment
2808: --
2809: if (funcmode = 'TRANSFER' OR funcmode = 'FORWARD' )
2810: then
2811: Eng_Workflow_Util.reassignRoutePeople( x_return_status => l_return_status
2812: , x_msg_count => l_msg_count
2813: , x_msg_data => l_msg_data
2814: , p_item_type => itemtype
2815: , p_item_key => itemkey
2851:
2852: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2853:
2854: IF l_debug_flag THEN
2855: Eng_Workflow_Util.Close_Debug_Session ;
2856: END IF ;
2857:
2858: -- The line below records this function call in the error system
2859: -- in the case of an exception.
2864:
2865: WHEN OTHERS THEN
2866:
2867: IF l_debug_flag THEN
2868: Eng_Workflow_Util.Close_Debug_Session ;
2869: END IF ;
2870:
2871: -- The line below records this function call in the error system
2872: -- in the case of an exception.
2906: if (funcmode = 'RUN') then
2907:
2908: -- For Test/Debug
2909: IF l_debug_flag THEN
2910: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
2911: , l_debug_filename || actid ) ;
2912: END IF ;
2913:
2914: IF l_debug_flag THEN
2911: , l_debug_filename || actid ) ;
2912: END IF ;
2913:
2914: IF l_debug_flag THEN
2915: Eng_Workflow_Util.Write_Debug('calling VoteForReuslt. . . ' ) ;
2916: END IF ;
2917:
2918: /* Bug2885157
2919: WF_STANDARD.VoteForResultType ( itemtype
2922: , funcmode
2923: , result ) ;
2924: */
2925:
2926: Eng_Workflow_Util.RouteStepVoteForResultType
2927: ( itemtype
2928: , itemkey
2929: , actid
2930: , funcmode
2931: , result ) ;
2932:
2933:
2934: IF l_debug_flag THEN
2935: Eng_Workflow_Util.Close_Debug_Session ;
2936: END IF ;
2937:
2938: return;
2939:
2947: --
2948: if (funcmode = 'RESPOND') then
2949:
2950:
2951: Eng_Workflow_Util.Get_Debug_Mode
2952: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
2953:
2954: -- For Test/Debug
2955: IF l_debug_flag THEN
2952: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
2953:
2954: -- For Test/Debug
2955: IF l_debug_flag THEN
2956: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
2957: , l_debug_filename || actid ) ;
2958: END IF ;
2959:
2960:
2976: -- set result
2977: result := 'COMPLETE';
2978:
2979: IF l_debug_flag THEN
2980: Eng_Workflow_Util.Close_Debug_Session ;
2981: END IF ;
2982:
2983:
2984: return;
3022:
3023: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3024:
3025: IF l_debug_flag THEN
3026: Eng_Workflow_Util.Close_Debug_Session ;
3027: END IF ;
3028:
3029: -- The line below records this function call in the error system
3030: -- in the case of an exception.
3035:
3036: WHEN OTHERS THEN
3037:
3038: IF l_debug_flag THEN
3039: Eng_Workflow_Util.Close_Debug_Session ;
3040: END IF ;
3041:
3042: -- The line below records this function call in the error system
3043: -- in the case of an exception.
3079: -- RUN mode - normal process execution
3080: --
3081: if (funcmode = 'RUN') then
3082:
3083: Eng_Workflow_Util.Get_Debug_Mode
3084: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
3085:
3086:
3087:
3086:
3087:
3088: -- For Test/Debug
3089: IF l_debug_flag THEN
3090: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
3091: , l_debug_filename || actid ) ;
3092: END IF ;
3093:
3094:
3092: END IF ;
3093:
3094:
3095: IF l_debug_flag THEN
3096: Eng_Workflow_Util.Write_Debug('calling VoteForReuslt. . . ' ) ;
3097: END IF ;
3098:
3099: Eng_Workflow_Util.RouteStepVoteForResultType
3100: ( itemtype
3095: IF l_debug_flag THEN
3096: Eng_Workflow_Util.Write_Debug('calling VoteForReuslt. . . ' ) ;
3097: END IF ;
3098:
3099: Eng_Workflow_Util.RouteStepVoteForResultType
3100: ( itemtype
3101: , itemkey
3102: , actid
3103: , funcmode
3104: , result ) ;
3105:
3106:
3107: IF l_debug_flag THEN
3108: Eng_Workflow_Util.Close_Debug_Session ;
3109: END IF ;
3110:
3111: return;
3112:
3120: --
3121: if (funcmode = 'RESPOND') then
3122:
3123:
3124: Eng_Workflow_Util.Get_Debug_Mode
3125: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
3126:
3127: -- For Test/Debug
3128: IF l_debug_flag THEN
3125: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
3126:
3127: -- For Test/Debug
3128: IF l_debug_flag THEN
3129: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
3130: , l_debug_filename || actid ) ;
3131: END IF ;
3132:
3133:
3141: -- R12B Modified to support AUTO_REVOKE_RESPONSE NTF Attribute
3142: -- If the response is the value specified in AUTO_REVOKE_RESPONSE NTF Attribute
3143: -- we will revoke roles on this wf assignee
3144: -- Record Route Response
3145: Eng_Workflow_Util.SetRouteResponse
3146: ( x_return_status => l_return_status
3147: , x_msg_count => l_msg_count
3148: , x_msg_data => l_msg_data
3149: , p_item_type => itemtype
3154: , p_funcmode => funcmode
3155: ) ;
3156:
3157: IF l_debug_flag THEN
3158: Eng_Workflow_Util.Write_Debug('After call Eng_Workflow_Util.SetRouteResponse: Return: ' || l_return_status ) ;
3159: END IF ;
3160:
3161:
3162: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
3164: -- set result
3165: result := 'COMPLETE';
3166:
3167: IF l_debug_flag THEN
3168: Eng_Workflow_Util.Close_Debug_Session ;
3169: END IF ;
3170:
3171:
3172: return;
3181:
3182: /*
3183: -- Send Reponse FYI notification to original requestor of
3184: -- the comment request from Response FYI process
3185: Eng_Workflow_Util.START_RESPONSE_FYI_PROCESS
3186: ( p_itemtype => itemtype
3187: , p_itemkey => itemkey
3188: , p_orig_response_option => NULL
3189: , p_responded_ntf_id => WF_ENGINE.context_nid
3199: -- set result
3200: result := 'COMPLETE';
3201:
3202: IF l_debug_flag THEN
3203: Eng_Workflow_Util.Close_Debug_Session ;
3204: END IF ;
3205:
3206: return;
3207:
3221: -- Notificaction Reassignment
3222: --
3223: if (funcmode = 'TRANSFER' OR funcmode = 'FORWARD' )
3224: then
3225: Eng_Workflow_Util.reassignRoutePeople( x_return_status => l_return_status
3226: , x_msg_count => l_msg_count
3227: , x_msg_data => l_msg_data
3228: , p_item_type => itemtype
3229: , p_item_key => itemkey
3266:
3267: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3268:
3269: IF l_debug_flag THEN
3270: Eng_Workflow_Util.Close_Debug_Session ;
3271: END IF ;
3272:
3273: -- The line below records this function call in the error system
3274: -- in the case of an exception.
3279:
3280: WHEN OTHERS THEN
3281:
3282: IF l_debug_flag THEN
3283: Eng_Workflow_Util.Close_Debug_Session ;
3284: END IF ;
3285:
3286: -- The line below records this function call in the error system
3287: -- in the case of an exception.
3329: if (funcmode = 'RUN') then
3330:
3331:
3332: IF l_debug_flag THEN
3333: Eng_Workflow_Util.Write_Debug('In START_ROUTE_STEP . . . ' ) ;
3334: END IF ;
3335:
3336: -- Get Chagne Id
3337: Eng_Workflow_Util.GetChangeObject
3333: Eng_Workflow_Util.Write_Debug('In START_ROUTE_STEP . . . ' ) ;
3334: END IF ;
3335:
3336: -- Get Chagne Id
3337: Eng_Workflow_Util.GetChangeObject
3338: ( p_item_type => itemtype
3339: , p_item_key => itemkey
3340: , x_change_id => l_change_id
3341: ) ;
3341: ) ;
3342:
3343:
3344: -- Get Chagne Line Id
3345: Eng_Workflow_Util.GetChangeLineObject
3346: ( p_item_type => itemtype
3347: , p_item_key => itemkey
3348: , x_change_line_id => l_change_line_id
3349: ) ;
3348: , x_change_line_id => l_change_line_id
3349: ) ;
3350:
3351: -- Get Host URL
3352: Eng_Workflow_Util.GetHostURL
3353: ( p_item_type => itemtype
3354: , p_item_key => itemkey
3355: , x_host_url => l_host_url
3356: ) ;
3355: , x_host_url => l_host_url
3356: ) ;
3357:
3358: -- Get WF User Id
3359: Eng_Workflow_Util.GetWFUserId
3360: ( p_item_type => itemtype
3361: , p_item_key => itemkey
3362: , x_wf_user_id => l_wf_user_id
3363: ) ;
3362: , x_wf_user_id => l_wf_user_id
3363: ) ;
3364:
3365: -- Get Route Id
3366: Eng_Workflow_Util.GetRouteId
3367: ( p_item_type => itemtype
3368: , p_item_key => itemkey
3369: , x_route_id => l_route_id
3370: ) ;
3369: , x_route_id => l_route_id
3370: ) ;
3371:
3372: IF l_debug_flag THEN
3373: Eng_Workflow_Util.Write_Debug('calling Eng_Workflow_Util.StartNextRouteStep. . . ' ) ;
3374: END IF ;
3375:
3376:
3377: -- Get Action Id for Parent Route to record
3376:
3377: -- Get Action Id for Parent Route to record
3378: -- Individual User Response for the Step into Action log
3379: -- as a child of Parent Action correctly
3380: Eng_Workflow_Util.GetActionId
3381: ( p_item_type => itemtype
3382: , p_item_key => itemkey
3383: , x_action_id => l_action_id
3384: ) ;
3384: ) ;
3385:
3386:
3387: -- Start Next Route Step Workflow
3388: Eng_Workflow_Util.StartNextRouteStep
3389: ( x_return_status => l_return_status
3390: , x_msg_count => l_msg_count
3391: , x_msg_data => l_msg_data
3392: , p_route_item_type => itemtype
3402: , x_step_item_key => l_step_item_key
3403: ) ;
3404:
3405: IF l_debug_flag THEN
3406: Eng_Workflow_Util.Write_Debug('after calling Eng_Workflow_Util.StartNextRouteStep. . . ' ) ;
3407: END IF ;
3408:
3409:
3410: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
3410: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
3411:
3412:
3413: IF l_debug_flag THEN
3414: Eng_Workflow_Util.Write_Debug('Set route step id. ' || to_char(l_route_step_id) ) ;
3415: END IF ;
3416:
3417: -- Set started Step Id as current step id
3418: Eng_Workflow_Util.SetRouteStepId
3414: Eng_Workflow_Util.Write_Debug('Set route step id. ' || to_char(l_route_step_id) ) ;
3415: END IF ;
3416:
3417: -- Set started Step Id as current step id
3418: Eng_Workflow_Util.SetRouteStepId
3419: ( p_item_type => itemtype
3420: , p_item_key => itemkey
3421: , p_route_step_id =>l_route_step_id
3422: ) ;
3424: result := 'COMPLETE';
3425: return;
3426:
3427: -- None
3428: ELSIF l_return_status = Eng_Workflow_Util.G_RET_STS_NONE THEN
3429:
3430: result := 'COMPLETE:NONE';
3431: return;
3432: ELSE
3501: --
3502: if (funcmode = 'RUN') then
3503:
3504: -- Get Route Step Id
3505: Eng_Workflow_Util.GetRouteStepId
3506: ( p_item_type => itemtype
3507: , p_item_key => itemkey
3508: , x_route_step_id => l_route_step_id
3509: ) ;
3508: , x_route_step_id => l_route_step_id
3509: ) ;
3510:
3511: -- Get Route Step Status
3512: Eng_Workflow_Util.GetRouteStepStatus
3513: ( p_item_type => itemtype
3514: , p_item_key => itemkey
3515: , p_route_step_id => l_route_step_id
3516: , x_status_code => l_step_status_code
3583: --
3584: if (funcmode = 'RUN') then
3585:
3586: -- Get Chagne Id
3587: Eng_Workflow_Util.GetChangeObject
3588: ( p_item_type => itemtype
3589: , p_item_key => itemkey
3590: , x_change_id => l_change_id
3591: ) ;
3590: , x_change_id => l_change_id
3591: ) ;
3592:
3593:
3594: Eng_Workflow_Util.CheckAllLineApproved
3595: ( x_return_status => l_return_status
3596: , x_msg_count => l_msg_count
3597: , x_msg_data => l_msg_data
3598: , p_change_id => l_change_id
3684: --
3685: if (funcmode = 'RUN') then
3686:
3687: -- Get Route Id
3688: Eng_Workflow_Util.GetRouteId
3689: ( p_item_type => itemtype
3690: , p_item_key => itemkey
3691: , x_route_id => l_route_id
3692: ) ;
3692: ) ;
3693:
3694:
3695: -- Find Next Route Step Workflow
3696: Eng_Workflow_Util.FindNextRouteStep
3697: ( x_return_status => l_return_status
3698: , x_msg_count => l_msg_count
3699: , x_msg_data => l_msg_data
3700: , p_route_id => l_route_id
3807: --
3808: if (funcmode = 'RUN') then
3809:
3810: -- Get WF User Id
3811: Eng_Workflow_Util.GetWFUserId
3812: ( p_item_type => itemtype
3813: , p_item_key => itemkey
3814: , x_wf_user_id => l_wf_user_id
3815: ) ;
3814: , x_wf_user_id => l_wf_user_id
3815: ) ;
3816:
3817: -- Get Change Object Identifier
3818: Eng_Workflow_Util.GetChangeObject
3819: ( p_item_type => itemtype
3820: , p_item_key => itemkey
3821: , x_change_id => l_change_id
3822: ) ;
3821: , x_change_id => l_change_id
3822: ) ;
3823:
3824: -- Get Chagne Line Id
3825: Eng_Workflow_Util.GetChangeLineObject
3826: ( p_item_type => itemtype
3827: , p_item_key => itemkey
3828: , x_change_line_id => l_change_line_id
3829: ) ;
3829: ) ;
3830:
3831:
3832: -- Get Route Id
3833: Eng_Workflow_Util.GetRouteId
3834: ( p_item_type => itemtype
3835: , p_item_key => itemkey
3836: , x_route_id => l_route_id
3837: ) ;
3836: , x_route_id => l_route_id
3837: ) ;
3838:
3839: -- Get Route Type Code
3840: Eng_Workflow_Util.GetRouteTypeCode
3841: ( p_route_id => l_route_id
3842: , x_route_type_code => l_route_type_code
3843: ) ;
3844:
3843: ) ;
3844:
3845:
3846: -- Get Route Status Completion Code
3847: Eng_Workflow_Util.GetRouteComplStatusCode
3848: ( p_route_id => l_route_id
3849: , p_route_type_code => l_route_type_code
3850: , x_route_compl_status_code => l_route_compl_status_code
3851: ) ;
3851: ) ;
3852:
3853:
3854: -- Set Route Status
3855: Eng_Workflow_Util.SetRouteStatus
3856: ( p_item_type => itemtype
3857: , p_item_key => itemkey
3858: , p_wf_user_id => l_wf_user_id
3859: , p_route_id => l_route_id
3867: IF l_change_id IS NOT NULL AND l_change_id > 0
3868: THEN
3869:
3870: -- Get Action Id and set this as parent action id
3871: Eng_Workflow_Util.GetActionId
3872: ( p_item_type => itemtype
3873: , p_item_key => itemkey
3874: , x_action_id => l_parent_action_id
3875: ) ;
3878: /*************************************************
3879: -- in 115.10, Workflow Routing will not update
3880: -- Approval Status of Change Object
3881: -- Set Approval Status
3882: -- Eng_Workflow_Util.SetChangeApprovalStatus
3883: -- ( x_return_status => l_return_status
3884: -- , x_msg_count => l_msg_count
3885: -- , x_msg_data => l_msg_data
3886: -- , p_item_type => itemtype
3888: -- , p_change_id => l_change_id
3889: -- , p_change_line_id => l_change_line_id
3890: -- , p_wf_user_id => l_wf_user_id
3891: -- , p_sync_lines => 1 -- Set sync mode: True
3892: -- , p_new_appr_status_type => Eng_Workflow_Util.G_APPROVED
3893: -- ) ;
3894:
3895: -- IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3896:
3900: -- END IF ;
3901: **************************************************/
3902:
3903:
3904: l_action_type := Eng_Workflow_Util.ConvertRouteStatusToActionType
3905: ( p_route_status_code => l_route_compl_status_code
3906: , p_convert_type => 'WF_PROCESS' ) ;
3907:
3908: Eng_Workflow_Util.CreateRouteAction
3904: l_action_type := Eng_Workflow_Util.ConvertRouteStatusToActionType
3905: ( p_route_status_code => l_route_compl_status_code
3906: , p_convert_type => 'WF_PROCESS' ) ;
3907:
3908: Eng_Workflow_Util.CreateRouteAction
3909: ( x_return_status => l_return_status
3910: , x_msg_count => l_msg_count
3911: , x_msg_data => l_msg_data
3912: , p_change_id => l_change_id
3911: , x_msg_data => l_msg_data
3912: , p_change_id => l_change_id
3913: , p_change_line_id => l_change_line_id
3914: , p_action_type => l_action_type
3915: , p_user_id => Eng_Workflow_Util.G_ACT_SYSTEM_USER_ID
3916: , p_parent_action_id => l_parent_action_id
3917: , p_route_id => l_route_id
3918: , p_comment => NULL
3919: , x_action_id => l_action_id
4009: --
4010: if (funcmode = 'RUN') then
4011:
4012: -- Get WF User Id
4013: Eng_Workflow_Util.GetWFUserId
4014: ( p_item_type => itemtype
4015: , p_item_key => itemkey
4016: , x_wf_user_id => l_wf_user_id
4017: ) ;
4017: ) ;
4018:
4019:
4020: -- Get Change Object Identifier
4021: Eng_Workflow_Util.GetChangeObject
4022: ( p_item_type => itemtype
4023: , p_item_key => itemkey
4024: , x_change_id => l_change_id
4025: ) ;
4024: , x_change_id => l_change_id
4025: ) ;
4026:
4027: -- Get Chagne Line Id
4028: Eng_Workflow_Util.GetChangeLineObject
4029: ( p_item_type => itemtype
4030: , p_item_key => itemkey
4031: , x_change_line_id => l_change_line_id
4032: ) ;
4031: , x_change_line_id => l_change_line_id
4032: ) ;
4033:
4034: -- Get Route Id
4035: Eng_Workflow_Util.GetRouteId
4036: ( p_item_type => itemtype
4037: , p_item_key => itemkey
4038: , x_route_id => l_route_id
4039: ) ;
4039: ) ;
4040:
4041:
4042: -- Set Route Status
4043: Eng_Workflow_Util.SetRouteStatus
4044: ( p_item_type => itemtype
4045: , p_item_key => itemkey
4046: , p_wf_user_id => l_wf_user_id
4047: , p_route_id => l_route_id
4044: ( p_item_type => itemtype
4045: , p_item_key => itemkey
4046: , p_wf_user_id => l_wf_user_id
4047: , p_route_id => l_route_id
4048: , p_new_status_code => Eng_Workflow_Util.G_RT_REJECTED
4049: , p_change_id => l_change_id
4050: , p_change_line_id => l_change_line_id -- Added in R12B
4051: ) ;
4052:
4059: /*************************************************
4060: -- in 115.10, Workflow Routing will not update
4061: -- Approval Status of Change Object
4062: -- Set Approval Status
4063: -- Eng_Workflow_Util.SetChangeApprovalStatus
4064: -- ( x_return_status => l_return_status
4065: -- , x_msg_count => l_msg_count
4066: -- , x_msg_data => l_msg_data
4067: -- , p_item_type => itemtype
4068: -- , p_item_key => itemkey
4069: -- , p_change_id => l_change_id
4070: -- , p_change_line_id => l_change_line_id
4071: -- , p_wf_user_id => l_wf_user_id
4072: -- , p_new_appr_status_type => Eng_Workflow_Util.G_REJECTED
4073: -- ) ;
4074:
4075:
4076: -- IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4082: *************************************************/
4083:
4084:
4085: -- Get Action Id and set this as parent action id
4086: Eng_Workflow_Util.GetActionId
4087: ( p_item_type => itemtype
4088: , p_item_key => itemkey
4089: , x_action_id => l_parent_action_id
4090: ) ;
4088: , p_item_key => itemkey
4089: , x_action_id => l_parent_action_id
4090: ) ;
4091:
4092: l_action_type := Eng_Workflow_Util.ConvertRouteStatusToActionType
4093: ( p_route_status_code => Eng_Workflow_Util.G_RT_REJECTED
4094: , p_convert_type => 'WF_PROCESS' ) ;
4095:
4096:
4089: , x_action_id => l_parent_action_id
4090: ) ;
4091:
4092: l_action_type := Eng_Workflow_Util.ConvertRouteStatusToActionType
4093: ( p_route_status_code => Eng_Workflow_Util.G_RT_REJECTED
4094: , p_convert_type => 'WF_PROCESS' ) ;
4095:
4096:
4097: Eng_Workflow_Util.CreateRouteAction
4093: ( p_route_status_code => Eng_Workflow_Util.G_RT_REJECTED
4094: , p_convert_type => 'WF_PROCESS' ) ;
4095:
4096:
4097: Eng_Workflow_Util.CreateRouteAction
4098: ( x_return_status => l_return_status
4099: , x_msg_count => l_msg_count
4100: , x_msg_data => l_msg_data
4101: , p_change_id => l_change_id
4100: , x_msg_data => l_msg_data
4101: , p_change_id => l_change_id
4102: , p_change_line_id => l_change_line_id
4103: , p_action_type => l_action_type
4104: , p_user_id => Eng_Workflow_Util.G_ACT_SYSTEM_USER_ID
4105: , p_parent_action_id => l_parent_action_id
4106: , p_route_id => l_route_id
4107: , p_comment => NULL
4108: , x_action_id => l_action_id
4197: --
4198: if (funcmode = 'RUN') then
4199:
4200: -- Get WF User Id
4201: Eng_Workflow_Util.GetWFUserId
4202: ( p_item_type => itemtype
4203: , p_item_key => itemkey
4204: , x_wf_user_id => l_wf_user_id
4205: ) ;
4205: ) ;
4206:
4207:
4208: -- Get Change Object Identifier
4209: Eng_Workflow_Util.GetChangeObject
4210: ( p_item_type => itemtype
4211: , p_item_key => itemkey
4212: , x_change_id => l_change_id
4213: ) ;
4212: , x_change_id => l_change_id
4213: ) ;
4214:
4215: -- Get Chagne Line Id
4216: Eng_Workflow_Util.GetChangeLineObject
4217: ( p_item_type => itemtype
4218: , p_item_key => itemkey
4219: , x_change_line_id => l_change_line_id
4220: ) ;
4220: ) ;
4221:
4222:
4223: -- Get Route Id
4224: Eng_Workflow_Util.GetRouteId
4225: ( p_item_type => itemtype
4226: , p_item_key => itemkey
4227: , x_route_id => l_route_id
4228: ) ;
4228: ) ;
4229:
4230:
4231: -- Set Route Status
4232: Eng_Workflow_Util.SetRouteStatus
4233: ( p_item_type => itemtype
4234: , p_item_key => itemkey
4235: , p_wf_user_id => l_wf_user_id
4236: , p_route_id => l_route_id
4233: ( p_item_type => itemtype
4234: , p_item_key => itemkey
4235: , p_wf_user_id => l_wf_user_id
4236: , p_route_id => l_route_id
4237: , p_new_status_code => Eng_Workflow_Util.G_RT_TIME_OUT
4238: , p_change_id => l_change_id
4239: , p_change_line_id => l_change_line_id -- Added in R12B
4240: ) ;
4241:
4247: /*************************************************
4248: -- in 115.10, Workflow Routing will not update
4249: -- Approval Status of Change Object
4250: -- Set Approval Status
4251: -- Eng_Workflow_Util.SetChangeApprovalStatus
4252: -- ( x_return_status => l_return_status
4253: -- , x_msg_count => l_msg_count
4254: -- , x_msg_data => l_msg_data
4255: -- , p_item_type => itemtype
4256: -- , p_item_key => itemkey
4257: -- , p_change_id => l_change_id
4258: -- , p_change_line_id => l_change_line_id
4259: -- , p_wf_user_id => l_wf_user_id
4260: -- , p_new_appr_status_type => Eng_Workflow_Util.G_TIME_OUT
4261: -- ) ;
4262:
4263: -- IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4264:
4269: *************************************************/
4270:
4271:
4272: -- Get Action Id and set this as parent action id
4273: Eng_Workflow_Util.GetActionId
4274: ( p_item_type => itemtype
4275: , p_item_key => itemkey
4276: , x_action_id => l_parent_action_id
4277: ) ;
4276: , x_action_id => l_parent_action_id
4277: ) ;
4278:
4279:
4280: l_action_type := Eng_Workflow_Util.ConvertRouteStatusToActionType
4281: ( p_route_status_code => Eng_Workflow_Util.G_RT_TIME_OUT
4282: , p_convert_type => 'WF_PROCESS' ) ;
4283:
4284:
4277: ) ;
4278:
4279:
4280: l_action_type := Eng_Workflow_Util.ConvertRouteStatusToActionType
4281: ( p_route_status_code => Eng_Workflow_Util.G_RT_TIME_OUT
4282: , p_convert_type => 'WF_PROCESS' ) ;
4283:
4284:
4285: Eng_Workflow_Util.CreateRouteAction
4281: ( p_route_status_code => Eng_Workflow_Util.G_RT_TIME_OUT
4282: , p_convert_type => 'WF_PROCESS' ) ;
4283:
4284:
4285: Eng_Workflow_Util.CreateRouteAction
4286: ( x_return_status => l_return_status
4287: , x_msg_count => l_msg_count
4288: , x_msg_data => l_msg_data
4289: , p_change_id => l_change_id
4288: , x_msg_data => l_msg_data
4289: , p_change_id => l_change_id
4290: , p_change_line_id => l_change_line_id
4291: , p_action_type => l_action_type
4292: , p_user_id => Eng_Workflow_Util.G_ACT_SYSTEM_USER_ID
4293: , p_parent_action_id => l_parent_action_id
4294: , p_route_id => l_route_id
4295: , p_comment => NULL
4296: , x_action_id => l_action_id
4379: if (funcmode = 'RUN') then
4380:
4381:
4382: -- Get WF User Id
4383: Eng_Workflow_Util.GetWFUserId
4384: ( p_item_type => itemtype
4385: , p_item_key => itemkey
4386: , x_wf_user_id => l_wf_user_id
4387: ) ;
4387: ) ;
4388:
4389:
4390: -- Get Route Id
4391: Eng_Workflow_Util.GetRouteId
4392: ( p_item_type => itemtype
4393: , p_item_key => itemkey
4394: , x_route_id => l_route_id
4395: ) ;
4395: ) ;
4396:
4397:
4398: -- Get Route Step Id
4399: Eng_Workflow_Util.GetRouteStepId
4400: ( p_item_type => itemtype
4401: , p_item_key => itemkey
4402: , x_route_step_id => l_route_step_id
4403: ) ;
4402: , x_route_step_id => l_route_step_id
4403: ) ;
4404:
4405: -- Set Route Step Status
4406: Eng_Workflow_Util.SetRouteStepStatus
4407: ( p_item_type => itemtype
4408: , p_item_key => itemkey
4409: , p_wf_user_id => l_wf_user_id
4410: , p_route_id => l_route_id
4408: , p_item_key => itemkey
4409: , p_wf_user_id => l_wf_user_id
4410: , p_route_id => l_route_id
4411: , p_route_step_id => l_route_step_id
4412: , p_new_status_code => Eng_Workflow_Util.G_RT_COMPLETED
4413: ) ;
4414:
4415: -- set result
4416: result := 'COMPLETE';
4475: --
4476: if (funcmode = 'RUN') then
4477:
4478: -- Get WF User Id
4479: Eng_Workflow_Util.GetWFUserId
4480: ( p_item_type => itemtype
4481: , p_item_key => itemkey
4482: , x_wf_user_id => l_wf_user_id
4483: ) ;
4483: ) ;
4484:
4485:
4486: -- Get Route Id
4487: Eng_Workflow_Util.GetRouteId
4488: ( p_item_type => itemtype
4489: , p_item_key => itemkey
4490: , x_route_id => l_route_id
4491: ) ;
4491: ) ;
4492:
4493:
4494: -- Get Route Step Id
4495: Eng_Workflow_Util.GetRouteStepId
4496: ( p_item_type => itemtype
4497: , p_item_key => itemkey
4498: , x_route_step_id => l_route_step_id
4499: ) ;
4498: , x_route_step_id => l_route_step_id
4499: ) ;
4500:
4501: -- Set Route Step Status
4502: Eng_Workflow_Util.SetRouteStepStatus
4503: ( p_item_type => itemtype
4504: , p_item_key => itemkey
4505: , p_wf_user_id => l_wf_user_id
4506: , p_route_id => l_route_id
4504: , p_item_key => itemkey
4505: , p_wf_user_id => l_wf_user_id
4506: , p_route_id => l_route_id
4507: , p_route_step_id => l_route_step_id
4508: , p_new_status_code => Eng_Workflow_Util.G_RT_APPROVED
4509: ) ;
4510:
4511: -- set result
4512: result := 'COMPLETE';
4569: --
4570: if (funcmode = 'RUN') then
4571:
4572: -- Get WF User Id
4573: Eng_Workflow_Util.GetWFUserId
4574: ( p_item_type => itemtype
4575: , p_item_key => itemkey
4576: , x_wf_user_id => l_wf_user_id
4577: ) ;
4576: , x_wf_user_id => l_wf_user_id
4577: ) ;
4578:
4579: -- Get Route Id
4580: Eng_Workflow_Util.GetRouteId
4581: ( p_item_type => itemtype
4582: , p_item_key => itemkey
4583: , x_route_id => l_route_id
4584: ) ;
4583: , x_route_id => l_route_id
4584: ) ;
4585:
4586: -- Get Route Step Id
4587: Eng_Workflow_Util.GetRouteStepId
4588: ( p_item_type => itemtype
4589: , p_item_key => itemkey
4590: , x_route_step_id => l_route_step_id
4591: ) ;
4590: , x_route_step_id => l_route_step_id
4591: ) ;
4592:
4593: -- Set Route Step Status
4594: Eng_Workflow_Util.SetRouteStepStatus
4595: ( p_item_type => itemtype
4596: , p_item_key => itemkey
4597: , p_wf_user_id => l_wf_user_id
4598: , p_route_id => l_route_id
4596: , p_item_key => itemkey
4597: , p_wf_user_id => l_wf_user_id
4598: , p_route_id => l_route_id
4599: , p_route_step_id => l_route_step_id
4600: , p_new_status_code => Eng_Workflow_Util.G_RT_REJECTED
4601: ) ;
4602:
4603: -- set result
4604: result := 'COMPLETE';
4664: if (funcmode = 'RUN') then
4665:
4666:
4667: -- Get WF User Id
4668: Eng_Workflow_Util.GetWFUserId
4669: ( p_item_type => itemtype
4670: , p_item_key => itemkey
4671: , x_wf_user_id => l_wf_user_id
4672: ) ;
4671: , x_wf_user_id => l_wf_user_id
4672: ) ;
4673:
4674: -- Get Route Id
4675: Eng_Workflow_Util.GetRouteId
4676: ( p_item_type => itemtype
4677: , p_item_key => itemkey
4678: , x_route_id => l_route_id
4679: ) ;
4678: , x_route_id => l_route_id
4679: ) ;
4680:
4681: -- Get Route Step Id
4682: Eng_Workflow_Util.GetRouteStepId
4683: ( p_item_type => itemtype
4684: , p_item_key => itemkey
4685: , x_route_step_id => l_route_step_id
4686: ) ;
4685: , x_route_step_id => l_route_step_id
4686: ) ;
4687:
4688: -- Set Route Step Status
4689: Eng_Workflow_Util.SetRouteStepStatus
4690: ( p_item_type => itemtype
4691: , p_item_key => itemkey
4692: , p_wf_user_id => l_wf_user_id
4693: , p_route_id => l_route_id
4691: , p_item_key => itemkey
4692: , p_wf_user_id => l_wf_user_id
4693: , p_route_id => l_route_id
4694: , p_route_step_id => l_route_step_id
4695: , p_new_status_code => Eng_Workflow_Util.G_RT_TIME_OUT
4696: ) ;
4697:
4698: -- set result
4699: result := 'COMPLETE';
4761: if (funcmode = 'RUN') then
4762:
4763:
4764: -- Get Chagne Id
4765: Eng_Workflow_Util.GetChangeObject
4766: ( p_item_type => itemtype
4767: , p_item_key => itemkey
4768: , x_change_id => l_change_id
4769: ) ;
4768: , x_change_id => l_change_id
4769: ) ;
4770:
4771: -- Get Route Step Id
4772: Eng_Workflow_Util.GetRouteStepId
4773: ( p_item_type => itemtype
4774: , p_item_key => itemkey
4775: , x_route_step_id => l_route_step_id
4776: ) ;
4776: ) ;
4777:
4778:
4779: -- Grant Role to Step People
4780: Eng_Workflow_Util.GrantChangeRoleToStepPeople
4781: ( x_return_status => l_return_status
4782: , x_msg_count => l_msg_count
4783: , x_msg_data => l_msg_data
4784: , p_item_type => itemtype
4871: --
4872: if (funcmode = 'RUN') then
4873:
4874: -- Get Route Step Id
4875: -- Eng_Workflow_Util.GetRouteStepId
4876: -- ( p_item_type => itemtype
4877: -- , p_item_key => itemkey
4878: -- , x_route_step_id => l_route_step_id
4879: -- ) ;
4973: --
4974: if (funcmode = 'RUN') then
4975:
4976: -- Get Route Object
4977: Eng_Workflow_Util.GetRouteObject
4978: ( p_item_type => itemtype
4979: , p_item_key => itemkey
4980: , x_route_object => l_route_object
4981: ) ;
5055: --
5056: if (funcmode = 'RUN') then
5057:
5058: -- Get Route Id
5059: Eng_Workflow_Util.GetRouteId
5060: ( p_item_type => itemtype
5061: , p_item_key => itemkey
5062: , x_route_id => l_route_id
5063: ) ;
5063: ) ;
5064:
5065:
5066: -- Call Sync Change Lifecycle Phase API
5067: Eng_Workflow_Util.SyncChangeLCPhase
5068: ( x_return_status => l_return_status
5069: , x_msg_count => l_msg_count
5070: , x_msg_data => l_msg_data
5071: , p_route_id => l_route_id
5068: ( x_return_status => l_return_status
5069: , x_msg_count => l_msg_count
5070: , x_msg_data => l_msg_data
5071: , p_route_id => l_route_id
5072: , p_api_caller => Eng_Workflow_Util.G_WF_CALL
5073: ) ;
5074:
5075: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
5076:
5168: if (funcmode = 'RUN') then
5169:
5170:
5171: -- Get Chagne Id
5172: Eng_Workflow_Util.GetChangeObject
5173: ( p_item_type => itemtype
5174: , p_item_key => itemkey
5175: , x_change_id => l_change_id
5176: ) ;
5274: if (funcmode = 'RUN') then
5275:
5276:
5277: -- Get Chagne Id
5278: Eng_Workflow_Util.GetChangeObject
5279: ( p_item_type => itemtype
5280: , p_item_key => itemkey
5281: , x_change_id => l_change_id
5282: ) ;
5281: , x_change_id => l_change_id
5282: ) ;
5283:
5284: -- Get Base CM Type code
5285: l_base_cm_type_code := Eng_Workflow_Util.GetBaseChangeMgmtTypeCode(l_change_id) ;
5286:
5287: -- no result needed
5288: result := 'COMPLETE:' || l_base_cm_type_code ;
5289: return;
5364: if (funcmode = 'RUN') then
5365:
5366:
5367: -- Get Chagne Id
5368: Eng_Workflow_Util.GetChangeObject
5369: ( p_item_type => itemtype
5370: , p_item_key => itemkey
5371: , x_change_id => l_change_id
5372: ) ;
5372: ) ;
5373:
5374:
5375: -- Get WF User Id
5376: Eng_Workflow_Util.GetWFUserId
5377: ( p_item_type => itemtype
5378: , p_item_key => itemkey
5379: , x_wf_user_id => l_wf_user_id
5380: ) ;
5379: , x_wf_user_id => l_wf_user_id
5380: ) ;
5381:
5382: -- Call SetChangeOrderMRPFlag
5383: Eng_Workflow_Util.SetChangeOrderMRPFlag
5384: ( x_return_status => l_return_status
5385: , x_msg_count => l_msg_count
5386: , x_msg_data => l_msg_data
5387: , p_change_id => l_change_id
5384: ( x_return_status => l_return_status
5385: , x_msg_count => l_msg_count
5386: , x_msg_data => l_msg_data
5387: , p_change_id => l_change_id
5388: , p_mrp_flag => Eng_Workflow_Util.G_MRP_FLAG_YES
5389: , p_wf_user_id => l_wf_user_id
5390: , p_api_caller => Eng_Workflow_Util.G_WF_CALL
5391: ) ;
5392:
5386: , x_msg_data => l_msg_data
5387: , p_change_id => l_change_id
5388: , p_mrp_flag => Eng_Workflow_Util.G_MRP_FLAG_YES
5389: , p_wf_user_id => l_wf_user_id
5390: , p_api_caller => Eng_Workflow_Util.G_WF_CALL
5391: ) ;
5392:
5393: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
5394:
5477: if (funcmode = 'RUN') then
5478:
5479:
5480: -- Get Chagne Id
5481: Eng_Workflow_Util.GetChangeObject
5482: ( p_item_type => itemtype
5483: , p_item_key => itemkey
5484: , x_change_id => l_change_id
5485: ) ;
5485: ) ;
5486:
5487:
5488: -- Get WF User Id
5489: Eng_Workflow_Util.GetWFUserId
5490: ( p_item_type => itemtype
5491: , p_item_key => itemkey
5492: , x_wf_user_id => l_wf_user_id
5493: ) ;
5493: ) ;
5494:
5495:
5496: -- Call SetChangeOrderMRPFlag
5497: Eng_Workflow_Util.SetChangeOrderMRPFlag
5498: ( x_return_status => l_return_status
5499: , x_msg_count => l_msg_count
5500: , x_msg_data => l_msg_data
5501: , p_change_id => l_change_id
5498: ( x_return_status => l_return_status
5499: , x_msg_count => l_msg_count
5500: , x_msg_data => l_msg_data
5501: , p_change_id => l_change_id
5502: , p_mrp_flag => Eng_Workflow_Util.G_MRP_FLAG_NO
5503: , p_wf_user_id => l_wf_user_id
5504: , p_api_caller => Eng_Workflow_Util.G_WF_CALL
5505: ) ;
5506:
5500: , x_msg_data => l_msg_data
5501: , p_change_id => l_change_id
5502: , p_mrp_flag => Eng_Workflow_Util.G_MRP_FLAG_NO
5503: , p_wf_user_id => l_wf_user_id
5504: , p_api_caller => Eng_Workflow_Util.G_WF_CALL
5505: ) ;
5506:
5507: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
5508:
5594:
5595:
5596:
5597: -- Get WF Admin Statuss Monigor URL
5598: Eng_Workflow_Util.GetWorkflowMonitorURL
5599: ( p_api_version => 1.0
5600: , p_init_msg_list => FND_API.G_FALSE
5601: , p_commit => FND_API.G_FALSE
5602: , p_validation_level => FND_API.G_VALID_LEVEL_FULL
5604: , x_msg_count => l_msg_count
5605: , x_msg_data => l_msg_data
5606: , p_item_type => itemtype
5607: , p_item_key => itemkey
5608: , p_url_type => Eng_Workflow_Util.G_MONITOR_ADVANCED_ENVELOPE
5609: , p_admin_mode => FND_API.G_TRUE
5610: -- , p_admin_mode => FND_API.G_FALSE
5611: , p_option => 'ALL'
5612: , x_url => l_url
5788: IF l_change_id IS NOT NULL
5789: THEN
5790:
5791: -- Get Change Object Info
5792: Eng_Workflow_Util.GetChangeObjectInfo
5793: ( p_change_id => l_change_id
5794: , x_change_notice => l_change_notice
5795: , x_organization_id => l_organization_id
5796: , x_change_name => l_change_name
5808: ) ;
5809:
5810:
5811: -- Get Organization Info
5812: Eng_Workflow_Util.GetOrgInfo
5813: ( p_organization_id => l_organization_id
5814: , x_organization_code => l_organization_code
5815: , x_organization_name => l_organization_name ) ;
5816:
6012: --
6013: if (funcmode = 'RUN') then
6014:
6015:
6016: Eng_Workflow_Util.Get_Debug_Mode
6017: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
6018:
6019: -- For Test/Debug
6020: IF l_debug_flag THEN
6017: (itemtype, itemkey, l_debug_flag, l_output_dir , l_debug_filename);
6018:
6019: -- For Test/Debug
6020: IF l_debug_flag THEN
6021: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
6022: , l_debug_filename || actid ) ;
6023: Eng_Workflow_Util.Write_Debug('Get activity params . . . ' ) ;
6024: END IF ;
6025:
6019: -- For Test/Debug
6020: IF l_debug_flag THEN
6021: Eng_Workflow_Util.Open_Debug_Session( l_output_dir
6022: , l_debug_filename || actid ) ;
6023: Eng_Workflow_Util.Write_Debug('Get activity params . . . ' ) ;
6024: END IF ;
6025:
6026:
6027: l_waiting_activity := UPPER(Wf_Engine.GetActivityAttrText(
6029: l_waiting_flow_type := UPPER(Wf_Engine.GetActivityAttrText(
6030: itemtype, itemkey, actid,'WAITING_FLOW_TYPE'));
6031:
6032: IF l_debug_flag THEN
6033: Eng_Workflow_Util.Write_Debug('WAITING_ACTIVITY : ' || l_waiting_activity ) ;
6034: Eng_Workflow_Util.Write_Debug('WAITING_FLOW_TYPE : ' || l_waiting_flow_type ) ;
6035: END IF ;
6036:
6037:
6030: itemtype, itemkey, actid,'WAITING_FLOW_TYPE'));
6031:
6032: IF l_debug_flag THEN
6033: Eng_Workflow_Util.Write_Debug('WAITING_ACTIVITY : ' || l_waiting_activity ) ;
6034: Eng_Workflow_Util.Write_Debug('WAITING_FLOW_TYPE : ' || l_waiting_flow_type ) ;
6035: END IF ;
6036:
6037:
6038: -- Currently we are supporting only for Header Route Approval Flow.
6039: -- e.g. seeded WAITING_FLOW value is 'APPROVAL'
6040: -- In future, we may need to support other type of flow
6041: --
6042: -- if ( l_waiting_flow = 'APPROVAL' ) then
6043: -- Eng_Workflow_Util.WaitForLineApprovalFlow . . .
6044: -- elsif ( l_waiting_flow = 'XXXX' ) then
6045: -- null
6046: -- else
6047: -- raise exception ;
6049: -- end if;
6050: --
6051:
6052: IF l_debug_flag THEN
6053: Eng_Workflow_Util.Write_Debug('Calling Eng_Workflow_Util.ContinueHeaderRoute. . . ' ) ;
6054: END IF ;
6055:
6056:
6057: Eng_Workflow_Util.ContinueHeaderRoute
6053: Eng_Workflow_Util.Write_Debug('Calling Eng_Workflow_Util.ContinueHeaderRoute. . . ' ) ;
6054: END IF ;
6055:
6056:
6057: Eng_Workflow_Util.ContinueHeaderRoute
6058: ( x_return_status => l_return_status
6059: , x_msg_count => l_msg_count
6060: , x_msg_data => l_msg_data
6061: , p_item_type => itemtype
6066: , x_resultout => result
6067: ) ;
6068:
6069: IF l_debug_flag THEN
6070: Eng_Workflow_Util.Write_Debug('Return Status : ' || l_return_status ) ;
6071: Eng_Workflow_Util.Write_Debug('Result : ' || result ) ;
6072: END IF ;
6073:
6074:
6067: ) ;
6068:
6069: IF l_debug_flag THEN
6070: Eng_Workflow_Util.Write_Debug('Return Status : ' || l_return_status ) ;
6071: Eng_Workflow_Util.Write_Debug('Result : ' || result ) ;
6072: END IF ;
6073:
6074:
6075: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
6074:
6075: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
6076:
6077: IF l_debug_flag THEN
6078: Eng_Workflow_Util.Close_Debug_Session ;
6079: END IF ;
6080:
6081: -- Unexpected Exception
6082: RAISE FND_API.G_EXC_UNEXPECTED_ERROR ;
6083:
6084: END IF ;
6085:
6086: IF l_debug_flag THEN
6087: Eng_Workflow_Util.Close_Debug_Session ;
6088: END IF ;
6089:
6090: -- result is set by ContinueHeaderRoute util api
6091: return;
6121:
6122: WHEN OTHERS THEN
6123:
6124: IF l_debug_flag THEN
6125: Eng_Workflow_Util.Close_Debug_Session ;
6126: END IF ;
6127:
6128: -- The line below records this function call in the error system
6129: -- in the case of an exception.
6171: -- e.g. seeded CONTINUATION_FLOW value is 'APPROVAL'
6172: -- In future, we may need to support other type of flow
6173: --
6174: -- if ( l_continuation_flow_type = 'APPROVAL' ) then
6175: -- Eng_Workflow_Util.WaitForLineApprovalFlow . . .
6176: -- elsif ( l_continuation_flow_type = 'XXXX' ) then
6177: -- null
6178: -- else
6179: -- call ContinueFlow.WaitForFlow
6179: -- call ContinueFlow.WaitForFlow
6180: -- end if;
6181: --
6182:
6183: Eng_Workflow_Util.WaitForLineRoute
6184: ( x_return_status => l_return_status
6185: , x_msg_count => l_msg_count
6186: , x_msg_data => l_msg_data
6187: , p_item_type => itemtype