819: End Create_Process_Activity;
820:
821:
822: /*
823: To populate the local table oe_action_pre_reqs from so_action_pre_reqs
824: This takes care of the putting an AND activitiy in the appropriate place.
825: */
826:
827: PROCEDURE Create_Activity_And
953: IF v_mul_rec_grp_flag = 'N' THEN
954:
955: v_error_level := 2052;
956: -- dbms_output.put_line('In the stage 4..');
957: INSERT INTO oe_action_pre_reqs
958: (
959: cycle_action_id,
960: action_id,
961: result_id,
985: IF c2.group_number = v_group_number THEN
986:
987: v_error_level := 2054;
988: -- dbms_output.put_line('In the stage 6..');
989: INSERT INTO oe_action_pre_reqs
990: (
991: cycle_action_id,
992: action_id,
993: result_id,
1048: -- dbms_output.put_line('In the stage 7.2 error:'
1049: -- ||to_char(v_api_error_level));
1050:
1051: v_error_level := 2056;
1052: INSERT INTO oe_action_pre_reqs
1053: (
1054: cycle_action_id,
1055: action_id,
1056: result_id,
1074: v_last_instance_id
1075: );
1076:
1077: v_error_level := 2057;
1078: INSERT INTO oe_action_pre_reqs
1079: (
1080: cycle_action_id,
1081: action_id,
1082: result_id,
1192: SELECT
1193: pr.instance_id,
1194: pr.instance_label,
1195: pr.rowid
1196: FROM oe_action_pre_reqs pr
1197: WHERE pr.cycle_id = v_cycle_id
1198: AND pr.action_id = v_action_id
1199: and pr.line_type = p_line_type -- included 3/24/00
1200: FOR UPDATE;
1202: CURSOR c5 IS
1203: SELECT
1204: pr.instance_id,
1205: pr.rowid
1206: FROM oe_action_pre_reqs pr
1207: WHERE pr.cycle_id = v_cycle_id
1208: AND pr.cycle_action_id = v_cycle_action_id
1209: AND pr.line_type = p_line_type -- included 3/24/00
1210: FOR UPDATE;
1440: -- dbms_output.put_line('Stage D18');
1441:
1442: IF c4.instance_id IS null THEN
1443: -- dbms_output.put_line('Stage D19');
1444: UPDATE oe_action_pre_reqs
1445: SET
1446: action_id = null,
1447: result_id = null,
1448: instance_label = 'Interdependecy-Hdr',
1449: instance_id = v_instance_id
1450: WHERE rowid = c4.rowid;
1451: ELSE
1452: -- dbms_output.put_line('Stage D20');
1453: UPDATE oe_action_pre_reqs
1454: SET
1455: instance_id2 = c4.instance_id,
1456: instance_label2 = c4.instance_label,
1457: instance_id= v_instance_id,
1465:
1466: -- dbms_output.put_line('Stage D21');
1467:
1468: v_error_level := 2070;
1469: INSERT INTO oe_action_pre_reqs
1470: (
1471: cycle_action_id,
1472: action_id,
1473: result_id,
1665:
1666: v_action_id := c2.lin_action_id;
1667: v_result_table := 'SO_LINES';
1668:
1669: INSERT INTO oe_action_pre_reqs
1670: (
1671: group_number,
1672: cycle_id,
1673: type,
1687: v_instance_id
1688: );
1689:
1690:
1691: INSERT INTO oe_action_pre_reqs
1692: (
1693: cycle_action_id,
1694: action_id,
1695: result_id,
1762: -- dbms_output.put_line('Stage N24');
1763:
1764: IF c6.instance_id IS null THEN
1765: -- dbms_output.put_line('Stage N25');
1766: UPDATE oe_action_pre_reqs
1767: SET
1768: cycle_action_id = null,
1769: instance_label = 'ENTER',
1770: instance_id = v_instance_id
1770: instance_id = v_instance_id
1771: WHERE rowid = c6.rowid;
1772: ELSE
1773: -- dbms_output.put_line('Stage N26');
1774: UPDATE oe_action_pre_reqs
1775: SET
1776: cycle_action_id = null,
1777: instance_id2 = v_instance_id,
1778: instance_label2 = 'ENTER'
1786: -- dbms_output.put_line('Stage N21');
1787:
1788: v_error_level := 3070;
1789:
1790: INSERT INTO oe_action_pre_reqs
1791: (
1792: cycle_action_id,
1793: action_id,
1794: result_id,
1812: v_instance_id
1813: );
1814: */
1815: --sam
1816: INSERT INTO oe_action_pre_reqs
1817: (
1818: cycle_action_id,
1819: action_id,
1820: result_id,
1866:
1867: IS
1868: CURSOR c1 IS
1869: SELECT cycle_action_id, action_id, result_id, group_number, rowid
1870: FROM oe_action_pre_reqs
1871: WHERE cycle_action_id IS NOT null
1872: AND type = p_item_type
1873: AND line_type = p_line_type
1874: AND cycle_action_id in
1872: AND type = p_item_type
1873: AND line_type = p_line_type
1874: AND cycle_action_id in
1875: (SELECT cycle_action_id
1876: FROM oe_action_pre_reqs
1877: WHERE cycle_action_id is not null
1878: AND cycle_id = p_cycle_id
1879: GROUP BY cycle_action_id
1880: HAVING count(*) > 1)
1899: -- dbms_output.put_line('Stage 1');
1900: BEGIN
1901: SELECT count(distinct group_number)
1902: INTO v_count
1903: FROM oe_action_pre_reqs
1904: WHERE cycle_action_id = c2.cycle_action_id;
1905: EXCEPTION
1906: WHEN OTHERS THEN
1907: null;
1958:
1959: -- dbms_output.put_line('Stage 3 error: '||to_char(v_api_error_level));
1960:
1961: v_error_level := 2083;
1962: INSERT INTO oe_action_pre_reqs
1963: (
1964: cycle_action_id,
1965: action_id,
1966: result_id,
1989: );
1990:
1991: END IF;
1992:
1993: UPDATE oe_action_pre_reqs
1994: SET cycle_action_id = null,
1995: instance_label2 = v_instance_label,
1996: instance_id2 = v_last_instance_id
1997: WHERE rowid = c2.rowid;
2013: END Create_Activity_Or;
2014:
2015:
2016: /*=============================================================
2017: -- Based on table oe_action_pre_reqs, link all the activities
2018: -- into wf_activity_transition table
2019: ==============================================================*/
2020:
2021: PROCEDURE Create_Activity_Transition
2033: decode(result_id,null,'*','UPG_RC_'||to_char(result_id)) result_code,
2034: cycle_id,
2035: instance_id,
2036: instance_id2
2037: FROM oe_action_pre_reqs
2038: WHERE type = p_item_type
2039: AND cycle_id = p_cycle_id
2040: AND line_type = p_line_type;
2041:
3799: END IF;
3800: END IF;
3801:
3802: -- -2 is for ENTERED/PARTIAL for the line action
3803: update oe_action_pre_reqs
3804: set action_id = -2
3805: where action_id = 1
3806: and type = 'OEOL'
3807: and result_id in (5, 15);
3825:
3826: -- dbms_output.put_line('************* FLAG18 = '||v_error_flag);
3827: IF V_ERROR_FLAG = 'N' THEN
3828: -- -1 is for ENTERED/PARTIAL for the header action
3829: update oe_action_pre_reqs
3830: set action_id = -1
3831: where action_id = 1
3832: and type = 'OEOH'
3833: and result_id in (5, 15);