diff options
Diffstat (limited to 'bpmn')
7 files changed, 28 insertions, 14 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofHoming.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofHoming.groovy index d6576b7dce..1b5a2ecdcb 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofHoming.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofHoming.groovy @@ -28,6 +28,7 @@ import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils import org.openecomp.mso.bpmn.core.domain.CloudFlavor import org.openecomp.mso.bpmn.core.domain.InventoryType import org.openecomp.mso.bpmn.core.domain.Resource +import org.openecomp.mso.bpmn.core.domain.ResourceType import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition import org.openecomp.mso.bpmn.core.domain.Subscriber import org.openecomp.mso.bpmn.core.domain.VnfResource @@ -210,9 +211,16 @@ class OofHoming extends AbstractServiceTaskProcessor { JSONObject placement = arrSol.getJSONObject(j) utils.log("DEBUG", "****** JSONObject is: " + placement + " *****", "true") String jsonServiceResourceId = placement.getString("serviceResourceId") + String jsonResourceModuleName = placement.getString("resourceModuleName") for (Resource resource : resourceList) { String serviceResourceId = resource.getResourceId() - if (serviceResourceId.equalsIgnoreCase(jsonServiceResourceId)) { + String resourceModuleName = "" + if (resource.getResourceType() == ResourceType.ALLOTTED_RESOURCE || + resource.getResourceType() == ResourceType.VNF) { + resourceModuleName = resource.getNfFunction() + } + if (serviceResourceId.equalsIgnoreCase(jsonServiceResourceId) || + resourceModuleName.equalsIgnoreCase(jsonResourceModuleName)) { JSONObject solution = placement.getJSONObject("solution") String solutionType = solution.getString("identifierType") String inventoryType = "" @@ -249,14 +257,17 @@ class OofHoming extends AbstractServiceTaskProcessor { flavorsArrayList.add(cloudFlavor) } } - Map<String, String> assignmentMap = jsonUtil.entryArrayToMap(execution, assignmentArr.toString(), "key", "value") + Map<String, String> assignmentMap = jsonUtil.entryArrayToMap(execution, + assignmentArr.toString(), "key", "value") String cloudOwner = assignmentMap.get("cloudOwner") - String cloudRegionId = assignmentMap.get("cloudRegionId") + String cloudRegionId = assignmentMap.get("locationId") resource.getHomingSolution().setCloudOwner(cloudOwner) resource.getHomingSolution().setCloudRegionId(cloudRegionId) if (flavorsArrayList != null && flavorsArrayList.size != 0) { resource.getHomingSolution().setFlavors(flavorsArrayList) execution.setVariable(cloudRegionId + "_flavorList", flavorsArrayList) + utils.log("DEBUG", "***** _flavorList is: " + flavorsArrayList.toString() + + " *****", "true") } if (inventoryType.equalsIgnoreCase("service")) { diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCallback2AR1Vnf b/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCallback2AR1Vnf index 808723828a..53cd70c514 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCallback2AR1Vnf +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCallback2AR1Vnf @@ -54,7 +54,7 @@ "value": "False" }, { - "key": "cloudRegionId", + "key": "locationId", "value": "dfwtx" } ] @@ -79,7 +79,7 @@ "value": "False" }, { - "key": "cloudRegionId", + "key": "locationId", "value": "testCloudRegionId2" } ] @@ -100,7 +100,7 @@ "value": "aic" }, { - "key": "cloudRegionId", + "key": "locationId", "value": "testCloudRegionId3" }, { "key":"flavors", diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCallback2AR1Vnf2Net b/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCallback2AR1Vnf2Net index 8766df8dba..d95587746b 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCallback2AR1Vnf2Net +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCallback2AR1Vnf2Net @@ -55,7 +55,7 @@ { "key": "cloudOwner", "value": "aic" }, { "key": "vnfHostName", "value": "MDTNJ01" }, { "key": "isRehome", "value": "False" }, - { "key": "cloudRegionId", "value": "dfwtx" } + { "key": "locationId", "value": "dfwtx" } ] }, { @@ -69,7 +69,7 @@ { "key": "cloudOwner", "value": "aic" }, { "key": "vnfHostName", "value": "testVnfHostname2" }, { "key": "isRehome", "value": "False" }, - { "key": "cloudRegionId", "value": "testCloudRegionId2" } + { "key": "locationId", "value": "testCloudRegionId2" } ] }, { @@ -83,7 +83,7 @@ { "key": "cloudOwner", "value": "aic" }, { "key": "vnfHostName", "value": "testVnfHostNameNet" }, { "key": "isRehome", "value": "False" }, - { "key": "cloudRegionId", "value": "testCloudRegionIdNet" } + { "key": "locationId", "value": "testCloudRegionIdNet" } ] }, { @@ -96,7 +96,7 @@ }, "assignmentInfo": [ { "key": "cloudOwner", "value": "aic" }, - { "key": "cloudRegionId", "value": "testCloudRegionIdNet2" } + { "key": "locationId", "value": "testCloudRegionIdNet2" } ] }, { @@ -109,7 +109,7 @@ }, "assignmentInfo": [ { "key": "cloudOwner", "value": "aic" }, - { "key": "cloudRegionId", "value": "testCloudRegionId3" }, + { "key": "locationId", "value": "testCloudRegionId3" }, { "key":"flavors", "value":{ "flavorLabel1xxx":"vimFlavorxxx", "flavorLabel2xxx":"vimFlavorxxx"}} ] } diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCallbackInfraVnf b/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCallbackInfraVnf index 8e6f2d46be..15e601bae8 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCallbackInfraVnf +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCallbackInfraVnf @@ -17,7 +17,7 @@ { "key": "cloudOwner", "value": "amazon" }, { "key": "vnfHostName", "value": "ahr344gh" }, { "key": "isRehome", "value": "False" }, - { "key": "cloudRegionId", "value": "1ac71fb8-ad43-4e16-9459-c3f372b8236d" } + { "key": "locationId", "value": "1ac71fb8-ad43-4e16-9459-c3f372b8236d" } ] }, { @@ -30,7 +30,7 @@ }, "assignmentInfo": [ { "key": "cloudOwner", "value": "amazon" }, - { "key": "cloudRegionId", "value": "1ac71fb8-ad43-4e16-9459-c3f372b8236d" }, + { "key": "locationId", "value": "1ac71fb8-ad43-4e16-9459-c3f372b8236d" }, { "key":"flavors", "value":{ "flavorLabel1xxx":"vimFlavorxxx", "flavorLabel2xxx":"vimFlavorxxx"}} ] } diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCatalogResp.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCatalogResp.json index 09026d1d8c..889431663d 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCatalogResp.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/BuildingBlocks/oofCatalogResp.json @@ -37,7 +37,7 @@ }, "nfRole": "", "nfType": "", - "nfFunction": "", + "nfFunction": "ADIoDvCE", "nfNamingCode": "", "multiStageDesign": "N" } diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn index 0a0c95af4c..876f91ff42 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn @@ -516,6 +516,7 @@ CreateVcpeResCustService.prepareCreateAllottedResourceBRG(execution)]]></bpmn2:s <camunda:in source="serviceModelInfo" target="serviceModelInfo" /> <camunda:in source="globalSubscriberId" target="globalSubscriberId" /> <camunda:in source="serviceDecomposition" target="serviceDecomposition" /> + <camunda:in source="RegionOne_flavorList" target="RegionOne_flavorList" /> </bpmn2:extensionElements> <bpmn2:incoming>SequenceFlow_0ws7fjn</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1mkdhw9</bpmn2:outgoing> diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateVnfAndModules.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateVnfAndModules.bpmn index 675b8fadb5..8cbc7e97cd 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateVnfAndModules.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateVnfAndModules.bpmn @@ -40,6 +40,7 @@ doCreateVnfAndModules.preProcessRequest(execution)]]></bpmn:script> <camunda:in source="tenantId" target="tenantId" /> <camunda:in source="false" target="usePreload" /> <camunda:in source="aLaCarte" target="aLaCarte" /> + <camunda:in source="RegionOne_flavorList" target="RegionOne_flavorList" /> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_1hf7k7q</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1ixcnb6</bpmn:outgoing> @@ -127,6 +128,7 @@ doCreateVnfAndModules.validateAddOnModule(execution)]]></bpmn:script> <camunda:in source="tenantId" target="tenantId" /> <camunda:in source="rollbackData" target="rollbackData" /> <camunda:in source="vnfResourceDecomposition" target="vnfResourceDecomposition" /> + <camunda:in source="RegionOne_flavorList" target="RegionOne_flavorList" /> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_19ohb1a</bpmn:incoming> <bpmn:outgoing>SequenceFlow_07u8e3l</bpmn:outgoing> |