From 45a228cd04b48eb69f8c8365286114086535eb3b Mon Sep 17 00:00:00 2001 From: sunilb Date: Wed, 15 Apr 2020 23:43:31 +0530 Subject: Adding Generic VNF information in ControllerExeuctionBB flow Issue-ID: SO-2806 Signed-off-by: sunilb Change-Id: I74318e16040a699b5a27a25b132d0cd486974bbb --- .../so/bpmn/servicedecomposition/tasks/BBInputSetup.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'bpmn/MSOCommonBPMN/src/main') diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java index f0954c3695..de2aafaa72 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java @@ -108,6 +108,7 @@ public class BBInputSetup implements JavaDelegate { private static final String NETWORK_COLLECTION = "NetworkCollection"; private static final String PREPROV = "PREPROV"; private static final String CREATEVOLUME = "CreateVolume"; + private static final String CONTROLLER = "Controller"; @Autowired private BBInputSetupUtils bbInputSetupUtils; @@ -1383,7 +1384,8 @@ public class BBInputSetup implements JavaDelegate { cloudRegion = mapperLayer.mapCloudRegion(cloudConfiguration, aaiCloudRegion); } gBB.setCloudRegion(cloudRegion); - if (bbName.contains(VNF)) { + if (bbName.contains(VNF) || (bbName.contains(CONTROLLER) + && (VNF).equalsIgnoreCase(executeBB.getBuildingBlock().getBpmnScope()))) { for (GenericVnf genericVnf : serviceInstance.getVnfs()) { if (lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID) != null && genericVnf.getVnfId().equalsIgnoreCase(lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID))) { @@ -1395,7 +1397,8 @@ public class BBInputSetup implements JavaDelegate { this.mapCatalogVnf(genericVnf, modelInfo, service); } } - } else if (bbName.contains(VF_MODULE)) { + } else if (bbName.contains(VF_MODULE) || (bbName.contains(CONTROLLER) + && (VF_MODULE).equalsIgnoreCase(executeBB.getBuildingBlock().getBpmnScope()))) { for (GenericVnf vnf : serviceInstance.getVnfs()) { for (VfModule vfModule : vnf.getVfModules()) { if (lookupKeyMap.get(ResourceKey.VF_MODULE_ID) != null @@ -1499,7 +1502,8 @@ public class BBInputSetup implements JavaDelegate { BBInputSetupParameter parameter = new BBInputSetupParameter.Builder().setRequestId(executeBB.getRequestId()).setService(service) .setBbName(bbName).setServiceInstance(serviceInstance).setLookupKeyMap(lookupKeyMap).build(); - if (bbName.contains(VNF)) { + if (bbName.contains(VNF) || (bbName.contains(CONTROLLER) + && (VNF).equalsIgnoreCase(executeBB.getBuildingBlock().getBpmnScope()))) { vnfs = findVnfsByKey(key, resources, vnfs); String vnfId = lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID); // This stores the vnf id in request db to be retrieved later when @@ -1527,7 +1531,8 @@ public class BBInputSetup implements JavaDelegate { resources.getPnfs().stream() .filter(pnfs -> Objects.equals(key, pnfs.getModelInfo().getModelCustomizationId())).findFirst() .ifPresent(pnfs -> BBInputSetupPnf.populatePnfToServiceInstance(pnfs, pnfId, serviceInstance)); - } else if (bbName.contains(VF_MODULE) || bbName.contains(VOLUME_GROUP)) { + } else if (bbName.contains(VF_MODULE) || bbName.contains(VOLUME_GROUP) || (bbName.contains(CONTROLLER) + && (VF_MODULE).equalsIgnoreCase(executeBB.getBuildingBlock().getBpmnScope()))) { Pair vnfsAndVfModules = getVfModulesAndItsVnfsByKey(key, resources); if (vnfsAndVfModules != null) { vfModules = vnfsAndVfModules.getValue1(); -- cgit 1.2.3-korg