117: IF FND_API.to_boolean( p_init_msg_list ) THEN
118: FND_MSG_PUB.initialize;
119: END IF;
120:
121: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
122: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
123: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||': Begin API',
124: 'At the start of the procedure');
125: END IF;
118: FND_MSG_PUB.initialize;
119: END IF;
120:
121: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
122: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
123: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||': Begin API',
124: 'At the start of the procedure');
125: END IF;
126:
249: END IF;
250: END LOOP;
251: END IF;
252:
253: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
254: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
255: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||': After normal execution',
256: 'At the end of the procedure');
257: END IF;
250: END LOOP;
251: END IF;
252:
253: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
254: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
255: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||': After normal execution',
256: 'At the end of the procedure');
257: END IF;
258:
646: IF FND_API.to_boolean( p_init_msg_list ) THEN
647: FND_MSG_PUB.initialize;
648: END IF;
649:
650: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
651: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
652: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||': Begin API',
653: 'At the start of the procedure');
654: END IF;
647: FND_MSG_PUB.initialize;
648: END IF;
649:
650: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
651: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
652: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||': Begin API',
653: 'At the start of the procedure');
654: END IF;
655: --Validate the input parameter and get the root instance_id and relationship_id
1007: END LOOP;
1008: END IF; --whether l_non_leaf_node is extra node
1009: END LOOP; --loop of get_non_leaf_nodes
1010:
1011: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1012: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
1013: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||': After normal execution',
1014: 'At the end of the procedure');
1015: END IF;
1008: END IF; --whether l_non_leaf_node is extra node
1009: END LOOP; --loop of get_non_leaf_nodes
1010:
1011: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1012: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
1013: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||': After normal execution',
1014: 'At the end of the procedure');
1015: END IF;
1016: -- Get all the error messages from the previous steps (if any) and raise the appropriate Exception
1299: IF FND_API.to_boolean( p_init_msg_list ) THEN
1300: FND_MSG_PUB.initialize;
1301: END IF;
1302:
1303: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1304: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
1305: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||': Begin API',
1306: 'At the start of the procedure');
1307: END IF;
1300: FND_MSG_PUB.initialize;
1301: END IF;
1302:
1303: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1304: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
1305: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||': Begin API',
1306: 'At the start of the procedure');
1307: END IF;
1308:
1541: FND_MESSAGE.set_name('AHL', 'AHL_UC_HISTORY_COPY_FAILED');
1542: FND_MSG_PUB.add;
1543: END IF;
1544:
1545: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1546: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,
1547: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||':Within API',
1548: 'After updating the master_config_id');
1549: END IF;
1542: FND_MSG_PUB.add;
1543: END IF;
1544:
1545: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1546: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,
1547: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||':Within API',
1548: 'After updating the master_config_id');
1549: END IF;
1550:
1664: END IF; --whether it is a node belonging to subuc or extra node branch
1665: CLOSE check_subuc_extra;
1666: END LOOP; --of all non leaf nodes
1667:
1668: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1669: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,
1670: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||':Within API',
1671: 'After migration the whole UC tree');
1672: END IF;
1665: CLOSE check_subuc_extra;
1666: END LOOP; --of all non leaf nodes
1667:
1668: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1669: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,
1670: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||':Within API',
1671: 'After migration the whole UC tree');
1672: END IF;
1673:
1767: FND_MSG_PUB.add;
1768: END IF;
1769: END IF;
1770:
1771: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1772: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
1773: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||':After normal execution',
1774: 'Status changed and at the end of the procedure');
1775: END IF;
1768: END IF;
1769: END IF;
1770:
1771: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1772: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
1773: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||':After normal execution',
1774: 'Status changed and at the end of the procedure');
1775: END IF;
1776:
2023: --Initialize message list if p_init_msg_list is set to TRUE.
2024: IF FND_API.to_boolean( p_init_msg_list ) THEN
2025: FND_MSG_PUB.initialize;
2026: END IF;
2027: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2028: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
2029: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||'.begin',
2030: 'At the start of the procedure, p_instance_id = ' || p_instance_id || ', p_relationship_id = ' || p_relationship_id);
2031: END IF;
2024: IF FND_API.to_boolean( p_init_msg_list ) THEN
2025: FND_MSG_PUB.initialize;
2026: END IF;
2027: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2028: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
2029: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||'.begin',
2030: 'At the start of the procedure, p_instance_id = ' || p_instance_id || ', p_relationship_id = ' || p_relationship_id);
2031: END IF;
2032: --Validate the input parameter p_instance_id
2211:
2212: -- Added by rbhavsar on July 25, 2007 to remap IB Tree Nodes to fix FP bug 6276991
2213: Remap_IB_Tree(p_instance_id, p_relationship_id);
2214:
2215: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2216: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
2217: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||'.end',
2218: 'At the end of the procedure');
2219: END IF;
2212: -- Added by rbhavsar on July 25, 2007 to remap IB Tree Nodes to fix FP bug 6276991
2213: Remap_IB_Tree(p_instance_id, p_relationship_id);
2214:
2215: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2216: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
2217: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||'.end',
2218: 'At the end of the procedure');
2219: END IF;
2220: -- Get all the error messages from the previous steps (if any) and raise the appropriate Exception
2348: l_return_value BOOLEAN;
2349: l_transaction_type_id NUMBER;
2350:
2351: BEGIN
2352: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2353: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE, L_DEBUG_KEY || '.begin',
2354: 'At the start of the procedure, p_instance_id = ' || p_instance_id || ', p_relationship_id = ' || p_relationship_id);
2355: END IF;
2356:
2349: l_transaction_type_id NUMBER;
2350:
2351: BEGIN
2352: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2353: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE, L_DEBUG_KEY || '.begin',
2354: 'At the start of the procedure, p_instance_id = ' || p_instance_id || ', p_relationship_id = ' || p_relationship_id);
2355: END IF;
2356:
2357: -- Get the transaction_type_id for use later by the CSI_II_RELATIONSHIPS_PUB.update_relationship API
2366: -- Get all nodes that are non-extra nodes
2367: FOR l_nonextra_instances IN get_premapped_instances_csr LOOP
2368: -- Validate if the instance still matches the position
2369: -- Check if l_nonextra_instances.position_reference is under the position p_relationship_id
2370: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2371: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2372: 'Non Extra Node: l_nonextra_instances.subject_id = ' || l_nonextra_instances.subject_id ||
2373: ', l_nonextra_instances.position_reference = ' || l_nonextra_instances.position_reference);
2374: END IF;
2367: FOR l_nonextra_instances IN get_premapped_instances_csr LOOP
2368: -- Validate if the instance still matches the position
2369: -- Check if l_nonextra_instances.position_reference is under the position p_relationship_id
2370: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2371: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2372: 'Non Extra Node: l_nonextra_instances.subject_id = ' || l_nonextra_instances.subject_id ||
2373: ', l_nonextra_instances.position_reference = ' || l_nonextra_instances.position_reference);
2374: END IF;
2375: OPEN validate_position_csr(TO_NUMBER(l_nonextra_instances.position_reference));
2385: l_csi_relationship_rec.position_reference := null; -- Nullify the relationship
2386: l_csi_relationship_rec.object_id := l_ii_rel_dtls.object_id;
2387: l_csi_relationship_rec.subject_id := l_ii_rel_dtls.subject_id;
2388: l_csi_relationship_tbl(1) := l_csi_relationship_rec;
2389: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2390: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2391: 'About to call CSI_II_RELATIONSHIPS_PUB.update_relationship to update CSI II relationship with id ' ||
2392: l_ii_rel_dtls.relationship_id || ' between ' ||
2393: l_ii_rel_dtls.object_id || ' (object) and ' ||
2386: l_csi_relationship_rec.object_id := l_ii_rel_dtls.object_id;
2387: l_csi_relationship_rec.subject_id := l_ii_rel_dtls.subject_id;
2388: l_csi_relationship_tbl(1) := l_csi_relationship_rec;
2389: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2390: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2391: 'About to call CSI_II_RELATIONSHIPS_PUB.update_relationship to update CSI II relationship with id ' ||
2392: l_ii_rel_dtls.relationship_id || ' between ' ||
2393: l_ii_rel_dtls.object_id || ' (object) and ' ||
2394: l_ii_rel_dtls.subject_id || '(subject) with NULL position_reference ');
2406: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2407: END IF;
2408: ELSE
2409: -- Position Matches at current level: Drill down by calling Remap_IB_Tree recursively
2410: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2411: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2412: 'About to recursively call Remap_IB_Tree with p_instance_id = ' || l_nonextra_instances.subject_id ||
2413: ', p_relationship_id =' || l_nonextra_instances.position_reference);
2414: END IF;
2407: END IF;
2408: ELSE
2409: -- Position Matches at current level: Drill down by calling Remap_IB_Tree recursively
2410: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2411: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2412: 'About to recursively call Remap_IB_Tree with p_instance_id = ' || l_nonextra_instances.subject_id ||
2413: ', p_relationship_id =' || l_nonextra_instances.position_reference);
2414: END IF;
2415: Remap_IB_Tree(p_instance_id => l_nonextra_instances.subject_id,
2413: ', p_relationship_id =' || l_nonextra_instances.position_reference);
2414: END IF;
2415: Remap_IB_Tree(p_instance_id => l_nonextra_instances.subject_id,
2416: p_relationship_id => TO_NUMBER(l_nonextra_instances.position_reference));
2417: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2418: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2419: 'Returned from recursive call to Remap_IB_Tree.');
2420: END IF;
2421: END IF;
2414: END IF;
2415: Remap_IB_Tree(p_instance_id => l_nonextra_instances.subject_id,
2416: p_relationship_id => TO_NUMBER(l_nonextra_instances.position_reference));
2417: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2418: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2419: 'Returned from recursive call to Remap_IB_Tree.');
2420: END IF;
2421: END IF;
2422: CLOSE validate_position_csr;
2426: OPEN get_extra_children_csr;
2427: FETCH get_extra_children_csr BULK COLLECT INTO l_extra_instances_tbl;
2428: CLOSE get_extra_children_csr;
2429:
2430: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2431: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2432: 'Number of extra nodes: ' || l_extra_instances_tbl.COUNT ||
2433: ', Number of non-extra nodes: ' || l_premapped_instances_tbl.COUNT);
2434: END IF;
2427: FETCH get_extra_children_csr BULK COLLECT INTO l_extra_instances_tbl;
2428: CLOSE get_extra_children_csr;
2429:
2430: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2431: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2432: 'Number of extra nodes: ' || l_extra_instances_tbl.COUNT ||
2433: ', Number of non-extra nodes: ' || l_premapped_instances_tbl.COUNT);
2434: END IF;
2435: IF (l_extra_instances_tbl.COUNT > 0) THEN
2438: OPEN get_all_empty_positions_csr;
2439: FETCH get_all_empty_positions_csr BULK COLLECT INTO l_relations_tbl;
2440: CLOSE get_all_empty_positions_csr;
2441:
2442: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2443: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2444: 'Number of empty positions: ' || l_relations_tbl.COUNT);
2445: END IF;
2446: IF (l_relations_tbl.COUNT > 0) THEN
2439: FETCH get_all_empty_positions_csr BULK COLLECT INTO l_relations_tbl;
2440: CLOSE get_all_empty_positions_csr;
2441:
2442: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2443: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2444: 'Number of empty positions: ' || l_relations_tbl.COUNT);
2445: END IF;
2446: IF (l_relations_tbl.COUNT > 0) THEN
2447: -- Analyse and process instances with matching positions
2446: IF (l_relations_tbl.COUNT > 0) THEN
2447: -- Analyse and process instances with matching positions
2448: Process_Instances(p_x_extra_instances_tbl => l_extra_instances_tbl,
2449: p_x_relations_tbl => l_relations_tbl);
2450: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2451: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2452: 'Number of extra nodes after processing: ' || l_extra_instances_tbl.COUNT ||
2453: ', Number of empty positions after processing: ' || l_relations_tbl.COUNT);
2454: END IF;
2447: -- Analyse and process instances with matching positions
2448: Process_Instances(p_x_extra_instances_tbl => l_extra_instances_tbl,
2449: p_x_relations_tbl => l_relations_tbl);
2450: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2451: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2452: 'Number of extra nodes after processing: ' || l_extra_instances_tbl.COUNT ||
2453: ', Number of empty positions after processing: ' || l_relations_tbl.COUNT);
2454: END IF;
2455: END IF;
2454: END IF;
2455: END IF;
2456: END IF; -- There are child nodes
2457:
2458: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2459: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE, L_DEBUG_KEY || '.end',
2460: 'At the end of the procedure.');
2461: END IF;
2462: END Remap_IB_Tree;
2455: END IF;
2456: END IF; -- There are child nodes
2457:
2458: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2459: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE, L_DEBUG_KEY || '.end',
2460: 'At the end of the procedure.');
2461: END IF;
2462: END Remap_IB_Tree;
2463:
2508: l_matched_flag BOOLEAN;
2509: l_current_position NUMBER;
2510:
2511: BEGIN
2512: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2513: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE, L_DEBUG_KEY || '.begin',
2514: 'At the start of the procedure, p_x_extra_instances_tbl.count = ' || p_x_extra_instances_tbl.count || ',p_x_relations_tbl.count = ' ||p_x_relations_tbl.count);
2515: END IF;
2516:
2509: l_current_position NUMBER;
2510:
2511: BEGIN
2512: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2513: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE, L_DEBUG_KEY || '.begin',
2514: 'At the start of the procedure, p_x_extra_instances_tbl.count = ' || p_x_extra_instances_tbl.count || ',p_x_relations_tbl.count = ' ||p_x_relations_tbl.count);
2515: END IF;
2516:
2517: -- Get the transaction_type_id for use later by the CSI_II_RELATIONSHIPS_PUB.update_relationship API
2525:
2526: -- There are extra nodes present
2527: i := p_x_extra_instances_tbl.FIRST;
2528: WHILE (i IS NOT NULL) LOOP
2529: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2530: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2531: 'i = ' || i || ', p_x_extra_instances_tbl(i) = ' || p_x_extra_instances_tbl(i));
2532: END IF;
2533: -- Initialize associative array
2526: -- There are extra nodes present
2527: i := p_x_extra_instances_tbl.FIRST;
2528: WHILE (i IS NOT NULL) LOOP
2529: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2530: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2531: 'i = ' || i || ', p_x_extra_instances_tbl(i) = ' || p_x_extra_instances_tbl(i));
2532: END IF;
2533: -- Initialize associative array
2534: l_map_tbl(p_x_extra_instances_tbl(i)) := 0;
2544: l_instance_dtls.inventory_revision,
2545: l_instance_dtls.quantity,
2546: l_instance_dtls.unit_of_measure);
2547: IF (l_item_match) THEN
2548: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2549: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2550: 'Instance ' || p_x_extra_instances_tbl(i) || ' fits position ' || p_x_relations_tbl(j));
2551: END IF;
2552: IF (l_map_tbl(p_x_extra_instances_tbl(i))) <> 0 THEN
2545: l_instance_dtls.quantity,
2546: l_instance_dtls.unit_of_measure);
2547: IF (l_item_match) THEN
2548: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2549: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2550: 'Instance ' || p_x_extra_instances_tbl(i) || ' fits position ' || p_x_relations_tbl(j));
2551: END IF;
2552: IF (l_map_tbl(p_x_extra_instances_tbl(i))) <> 0 THEN
2553: -- More than one match
2600: l_csi_relationship_rec.position_reference := to_char(l_current_position);
2601: l_csi_relationship_rec.object_id := l_ii_rel_dtls.object_id;
2602: l_csi_relationship_rec.subject_id := l_ii_rel_dtls.subject_id;
2603: l_csi_relationship_tbl(1) := l_csi_relationship_rec;
2604: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2605: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2606: 'About to call CSI_II_RELATIONSHIPS_PUB.update_relationship to update CSI II relationship with id ' ||
2607: l_ii_rel_dtls.relationship_id || ' between ' ||
2608: l_ii_rel_dtls.object_id || ' (object) and ' ||
2601: l_csi_relationship_rec.object_id := l_ii_rel_dtls.object_id;
2602: l_csi_relationship_rec.subject_id := l_ii_rel_dtls.subject_id;
2603: l_csi_relationship_tbl(1) := l_csi_relationship_rec;
2604: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2605: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2606: 'About to call CSI_II_RELATIONSHIPS_PUB.update_relationship to update CSI II relationship with id ' ||
2607: l_ii_rel_dtls.relationship_id || ' between ' ||
2608: l_ii_rel_dtls.object_id || ' (object) and ' ||
2609: l_ii_rel_dtls.subject_id || '(subject) with position_reference ' ||
2621: ELSIF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
2622: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2623: END IF;
2624: -- Now recursively match all the children of the current instance/position
2625: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2626: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2627: 'About to recursively call Remap_IB_Tree');
2628: END IF;
2629: Remap_IB_Tree(p_instance_id => p_x_extra_instances_tbl(i),
2622: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2623: END IF;
2624: -- Now recursively match all the children of the current instance/position
2625: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2626: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2627: 'About to recursively call Remap_IB_Tree');
2628: END IF;
2629: Remap_IB_Tree(p_instance_id => p_x_extra_instances_tbl(i),
2630: p_relationship_id => l_current_position);
2627: 'About to recursively call Remap_IB_Tree');
2628: END IF;
2629: Remap_IB_Tree(p_instance_id => p_x_extra_instances_tbl(i),
2630: p_relationship_id => l_current_position);
2631: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2632: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2633: 'Returned from recursive call to Remap_IB_Tree');
2634: END IF;
2635: -- Now delete the matched relationship
2628: END IF;
2629: Remap_IB_Tree(p_instance_id => p_x_extra_instances_tbl(i),
2630: p_relationship_id => l_current_position);
2631: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2632: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT, L_DEBUG_KEY,
2633: 'Returned from recursive call to Remap_IB_Tree');
2634: END IF;
2635: -- Now delete the matched relationship
2636: j := p_x_relations_tbl.FIRST;
2651: i := p_x_extra_instances_tbl.NEXT(i);
2652: END LOOP;
2653: l_map_tbl.DELETE; -- Clear up the temporary Associative Array
2654:
2655: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2656: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE, L_DEBUG_KEY || '.end',
2657: 'At the end of the procedure. Remaining Instances: ' || p_x_extra_instances_tbl.count);
2658: END IF;
2659: END Process_instances;
2652: END LOOP;
2653: l_map_tbl.DELETE; -- Clear up the temporary Associative Array
2654:
2655: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2656: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE, L_DEBUG_KEY || '.end',
2657: 'At the end of the procedure. Remaining Instances: ' || p_x_extra_instances_tbl.count);
2658: END IF;
2659: END Process_instances;
2660: