207: -- This API will create rows in GMO_INSTR_ATTRIBUTES_T table with
208: -- name , value pairs for entity_name, entity_key and context parameters
209: -- to create a context for the definition of Process Instructions to start
210: SELECT GMO_INSTR_PROCESS_ID_S.NEXTVAL INTO L_INSTRUCTION_PROCESS_ID
211: FROM DUAL;
212:
213: --Insert 'MODE' = P_MODE
214: INSERT INTO GMO_INSTR_ATTRIBUTES_T
215: (
1104:
1105: IF(L_INSTR_SET_DEFN_CSR%ROWCOUNT > 0) THEN
1106: L_SOURCE_COUNT := 1;
1107:
1108: SELECT GMO_INSTR_SET_DEFN_S.NEXTVAL INTO L_NEW_INSTRUCTION_SET_ID FROM DUAL;
1109:
1110: X_INSTRUCTION_SET_ID := L_NEW_INSTRUCTION_SET_ID;
1111:
1112: INSERT INTO GMO_INSTR_SET_DEFN_VL
1174: LOOP
1175: FETCH L_INSTR_DEFN_CSR INTO L_INSTR_DEFN_REC;
1176: EXIT WHEN L_INSTR_DEFN_CSR%NOTFOUND;
1177:
1178: SELECT GMO_INSTR_DEFN_S.NEXTVAL INTO L_NEW_INSTRUCTION_ID FROM DUAL;
1179:
1180: -- get the correct task id for the new entity name and entity key
1181: l_entity_task_id := null;
1182: if (L_INSTR_DEFN_REC.TASK_ID is not null) then
1712: SELECT INSTRUCTION_ID INTO L_PERM_INSTR_ID FROM GMO_INSTR_DEFN_B
1713: WHERE INSTRUCTION_SET_ID = L_PERM_INSTRUCTION_SET_ID AND INSTR_SEQ = L_TEMP_INSTR_SEQ;
1714: exception
1715: when no_data_found then
1716: SELECT GMO_INSTR_DEFN_S.NEXTVAL INTO L_PERM_INSTR_ID FROM DUAL;
1717: end;
1718: update gmo_instr_defn_t set instruction_id = L_PERM_INSTR_ID where instruction_id = l_temp_instr_id;
1719: update gmo_instr_appr_defn_t set instruction_id = L_PERM_INSTR_ID where instruction_id = l_temp_instr_id;
1720: END LOOP;
2380:
2381: -- If Instance entity key is null, create a new instruction set id from sequence
2382: IF(P_INSTANCE_ENTITY_KEY IS NULL) THEN
2383: SELECT GMO_INSTR_SET_INSTANCE_S.NEXTVAL INTO L_NEW_INSTRUCTION_SET_ID
2384: FROM DUAL;
2385: L_INSTANCE_ENTITY_KEY := GMO_CONSTANTS_GRP.G_INSTR_PREFIX || L_NEW_INSTRUCTION_SET_ID;
2386: ELSE
2387: BEGIN
2388: SELECT INSTRUCTION_SET_ID INTO L_INSTRUCTION_SET_ID
2409: RETURN;
2410: END IF;
2411:
2412: SELECT GMO_INSTR_SET_INSTANCE_S.NEXTVAL INTO L_NEW_INSTRUCTION_SET_ID
2413: FROM DUAL;
2414:
2415: L_INSTANCE_ENTITY_KEY := P_INSTANCE_ENTITY_KEY;
2416:
2417: END IF;
2491: FETCH L_INSTR_DEFN_CSR INTO L_INSTR_DEFN_REC;
2492: EXIT WHEN L_INSTR_DEFN_CSR%NOTFOUND;
2493:
2494: SELECT GMO_INSTR_INSTANCE_S.NEXTVAL INTO L_NEW_INSTRUCTION_ID
2495: FROM DUAL;
2496:
2497: --Bug 4730261: start
2498: --if task id is available, and task label is not available, we
2499: --take the task display name and assign to task label.
2863: RETURN;
2864: END IF;
2865:
2866: SELECT GMO_INSTR_SET_INSTANCE_S.NEXTVAL INTO L_NEW_INSTRUCTION_SET_ID
2867: FROM DUAL;
2868:
2869: INSERT INTO GMO_INSTR_SET_INSTANCE_VL
2870: (
2871: INSTRUCTION_SET_ID,
2933: FETCH L_INSTR_CSR INTO L_INSTR_REC;
2934: EXIT WHEN L_INSTR_CSR%NOTFOUND;
2935:
2936: SELECT GMO_INSTR_INSTANCE_S.NEXTVAL INTO L_NEW_INSTRUCTION_ID
2937: FROM DUAL;
2938:
2939: INSERT INTO GMO_INSTR_INSTANCE_VL
2940: (
2941: INSTRUCTION_ID,
5015:
5016: L_API_NAME := 'CREATE_INSTANCE_CONTEXT';
5017:
5018: SELECT GMO_INSTR_PROCESS_ID_S.NEXTVAL INTO L_INSTRUCTION_PROCESS_ID
5019: FROM DUAL;
5020:
5021: -- Begin Validation Block
5022: BEGIN
5023:
5878: APPR.INSTRUCTION_PROCESS_ID = INSTR_SET.INSTRUCTION_PROCESS_ID
5879: AND APPR.INSTRUCTION_ID = INSTR.INSTRUCTION_ID),0,
5880: FND_MESSAGE.GET_STRING('GMO','GMO_INSTR_SIG_NOT_REQUIRED'),
5881: FND_MESSAGE.GET_STRING('GMO','GMO_INSTR_SIG_REQUIRED'))
5882: FROM DUAL)
5883: AS SIGNATURE_REQUIRED
5884: )
5885: )
5886: )
6125: end if;
6126: CLOSE task_count_per_inst_set; --Code added by RBORPATL . Bug#14661007
6127: end if;
6128:
6129: select gmo_instr_defn_s.nextval into l_working_instruction_id from dual;
6130:
6131: insert into gmo_instr_defn_t
6132: (instruction_id,
6133: instruction_process_id,
6193: fetch get_instr_appr_detail into l_approver_seq,l_role_name, l_appr_count;
6194: exit when get_instr_appr_detail%notfound;
6195:
6196: select gmo_instr_appr_defn_s.nextval
6197: into l_approver_seq from dual;
6198:
6199: insert into
6200: gmo_instr_appr_defn_t
6201: (instruction_id, instruction_process_id,