diff options
Diffstat (limited to 'bpmn')
7 files changed, 71 insertions, 38 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofUtils.groovy index 4b2b0e20ac..f07a477bb3 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofUtils.groovy @@ -60,13 +60,19 @@ class OofUtils { ServiceInstance serviceInstance = decomposition.getServiceInstance() def serviceInstanceId = "" def serviceInstanceName = "" - if (serviceInstance == null) { - utils.log("DEBUG", "Unable to obtain Service Instance Id, ServiceInstance Object is null", isDebugEnabled) + + serviceInstanceId = execution.getVariable("serviceInstanceId") + serviceInstanceName = execution.getVariable("serviceInstanceName") + + if (serviceInstanceId == null || serviceInstanceId == "null") { + utils.log("DEBUG", "Unable to obtain Service Instance Id", isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - Unable to " + - "obtain Service Instance Id, ServiceInstance Object is null") - } else { - serviceInstanceId = serviceInstance.getInstanceId() - serviceInstanceName = serviceInstance.getInstanceName() + "obtain Service Instance Id, execution.getVariable(\"serviceInstanceName\") is null") + } + if (serviceInstanceName == null || serviceInstanceName == "null") { + utils.log("DEBUG", "Unable to obtain Service Instance Name", isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - Unable to " + + "obtain Service Instance Name, execution.getVariable(\"serviceInstanceName\") is null") } //Model Info ModelInfo model = decomposition.getModelInfo() @@ -115,7 +121,7 @@ class OofUtils { def resouceModelVersion = resourceModelInfo.getModelVersion() def resouceModelVersionId = resourceModelInfo.getModelUuid() def resouceModelType = resourceModelInfo.getModelType() - def tenantId = execution.getTenantId() + def tenantId = "" //Optional def requiredCandidatesJson = "" requiredCandidatesJson = createCandidateJson( @@ -143,6 +149,7 @@ class OofUtils { placementDemands = placementDemands.substring(0, placementDemands.length() - 1) } + /* Commenting Out Licensing as OOF doesn't support for Beijing String licenseDemands = "" sb = new StringBuilder() if (vnfResourceList.isEmpty() || vnfResourceList == null) { @@ -185,7 +192,7 @@ class OofUtils { licenseDemands = sb.append(licenseDemand) } licenseDemands = licenseDemands.substring(0, licenseDemands.length() - 1) - } + }*/ String request = "{\n" + @@ -225,12 +232,7 @@ class OofUtils { " \"modelVersion\": \"${modelVersion}\",\n" + " \"modelCustomizationName\": \"\"\n" + " }\n" + - " },\n" + - " \"licenseInfo\": {\n" + - " \"licenseDemands\": [\n" + - " ${licenseDemands}\n" + - " }]\n" + - " }\n" + + " }\n" + "}" diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java index 3515aa9218..4255df3e87 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java @@ -142,10 +142,17 @@ public class ApplicationControllerClient { Properties properties = new Properties(); Map<String, String> globalProperties = PropertyConfiguration.getInstance() .getProperties("mso.bpmn.urn.properties"); - properties.put("topic.read", globalProperties.get("appc.client.topic.read")); - properties.put("topic.write", globalProperties.get("appc.client.topic.write")); + if (controllerType==null || controllerType.length()==0 || controllerType.equalsIgnoreCase("appc")) { + properties.put("topic.read", globalProperties.get("appc.client.topic.read")); + properties.put("topic.write", globalProperties.get("appc.client.topic.write")); + } else { + properties.put("topic.read", globalProperties.get("appc.client.topic." + controllerType + ".read")); + properties.put("topic.write", globalProperties.get("appc.client.topic." + controllerType + ".write")); + } properties.put("topic.sdnc.read", globalProperties.get("appc.client.topic.sdnc.read")); properties.put("topic.sdnc.write", globalProperties.get("appc.client.topic.sdnc.write")); + properties.put("sdnc-topic.read", globalProperties.get("appc.client.topic.sdnc.read")); + properties.put("sdnc-topic.write", globalProperties.get("appc.client.topic.sdnc.write")); properties.put("topic.read.timeout", globalProperties.get("appc.client.topic.read.timeout")); properties.put("client.response.timeout", globalProperties.get("appc.client.response.timeout")); properties.put("poolMembers", globalProperties.get("appc.client.poolMembers")); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/OofHomingTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/OofHomingTest.java index d7239fe0c1..283f3c6116 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/OofHomingTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/OofHomingTest.java @@ -549,7 +549,8 @@ public class OofHomingTest extends WorkflowTest { variables.put("isDebugLogEnabled", "true"); // variables.put("mso-request-id", "testRequestId"); variables.put("msoRequestId", "testRequestId"); - variables.put("serviceInstanceId", "testServiceInstanceId"); + variables.put("serviceInstanceId", "testServiceInstanceId123"); + variables.put("serviceInstanceName", "testServiceName"); variables.put("serviceDecomposition", serviceDecomposition); variables.put("subscriberInfo", subscriber2); } @@ -590,7 +591,8 @@ public class OofHomingTest extends WorkflowTest { variables.put("cloudRegionId", "TNZED"); variables.put("isDebugLogEnabled", "true"); variables.put("msoRequestId", "testRequestId"); - variables.put("serviceInstanceId", "testServiceInstanceId"); + variables.put("serviceInstanceId", "testServiceInstanceId123"); + variables.put("serviceInstanceName", "testServiceName"); variables.put("serviceDecomposition", serviceDecomposition); variables.put("subscriberInfo", subscriber2); } @@ -610,7 +612,8 @@ public class OofHomingTest extends WorkflowTest { variables.put("isDebugLogEnabled", "true"); // variables.put("mso-request-id", "testRequestId"); variables.put("msoRequestId", "testRequestId"); - variables.put("serviceInstanceId", "testServiceInstanceId"); + variables.put("serviceInstanceId", "testServiceInstanceId123"); + variables.put("serviceInstanceName", "testServiceName"); variables.put("serviceDecomposition", null); variables.put("subscriberInfo", subscriber2); } @@ -719,23 +722,19 @@ public class OofHomingTest extends WorkflowTest { "{\"globalSubscriberId\":\"SUB12_0322_DS_1201\",\"subscriberName\":\"SUB_12_0322_DS_1201\"," + "\"subscriberCommonSiteId\":\"\"},\"placementDemands\":[{\"resourceModuleName\":\"ALLOTTED_RESOURCE\"" + ",\"serviceResourceId\":\"testResourceIdAR\",\"tenantId\":" + - "\"null\",\"resourceModelInfo\":{\"modelInvariantId\":\"testModelInvariantIdAR\"," + + "\"\",\"resourceModelInfo\":{\"modelInvariantId\":\"testModelInvariantIdAR\"," + "\"modelVersionId\":\"testARModelUuid\",\"modelName\":\"testModelNameAR\",\"modelType\":" + "\"testModelTypeAR\",\"modelVersion\":\"testModelVersionAR\",\"modelCustomizationName\":\"\"}}," + "{\"resourceModuleName\":\"ALLOTTED_RESOURCE\",\"serviceResourceId\":\"testResourceIdAR2\"," + - "\"tenantId\":\"null\",\"resourceModelInfo\":{\"modelInvariantId\":\"testModelInvariantIdAR2\"," + + "\"tenantId\":\"\",\"resourceModelInfo\":{\"modelInvariantId\":\"testModelInvariantIdAR2\"," + "\"modelVersionId\":\"testAr2ModelUuid\",\"modelName\":\"testModelNameAR2\"," + "\"modelType\":\"testModelTypeAR2\",\"modelVersion\":\"testModelVersionAR2\"," + "\"modelCustomizationName\":\"\"}}]},\"serviceInfo\":" + "{\"serviceInstanceId\":\"testServiceInstanceId123\"," + - "\"serviceName\":\"null\",\"modelInfo\":{\"modelType\":\"\",\"modelInvariantId\":" + + "\"serviceName\":\"testServiceName\",\"modelInfo\":{\"modelType\":\"\",\"modelInvariantId\":" + "\"testModelInvariantId\",\"modelVersionId\":\"testModelUuid\",\"modelName\":\"testModelName\"," + "\"modelVersion\":\"testModelVersion\",\"modelCustomizationName\":\"" + - "\"}},\"licenseInfo\":{\"licenseDemands\":[{\"resourceModuleName\":\"VNF\",\"serviceResourceId\":" + - "\"testResourceIdVNF\",\"resourceInstanceType\":\"VNF\",\"resourceModelInfo\":{\"modelInvariantId\":" + - "\"testModelInvariantIdVNF\",\"modelVersionId\":\"testVnfModelUuid\",\"modelName\":" + - "\"testModelNameVNF\",\"modelType\":\"testModelTypeVNF\",\"modelVersion\":\"testModelVersionVNF\"," + - "\"modelCustomizationName\":\"\"}}]}}"; + "\"}}}"; return request; } diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy index a834431356..bbf61744a8 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy @@ -361,24 +361,28 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { List<Resource> deleteResourceList = serviceDecomposition.getServiceResources() String serviceRelationShip = execution.getVariable("serviceRelationShip") def jsonSlurper = new JsonSlurper() - def jsonOutput = new JsonOutput() - List relationShipList = jsonSlurper.parseText(serviceRelationShip) - - + def jsonOutput = new JsonOutput() + + List relationShipList = null + if (serviceRelationShip != null) { + relationShipList = jsonSlurper.parseText(serviceRelationShip) + } + //Set the real resource instance id to the decomosed resource list - for(Resource resource: deleteResourceList){ - //reset the resource instance id , because in the decompose flow ,its a random one. - resource.setResourceId(""); + for (Resource resource: deleteResourceList) { + //reset the resource instance id , because in the decompose flow ,its a random one. + resource.setResourceId(""); //match the resource-instance-name and the model name if (relationShipList != null) { relationShipList.each { - if(StringUtils.containsIgnoreCase(it.resourceType, resource.getModelInfo().getModelName())){ - resource.setResourceId(it.resourceInstanceId); - } + if (StringUtils.containsIgnoreCase(it.resourceType, resource.getModelInfo().getModelName())) { + resource.setResourceId(it.resourceInstanceId); + } } } } execution.setVariable("deleteResourceList", deleteResourceList) + utils.log("DEBUG", "delete resource list : " + deleteResourceList, isDebugEnabled) } catch (Exception ex) { String exceptionMessage = "Bpmn error encountered in create generic e2e service flow. processDecomposition() - " + ex.getMessage() utils.log("DEBUG", exceptionMessage, isDebugEnabled) diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy index 9e3f78bbda..0e4aea00ae 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy @@ -123,7 +123,7 @@ public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcess String isScaleFinished = "" // query the requested network service scale status, if finished, then start the next one, otherwise, wait - while (isScaleFinished != "finished"){ + while (isScaleFinished != "finished" && isScaleFinished != "error"){ timeDelay() queryNSProgress(execution) isScaleFinished = execution.getVariable("operationStatus") diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy index 05c3fa2d5b..ce117d3655 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy @@ -74,6 +74,8 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { execution.setVariable("brgWanMacAddress", "") execution.setVariable("customerLocation", "") execution.setVariable("homingService", "") + execution.setVariable("cloudOwner", "") + execution.setVariable("cloudRegionId", "") //TODO execution.setVariable("sdncVersion", "1707") @@ -127,6 +129,11 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { serviceInstanceId = UriUtils.encode(serviceInstanceId, "UTF-8") execution.setVariable("serviceInstanceId", serviceInstanceId) + utils.log("DEBUG", "Incoming serviceInstanceId is: " + serviceInstanceId, isDebugEnabled) + + String serviceInstanceName = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestInfo.instanceName") + execution.setVariable("serviceInstanceName", serviceInstanceName) + utils.log("DEBUG", "Incoming serviceInstanceName is: " + serviceInstanceName, isDebugEnabled) String requestAction = execution.getVariable("requestAction") execution.setVariable("requestAction", requestAction) @@ -169,6 +176,17 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { execution.setVariable("subscriberInfo", subscriberInfo) utils.log("DEBUG", "Incoming subscriberInfo is: " + subscriberInfo, isDebugEnabled) + // extract cloud configuration, split vid_ID into cloudOwner and cloudRegionId + String vimId = jsonUtil.getJsonValue(createVcpeServiceRequest, + "requestDetails.cloudConfiguration.lcpCloudRegionId") + def cloudRegion = vimId.split("_") + def cloudOwner = cloudRegion[0].toString() + def cloudRegionId = cloudRegion[1].toString() + execution.setVariable("cloudOwner", cloudOwner) + utils.log("DEBUG","cloudOwner: " + cloudOwner, isDebugEnabled) + execution.setVariable("cloudRegionId", cloudRegionId) + utils.log("DEBUG","cloudRegionId: " + cloudRegionId, isDebugEnabled) + /* * Extracting User Parameters from incoming Request and converting into a Map */ diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn index d1019887b0..9342e34f59 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn @@ -449,6 +449,9 @@ CreateVcpeResCustService.prepareCreateAllottedResourceTXC(execution)]]></bpmn2:s <camunda:in source="subscriberInfo" target="subscriberInfo" /> <camunda:in source="homingService" target="homingService" /> <camunda:in source="customerLocation" target="customerLocation" /> + <camunda:in source="cloudOwner" target="cloudOwner" /> + <camunda:in source="cloudRegionId" target="cloudRegionId" /> + <camunda:in source="serviceInstanceName" target="serviceInstanceName" /> </bpmn2:extensionElements> <bpmn2:incoming>SequenceFlow_11efpvh</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1jbuf1t</bpmn2:outgoing> |