From f4bf9e7ad4746fbec415c0ad34fa57f168840e30 Mon Sep 17 00:00:00 2001 From: sarada prasad sahoo Date: Fri, 7 Jun 2019 14:46:36 +0530 Subject: Enhanced List Level flow with backward support Modified the e2e service instance flow to support both new list types groups along with backward compatibility to support old types alloted resources, network etc. Change-Id: Ie8fc8a4550a90b44736b6b9de058e2a2e187570c Issue-ID: SO-1393 Signed-off-by: sarada prasad sahoo --- .../bpmn/common/resource/InstanceResourceList.java | 171 +++++----- .../common/resource/ResourceRequestBuilder.java | 9 +- .../common/resource/InstnaceResourceListTest.java | 76 ++++- .../InstanceResourceList/InstanceResourceList.json | 26 ++ .../scripts/ActivateSDNCNetworkResource.groovy | 90 ++++-- .../scripts/Create3rdONAPE2EServiceInstance.groovy | 14 +- .../scripts/CreateSDNCNetworkResource.groovy | 354 ++++++--------------- .../scripts/DeActivateSDNCNetworkResource.groovy | 58 ++++ .../scripts/Delete3rdONAPE2EServiceInstance.groovy | 21 +- .../scripts/DeleteSDNCNetworkResource.groovy | 124 +++++++- .../scripts/DoCreateE2EServiceInstance.groovy | 101 ++++++ .../scripts/DoCreateResources.groovy | 52 ++- .../scripts/DoDeleteE2EServiceInstance.groovy | 42 ++- .../scripts/DoDeleteResourcesV1.groovy | 1 + .../process/DeleteSDNCNetworkResource.bpmn | 105 +++--- .../subprocess/DoCreateE2EServiceInstance.bpmn | 206 +++++++----- .../resources/subprocess/DoCreateResources.bpmn | 174 +++++----- .../subprocess/DoDeleteE2EServiceInstance.bpmn | 5 +- 18 files changed, 961 insertions(+), 668 deletions(-) (limited to 'bpmn') diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java index 2b650e1eed..b1173bbf95 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java @@ -24,16 +24,15 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import org.onap.so.bpmn.core.domain.GroupResource; -import org.onap.so.bpmn.core.domain.Resource; -import org.onap.so.bpmn.core.domain.ResourceType; -import org.onap.so.bpmn.core.domain.VnfResource; import java.lang.reflect.Type; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; +import org.apache.commons.lang3.StringUtils; +import org.onap.so.bpmn.core.domain.GroupResource; +import org.onap.so.bpmn.core.domain.Resource; +import org.onap.so.bpmn.core.domain.VnfResource; public class InstanceResourceList { @@ -41,72 +40,6 @@ public class InstanceResourceList { throw new IllegalStateException("Utility class"); } - private static Map>> convertUUIReqTOStd(final JsonObject reqInputJsonObj, - List seqResourceList) { - - Map>> normalizedRequest = new HashMap<>(); - Resource lastVfProcessed = null; - for (Resource r : seqResourceList) { - - if (r.getResourceType() == ResourceType.VNF) { - String pk = getPrimaryKey(r); - - JsonElement vfNode = reqInputJsonObj.get(pk); - lastVfProcessed = r; - - // if the service property is type of array then it - // means it is a VF resource - if (vfNode instanceof JsonArray) { - - for (int i = 0; i < ((JsonArray) vfNode).size(); i++) { - List> groupsList = normalizedRequest.get(pk); - if (groupsList == null) { - groupsList = new ArrayList<>(); - normalizedRequest.put(pk, groupsList); - } - - groupsList.add(new ArrayList<>()); - } - } - - } else if (r.getResourceType() == ResourceType.GROUP) { - String sk = getPrimaryKey(r); - - // if sk is empty that means it is not list type - if (sk.isEmpty()) { - List> vfList = normalizedRequest.get(getPrimaryKey(lastVfProcessed)); - for (List grpList : vfList) { - grpList.add((GroupResource) r); - } - continue; - } - - String pk = getPrimaryKey(lastVfProcessed); - JsonArray vfs = reqInputJsonObj.getAsJsonArray(pk); - - for (int i = 0; i < vfs.size(); i++) { - - JsonElement vfcsNode = vfs.get(i).getAsJsonObject().get(sk); - if (vfcsNode instanceof JsonArray) { - - List groupResources = normalizedRequest.get(pk).get(i); - - if (groupResources == null) { - groupResources = new ArrayList<>(); - normalizedRequest.get(pk).add(i, groupResources); - } - - for (int j = 0; j < ((JsonArray) vfcsNode).size(); j++) { - groupResources.add((GroupResource) r); - } - } - } - - } - } - return normalizedRequest; - } - // this method returns key from resource input // e.g. {\"sdwansite_emails\" : \"[sdwansiteresource_list(PK), INDEX, sdwansite_emails]|default\", // ....} @@ -129,45 +62,87 @@ public class InstanceResourceList { return pkOpt.isPresent() ? pkOpt.get() : ""; } else { - // TODO: handle the case if VNF resource is not list - // e.g. { resourceInput return ""; } } - private static List convertToInstanceResourceList(Map>> normalizedReq, - List seqResourceList) { - List flatResourceList = new ArrayList<>(); - for (Resource r : seqResourceList) { - if (r.getResourceType() == ResourceType.VNF) { - String primaryKey = getPrimaryKey(r); - for (String pk : normalizedReq.keySet()) { - if (primaryKey.equalsIgnoreCase(pk)) { - - List> vfs = normalizedReq.get(pk); + public static List getInstanceResourceList(final VnfResource vnfResource, final String uuiRequest) { + List sequencedResourceList = new ArrayList(); + Gson gson = new Gson(); + JsonObject servJsonObject = gson.fromJson(uuiRequest, JsonObject.class); + JsonObject reqInputJsonObj = servJsonObject.getAsJsonObject("service").getAsJsonObject("parameters") + .getAsJsonObject("requestInputs"); - vfs.stream().forEach(e -> { - flatResourceList.add(r); - flatResourceList.addAll(e); - }); + String pk = getPrimaryKey(vnfResource); + // if pk is not empty that means it can contain list of VNF + if (!pk.isEmpty()) { + JsonElement vfNode = reqInputJsonObj.get(pk); + if (vfNode.isJsonArray()) { + // multiple instance of VNF + JsonArray vfNodeList = vfNode.getAsJsonArray(); + for (JsonElement vf : vfNodeList) { + JsonObject vfObj = vf.getAsJsonObject(); + + // Add VF first before adding groups + sequencedResourceList.add(vnfResource); + List sequencedGroupResourceList = getGroupResourceInstanceList(vnfResource, vfObj); + if (!sequencedGroupResourceList.isEmpty()) { + sequencedResourceList.addAll(sequencedGroupResourceList); } } } + } else { + // if pk is empty that means it has only one VNF Node + // Add VF first before adding groups + sequencedResourceList.add(vnfResource); + // check the groups for this VNF and add into resource list + List sequencedGroupResourceList = getGroupResourceInstanceList(vnfResource, reqInputJsonObj); + if (!sequencedGroupResourceList.isEmpty()) { + sequencedResourceList.addAll(sequencedGroupResourceList); + } } - return flatResourceList; - } - public static List getInstanceResourceList(final List seqResourceList, - final String uuiRequest) { + // In negative case consider only VNF resource only + if (sequencedResourceList.isEmpty()) { + sequencedResourceList.add(vnfResource); + } - Gson gson = new Gson(); - JsonObject servJsonObject = gson.fromJson(uuiRequest, JsonObject.class); - JsonObject reqInputJsonObj = servJsonObject.getAsJsonObject("service").getAsJsonObject("parameters") - .getAsJsonObject("requestInputs"); + return sequencedResourceList; + } - // this will convert UUI request to normalized form - Map>> normalizedRequest = convertUUIReqTOStd(reqInputJsonObj, seqResourceList); - return convertToInstanceResourceList(normalizedRequest, seqResourceList); + private static List getGroupResourceInstanceList(VnfResource vnfResource, JsonObject vfObj) { + List sequencedResourceList = new ArrayList(); + if (vnfResource.getGroupOrder() != null && !StringUtils.isEmpty(vnfResource.getGroupOrder())) { + String[] grpSequence = vnfResource.getGroupOrder().split(","); + for (String grpType : grpSequence) { + for (GroupResource gResource : vnfResource.getGroups()) { + if (StringUtils.containsIgnoreCase(gResource.getModelInfo().getModelName(), grpType)) { + // check the number of group instances from UUI to be added + String sk = getPrimaryKey(gResource); + + // if sk is empty that means it is not list type + // only one group / vnfc to be considered + if (sk.isEmpty()) { + sequencedResourceList.add(gResource); + } else { + // check the number of list size of VNFC of a group + JsonElement vfcNode = vfObj.get(sk); + if (vfcNode.isJsonArray()) { + JsonArray vfcList = vfcNode.getAsJsonArray(); + for (JsonElement vfc : vfcList) { + sequencedResourceList.add(gResource); + } + } else { + // consider only one vnfc/group if not an array + sequencedResourceList.add(gResource); + } + } + + } + } + } + } + return sequencedResourceList; } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java index faa3d74dba..b814d6c595 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java @@ -122,8 +122,13 @@ public class ResourceRequestBuilder { Map uuiRequestInputs = null; if (JsonUtils.getJsonValue(uuiServiceParameters, "requestInputs") != null) { - uuiRequestInputs = - getJsonObject((String) JsonUtils.getJsonValue(uuiServiceParameters, "requestInputs"), Map.class); + String uuiRequestInputStr = JsonUtils.getJsonValue(uuiServiceParameters, "requestInputs"); + logger.info("resource input from UUI: " + uuiRequestInputStr); + if (uuiRequestInputStr == null || uuiRequestInputStr.isEmpty()) { + uuiRequestInputStr = "{}"; + } + + uuiRequestInputs = getJsonObject(uuiRequestInputStr, Map.class); } if (uuiRequestInputs == null) { diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/InstnaceResourceListTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/InstnaceResourceListTest.java index 3be67c965c..f3233f2350 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/InstnaceResourceListTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/InstnaceResourceListTest.java @@ -3,6 +3,7 @@ package org.onap.so.bpmn.common.resource; import org.junit.Assert; import org.junit.Test; import org.onap.so.bpmn.core.domain.GroupResource; +import org.onap.so.bpmn.core.domain.ModelInfo; import org.onap.so.bpmn.core.domain.Resource; import org.onap.so.bpmn.core.domain.ResourceType; import org.onap.so.bpmn.core.domain.VnfResource; @@ -23,15 +24,67 @@ public class InstnaceResourceListTest { String uuiRequest = new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "InstanceResourceList" + ".json"))); List instanceResourceList = InstanceResourceList.getInstanceResourceList(createResourceSequence(), uuiRequest); - Assert.assertEquals(4, instanceResourceList.size()); + Assert.assertEquals(7, instanceResourceList.size()); Assert.assertEquals(ResourceType.VNF, instanceResourceList.get(0).getResourceType()); Assert.assertEquals(ResourceType.GROUP, instanceResourceList.get(1).getResourceType()); - Assert.assertEquals(ResourceType.VNF, instanceResourceList.get(2).getResourceType()); + Assert.assertEquals("device", instanceResourceList.get(1).getModelInfo().getModelName()); + Assert.assertEquals(ResourceType.GROUP, instanceResourceList.get(2).getResourceType()); + Assert.assertEquals("sitewan", instanceResourceList.get(2).getModelInfo().getModelName()); Assert.assertEquals(ResourceType.GROUP, instanceResourceList.get(3).getResourceType()); + Assert.assertEquals("sitewan", instanceResourceList.get(3).getModelInfo().getModelName()); + Assert.assertEquals(ResourceType.VNF, instanceResourceList.get(4).getResourceType()); + Assert.assertEquals(ResourceType.GROUP, instanceResourceList.get(5).getResourceType()); + Assert.assertEquals(ResourceType.GROUP, instanceResourceList.get(6).getResourceType()); } - private List createResourceSequence() { - List resourceList = new ArrayList<>(); + // Test when PK is empty + @Test + public void testSimpleVFResource() throws IOException { + String uuiRequest = new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "InstanceResourceList" + ".json"))); + VnfResource vnfResource = new VnfResource(); + vnfResource.setResourceInput("{\"a\":\"ipaddress|127.0.0.1\"}"); + List instanceResourceList = InstanceResourceList.getInstanceResourceList(vnfResource, uuiRequest); + Assert.assertEquals(1, instanceResourceList.size()); + Assert.assertEquals(ResourceType.VNF, instanceResourceList.get(0).getResourceType()); + } + + // Test when PK is not empty and PK does not contain any groups + @Test + public void testVFWithEmptyGroupResource() throws IOException { + String uuiRequest = new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "InstanceResourceList" + ".json"))); + VnfResource vnfResource = new VnfResource(); + vnfResource.setResourceInput("{\"a\":\"[emptygroup_list,INDEX,name]\"}"); + List instanceResourceList = InstanceResourceList.getInstanceResourceList(vnfResource, uuiRequest); + Assert.assertEquals(1, instanceResourceList.size()); + Assert.assertEquals(ResourceType.VNF, instanceResourceList.get(0).getResourceType()); + } + + // Test when PK is not empty and contains a group which SK is empty + @Test + public void testVFWithEmptyGroupKeyResource() throws IOException { + String uuiRequest = new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "InstanceResourceList" + ".json"))); + VnfResource vnfResource = new VnfResource(); + vnfResource.setResourceInput("{\"a\":\"[emptygroup_list,INDEX,name]\"}"); + + VnfcResource vnfcResource = new VnfcResource(); + vnfcResource.setResourceInput("{\"a\":\"test|default_value\"}"); + GroupResource groupResource = new GroupResource(); + groupResource.setVnfcs(Arrays.asList(vnfcResource)); + ModelInfo wanModel = new ModelInfo(); + wanModel.setModelName("wan"); + groupResource.setModelInfo(wanModel); + + vnfResource.setGroupOrder("wan"); + vnfResource.setGroups(Arrays.asList(groupResource)); + + List instanceResourceList = InstanceResourceList.getInstanceResourceList(vnfResource, uuiRequest); + Assert.assertEquals(2, instanceResourceList.size()); + Assert.assertEquals(ResourceType.VNF, instanceResourceList.get(0).getResourceType()); + Assert.assertEquals(ResourceType.GROUP, instanceResourceList.get(1).getResourceType()); + Assert.assertEquals("wan", instanceResourceList.get(1).getModelInfo().getModelName()); + } + + private VnfResource createResourceSequence() { VnfResource vnfResource = new VnfResource(); vnfResource.setResourceInput("{\"a\":\"[sdwansiteresource_list,INDEX,sdwansiteresource_list]\"}"); @@ -40,7 +93,20 @@ public class InstnaceResourceListTest { GroupResource groupResource = new GroupResource(); groupResource.setVnfcs(Arrays.asList(vnfcResource)); + ModelInfo wanModel = new ModelInfo(); + wanModel.setModelName("sitewan"); + groupResource.setModelInfo(wanModel); + + VnfcResource vnfcDeviceResource = new VnfcResource(); + vnfcDeviceResource.setResourceInput("{\"a\":\"[sdwandevice_list,INDEX,test]\"}"); + GroupResource groupResource2 = new GroupResource(); + groupResource2.setVnfcs(Arrays.asList(vnfcDeviceResource)); + ModelInfo deviceModel = new ModelInfo(); + deviceModel.setModelName("device"); + groupResource2.setModelInfo(deviceModel); - return Arrays.asList(vnfResource, groupResource); + vnfResource.setGroupOrder("device,sitewan"); + vnfResource.setGroups(Arrays.asList(groupResource, groupResource2)); + return vnfResource; } } diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/InstanceResourceList/InstanceResourceList.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/InstanceResourceList/InstanceResourceList.json index 0b3d9f0bbe..a111ae2646 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/InstanceResourceList/InstanceResourceList.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/InstanceResourceList/InstanceResourceList.json @@ -67,6 +67,19 @@ } ], "requestInputs":{ + "emptygroup_list": [ + { + "topology": "hub_spoke", + "name": "defaultvpn", + "role":"Hub", + "portType":"GE", + "portSwitch":"layer3-port", + "vlanId":"", + "ipAddress":"192.168.10.1", + "deviceName":"vCPE", + "portNumer":"0/0/1" + } + ], "sdwanvpnresource_list":[ { "sdwanvpn_topology":"hub_spoke", @@ -117,6 +130,19 @@ "portNumber":"0/0/0", "ipMode":"DHCP", "publicIP":"119.3.7.113" + }, + { + "providerIpAddress":"", + "portType":"GE", + "inputBandwidth":"1200", + "ipAddress":"", + "name":"10001", + "transportNetworkName":"internet", + "outputBandwidth":"10001", + "deviceName":"vCPE", + "portNumber":"0/0/0", + "ipMode":"DHCP", + "publicIP":"119.3.7.114" } ], "sdwandevice_list":[ diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy index 0338647ce7..30b5cc8567 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy @@ -83,9 +83,14 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor { //the operationType from worflow(first node) is highest priority. operationType = jsonUtil.getJsonValue(recipeParamsFromWf, "operationType") } + String operationTypeFromConfig = UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() + ".operation-type") + if (StringUtils.isNotEmpty(operationTypeFromConfig)) { + // highest priority if operation type configured + operationType = operationTypeFromConfig + } String sdnc_svcAction = "activate" - String sdnc_requestAction = sdnc_svcAction.capitalize() + UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() +".operation-type") + "Instance" + String sdnc_requestAction = sdnc_svcAction.capitalize() + operationType + "Instance" execution.setVariable(Prefix + "svcAction", sdnc_svcAction) execution.setVariable(Prefix + "requestAction", sdnc_requestAction) @@ -194,24 +199,6 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor { String sdncTopologyActivateRequest = "" String modelType = resourceInputObj.getResourceModelInfo().getModelType() - //When a new resource creation request reaches SO, the parent resources information needs to be provided - //while creating the child resource. - String vnfid = "" - String vnfmodelInvariantUuid = "" - String vnfmodelCustomizationUuid = "" - String vnfmodelUuid = "" - String vnfmodelVersion = "" - String vnfmodelName = "" - if(modelType.equalsIgnoreCase(ResourceType.GROUP.toString())) { - vnfid = resourceInputObj.getVnfId() - ModelInfo vfModelInfo = resourceInputObj.getVfModelInfo() - vnfmodelInvariantUuid = vfModelInfo.getModelInvariantUuid() - vnfmodelCustomizationUuid = vfModelInfo.getModelCustomizationUuid() - vnfmodelUuid = vfModelInfo.getModelUuid() - vnfmodelVersion = vfModelInfo.getModelVersion() - vnfmodelName = vfModelInfo.getModelName() - } - switch (modelType) { case "VNF" : sdncTopologyActivateRequest = """ @@ -335,6 +331,61 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor { """.trim() break + // sdwanvpnattachment or sotnvpnattachment + case "ALLOTTED_RESOURCE" : + sdncTopologyActivateRequest = + """ + + ${msoUtils.xmlEscape(hdrRequestId)} + ${msoUtils.xmlEscape(serviceInstanceId)} + ${msoUtils.xmlEscape(sdnc_svcAction)} + connection-attachment-topology-operation + sdncCallback + generic-resource + + + + ${msoUtils.xmlEscape(hdrRequestId)} + ${msoUtils.xmlEscape(sdnc_requestAction)} + ${msoUtils.xmlEscape(source)} + + + + + + ${msoUtils.xmlEscape(serviceInstanceId)} + ${msoUtils.xmlEscape(serviceType)} + + ${msoUtils.xmlEscape(serviceModelInvariantUuid)} + ${msoUtils.xmlEscape(serviceModelUuid)} + ${msoUtils.xmlEscape(serviceModelVersion)} + ${msoUtils.xmlEscape(serviceModelName)} + + ${msoUtils.xmlEscape(serviceInstanceId)} + ${msoUtils.xmlEscape(globalCustomerId)} + + + ${msoUtils.xmlEscape(resourceInstanceId)} + + $parentServiceInstanceId + + ${msoUtils.xmlEscape(modelInvariantUuid)} + ${msoUtils.xmlEscape(modelCustomizationUuid)} + ${msoUtils.xmlEscape(modelUuid)} + ${msoUtils.xmlEscape(modelVersion)} + ${msoUtils.xmlEscape(modelName)} + + + + $netowrkInputParameters + + + """.trim() + + break + // for SDWANConnectivity and SOTN Connectivity default: sdncTopologyActivateRequest = @@ -371,7 +422,6 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor { ${msoUtils.xmlEscape(globalCustomerId)} - ${msoUtils.xmlEscape(resourceInstanceId)} ${msoUtils.xmlEscape(modelInvariantUuid)} diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy index 1578f0f7c0..044f0b462b 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy @@ -353,6 +353,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso // ExternalAPI message format String externalId = execution.getVariable("resourceName") + String serviceType = execution.getVariable("serviceType") String category = "E2E Service" String description = "Service Order from SPPartner" String requestedStartDate = utils.generateCurrentTimeInUtc() @@ -360,7 +361,9 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso String priority = "1" // 0-4 0:highest String subscriberId = execution.getVariable("globalSubscriberId") String customerRole = "ONAPcustomer" - String subscriberName = subscriberId + // Below SO will pass serviceType as subscriberName and externalAPI will use + // the same serviceType in another domain instead of model name + String subscriberName = serviceType String referredType = "Consumer" String orderItemId = "1" String action = "add" //for create @@ -401,7 +404,6 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso _requestInputs_ += ",\n" + externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap) requestInputsMap.clear() - String serviceType = execution.getVariable("serviceType") requestInputsMap.put("inputName", '"serviceType"') requestInputsMap.put("inputValue", '"' + serviceType + '"') _requestInputs_ += ",\n" + externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap) @@ -420,7 +422,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso String payload = externalAPIUtil.setTemplate(ExternalAPIUtil.PostServiceOrderRequestsTemplate, valueMap) execution.setVariable(Prefix + "Payload", payload) - logger.info("Exit " + prepare3rdONAPRequest) + logger.info(" ***** Exit prepare3rdONAPRequest *****") } public void doCreateE2ESIin3rdONAP(DelegateExecution execution) { @@ -464,7 +466,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso logger.error("doCreateE2ESIin3rdONAP exception:" + e.getMessage()) } - logger.info("Exit " + doCreateE2ESIin3rdONAP) + logger.info(" ***** Exit doCreateE2ESIin3rdONAP *****") } @@ -562,7 +564,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso execution.setVariable("statusDescription", "Get Create ServiceOrder Exception") logger.error("getE2ESIProgressin3rdONAP exception:" + e.getMessage()) } - logger.info("Exit " + getE2ESIProgressin3rdONAP) + logger.info(" ***** Exit getE2ESIProgressin3rdONAP *****") } /** @@ -608,7 +610,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso logger.info(msg) // throw new BpmnError("MSOWorkflowException") } - logger.info("Exit " + saveSPPartnerInAAI) + logger.info(" ***** Exit saveSPPartnerInAAI *****") } private void setProgressUpdateVariables(DelegateExecution execution, String body) { diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy index d431bdc3b4..b0419be7cb 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy @@ -22,7 +22,7 @@ package org.onap.so.bpmn.infrastructure.scripts -import com.google.gson.Gson + import org.apache.commons.lang3.* import org.camunda.bpm.engine.delegate.BpmnError import org.camunda.bpm.engine.delegate.DelegateExecution @@ -32,11 +32,8 @@ import org.onap.aai.domain.yang.ServiceInstance import org.onap.aai.domain.yang.ServiceInstances import org.onap.aai.domain.yang.v13.Metadata import org.onap.aai.domain.yang.v13.Metadatum -import org.onap.aai.domain.yang.v13.Pnf -import org.onap.aai.domain.yang.v13.Pnfs import org.onap.so.bpmn.common.recipe.ResourceInput import org.onap.so.bpmn.common.resource.ResourceRequestBuilder -import org.onap.so.bpmn.common.scripts.AaiUtil import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor import org.onap.so.bpmn.common.scripts.ExceptionUtil import org.onap.so.bpmn.common.scripts.MsoUtils @@ -52,8 +49,6 @@ import org.onap.so.client.aai.entities.uri.AAIUriFactory import org.slf4j.Logger import org.slf4j.LoggerFactory -import static org.apache.commons.lang3.StringUtils.* - /** * This groovy class supports the CreateSDNCCNetworkResource.bpmn process. * flow for SDNC Network Resource Create @@ -88,7 +83,6 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { //Deal with recipeParams String recipeParamsFromWf = execution.getVariable("recipeParamXsd") - String resourceName = resourceInputObj.getResourceInstanceName() //For sdnc requestAction default is "createNetworkInstance" String operationType = "Network" @@ -100,9 +94,14 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { //the operationType from worflow(first node) is highest priority. operationType = jsonUtil.getJsonValue(recipeParamsFromWf, "operationType") } + String operationTypeFromConfig = UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() + ".operation-type") + if (StringUtils.isNotEmpty(operationTypeFromConfig)) { + // highest priority if operation type configured + operationType = operationTypeFromConfig + } String sdnc_svcAction = "create" - String sdnc_requestAction = sdnc_svcAction.capitalize() + UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() +".operation-type") + "Instance" + String sdnc_requestAction = sdnc_svcAction.capitalize() + operationType + "Instance" String isActivateRequired = UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() +".activation-required") execution.setVariable("isActivateRequired", isActivateRequired) @@ -278,27 +277,38 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { case ~/[\w\s\W]*sdwanvpnattachment[\w\s\W]*/ : case ~/[\w\s\W]*sotnvpnattachment[\w\s\W]*/ : // fill attachment TP in networkInputParamJson - String customer = resourceInputObj.getGlobalSubscriberId() - String serviceType = resourceInputObj.getServiceType() - def vpnName = StringUtils.containsIgnoreCase(modelName, "sotnvpnattachment") ? "sotnvpnattachmentvf_sotncondition_sotnVpnName" : "sdwanvpnattachmentvf_sdwancondition_sdwanVpnName" - String parentServiceName = jsonUtil.getJsonValueForKey(resourceInputObj.getRequestsInputs(), vpnName) - - AAIResourcesClient client = new AAIResourcesClient() - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.SERVICE_INSTANCE, customer, serviceType).queryParam("service-instance-name", parentServiceName) - ServiceInstances sis = client.get(uri).asBean(ServiceInstances.class).get() - ServiceInstance si = sis.getServiceInstance().get(0) - - def parentServiceInstanceId = si.getServiceInstanceId() - execution.setVariable("parentServiceInstanceId", parentServiceInstanceId) + fillAttachmentTPInfo(resourceInputObj, modelName, execution, vpnName) break default: + // Special case for handling alloted resource types + // in case name is different as expected + if ("ALLOTTED_RESOURCE".equals(resourceInputObj.getResourceModelInfo().getModelType())) { + def vpnName = modelName + "_sotnVpnName" + fillAttachmentTPInfo(resourceInputObj, modelName, execution, vpnName) + } break } return resourceInputObj } + private void fillAttachmentTPInfo(ResourceInput resourceInputObj, String modelName, DelegateExecution execution, String vpnName) { + String customer = resourceInputObj.getGlobalSubscriberId() + String serviceType = resourceInputObj.getServiceType() + + String parentServiceName = jsonUtil.getJsonValueForKey(resourceInputObj.getRequestsInputs(), vpnName) + + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.SERVICE_INSTANCE, customer, serviceType).queryParam("service-instance-name", parentServiceName) + ServiceInstances sis = client.get(uri).asBean(ServiceInstances.class).get() + logger.debug("Fetched AAI ServiceInstances for the vpnName:" + vpnName + " is " + sis.getServiceInstance().toString()) + ServiceInstance si = sis.getServiceInstance().get(0) + + def parentServiceInstanceId = si.getServiceInstanceId() + execution.setVariable("parentServiceInstanceId", parentServiceInstanceId) + } + /** * Pre Process the BPMN Flow Request * Includes: @@ -339,26 +349,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { // 1. prepare assign topology via SDNC Adapter SUBFLOW call String sdncTopologyCreateRequest = ""; - - - //When a new resource creation request reaches SO, the parent resources information needs to be provided - //while creating the child resource. - String vnfid = "" - String vnfmodelInvariantUuid = "" - String vnfmodelCustomizationUuid = "" - String vnfmodelUuid = "" - String vnfmodelVersion = "" - String vnfmodelName = "" String modelType = resourceInputObj.getResourceModelInfo().getModelType() - if(modelType.equalsIgnoreCase(ResourceType.GROUP.toString())) { - vnfid = resourceInputObj.getVnfId() - ModelInfo vfModelInfo = resourceInputObj.getVfModelInfo() - vnfmodelInvariantUuid = vfModelInfo.getModelInvariantUuid() - vnfmodelCustomizationUuid = vfModelInfo.getModelCustomizationUuid() - vnfmodelUuid = vfModelInfo.getModelUuid() - vnfmodelVersion = vfModelInfo.getModelVersion() - vnfmodelName = vfModelInfo.getModelName() - } switch (modelType) { case "VNF" : @@ -418,6 +409,13 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { """.trim() break case "GROUP" : + String vnfid = resourceInputObj.getVnfId() + ModelInfo vfModelInfo = resourceInputObj.getVfModelInfo() + String vnfmodelInvariantUuid = vfModelInfo.getModelInvariantUuid() + String vnfmodelCustomizationUuid = vfModelInfo.getModelCustomizationUuid() + String vnfmodelUuid = vfModelInfo.getModelUuid() + String vnfmodelVersion = vfModelInfo.getModelVersion() + String vnfmodelName = vfModelInfo.getModelName() sdncTopologyCreateRequest = """ @@ -480,7 +478,62 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { """.trim() break - // for SDWANConnectivity and SOTNConnectivity: + // sdwanvpnattachment or sotnvpnattachment + case "ALLOTTED_RESOURCE" : + sdncTopologyCreateRequest = """ + + ${msoUtils.xmlEscape(hdrRequestId)} + ${msoUtils.xmlEscape(serviceInstanceId)} + ${msoUtils.xmlEscape(sdnc_svcAction)} + connection-attachment-topology-operation + sdncCallback + generic-resource + + + + ${msoUtils.xmlEscape(hdrRequestId)} + ${msoUtils.xmlEscape(sdnc_requestAction)} + ${msoUtils.xmlEscape(source)} + + + + + + ${msoUtils.xmlEscape(serviceInstanceId)} + ${msoUtils.xmlEscape(serviceType)} + + ${msoUtils.xmlEscape(serviceModelInvariantUuid)} + ${msoUtils.xmlEscape(serviceModelUuid)} + ${msoUtils.xmlEscape(serviceModelVersion)} + ${msoUtils.xmlEscape(serviceModelName)} + + ${msoUtils.xmlEscape(serviceInstanceId)} + ${msoUtils.xmlEscape(globalCustomerId)} + ${msoUtils.xmlEscape(globalCustomerId)} + + + + + $parentServiceInstanceId + + ${msoUtils.xmlEscape(modelInvariantUuid)} + ${msoUtils.xmlEscape(modelCustomizationUuid)} + ${msoUtils.xmlEscape(modelUuid)} + ${msoUtils.xmlEscape(modelVersion)} + ${msoUtils.xmlEscape(modelName)} + + + + $netowrkInputParameters + + + """.trim() + + break + + // for SDWANConnectivity and SOTNConnectivity: default: sdncTopologyCreateRequest = """ - - ${msoUtils.xmlEscape(hdrRequestId)} - ${msoUtils.xmlEscape(serviceInstanceId)} - ${msoUtils.xmlEscape(sdnc_svcAction)} - vnf-topology-operation - sdncCallback - generic-resource - - - - ${msoUtils.xmlEscape(hdrRequestId)} - ${msoUtils.xmlEscape(sdnc_requestAction)} - ${msoUtils.xmlEscape(source)} - - - - - - ${msoUtils.xmlEscape(serviceInstanceId)} - ${msoUtils.xmlEscape(serviceType)} - - ${msoUtils.xmlEscape(serviceModelInvariantUuid)} - ${msoUtils.xmlEscape(serviceModelUuid)} - ${msoUtils.xmlEscape(serviceModelVersion)} - ${msoUtils.xmlEscape(serviceModelName)} - - ${msoUtils.xmlEscape(serviceInstanceId)} - ${msoUtils.xmlEscape(globalCustomerId)} - ${msoUtils.xmlEscape(globalCustomerId)} - - - - - - ${msoUtils.xmlEscape(modelInvariantUuid)} - ${msoUtils.xmlEscape(modelCustomizationUuid)} - ${msoUtils.xmlEscape(modelUuid)} - ${msoUtils.xmlEscape(modelVersion)} - ${msoUtils.xmlEscape(modelName)} - - - - - $netowrkInputParameters - - - - - - - - """.trim() - - - break - - //case ~/[\w\s\W]*sdwanvpnattachment[\w\s\W]*/ - //case ~/[\w\s\W]*sotnvpnattachment[\w\s\W]*/ : - /* sdncTopologyCreateRequest = """ - - ${msoUtils.xmlEscape(hdrRequestId)} - ${msoUtils.xmlEscape(serviceInstanceId)} - ${msoUtils.xmlEscape(sdnc_svcAction)} - connection-attachment-topology-operation - sdncCallback - generic-resource - - - - ${msoUtils.xmlEscape(hdrRequestId)} - ${msoUtils.xmlEscape(sdnc_requestAction)} - ${msoUtils.xmlEscape(source)} - - - - - - ${msoUtils.xmlEscape(serviceInstanceId)} - ${msoUtils.xmlEscape(serviceType)} - - ${msoUtils.xmlEscape(serviceModelInvariantUuid)} - ${msoUtils.xmlEscape(serviceModelUuid)} - ${msoUtils.xmlEscape(serviceModelVersion)} - ${msoUtils.xmlEscape(serviceModelName)} - - ${msoUtils.xmlEscape(serviceInstanceId)} - ${msoUtils.xmlEscape(globalCustomerId)} - ${msoUtils.xmlEscape(globalCustomerId)} - - - - - ${msoUtils.xmlEscape(modelInvariantUuid)} - ${msoUtils.xmlEscape(modelCustomizationUuid)} - ${msoUtils.xmlEscape(modelUuid)} - ${msoUtils.xmlEscape(modelVersion)} - ${msoUtils.xmlEscape(modelName)} - - - - - $netowrkInputParameters - - - - - - - - - - - $parentServiceInstanceId - - ${msoUtils.xmlEscape(modelInvariantUuid)} - ${msoUtils.xmlEscape(modelCustomizationUuid)} - ${msoUtils.xmlEscape(modelUuid)} - ${msoUtils.xmlEscape(modelVersion)} - ${msoUtils.xmlEscape(modelName)} - - - - $netowrkInputParameters - - - """.trim() - break - - // for SDWANConnectivity and SOTNConnectivity: - default: - sdncTopologyCreateRequest = """ - - ${hdrRequestId} - ${msoUtils.xmlEscape(serviceInstanceId)} - ${msoUtils.xmlEscape(sdnc_svcAction)} - network-topology-operation - sdncCallback - generic-resource - - - - ${msoUtils.xmlEscape(hdrRequestId)} - ${msoUtils.xmlEscape(sdnc_requestAction)} - ${msoUtils.xmlEscape(source)} - - - - - - ${msoUtils.xmlEscape(serviceInstanceId)} - ${msoUtils.xmlEscape(serviceType)} - - ${msoUtils.xmlEscape(serviceModelInvariantUuid)} - ${msoUtils.xmlEscape(serviceModelUuid)} - ${msoUtils.xmlEscape(serviceModelVersion)} - ${msoUtils.xmlEscape(serviceModelName)} - - ${msoUtils.xmlEscape(serviceInstanceId)} - ${msoUtils.xmlEscape(globalCustomerId)} - - - - ${msoUtils.xmlEscape(modelInvariantUuid)} - ${msoUtils.xmlEscape(modelCustomizationUuid)} - ${msoUtils.xmlEscape(modelUuid)} - ${msoUtils.xmlEscape(modelVersion)} - ${msoUtils.xmlEscape(modelName)} - - - - $netowrkInputParameters - - - """.trim() - } - - **/ - String sndcTopologyCreateRequesAsString = utils.formatXml(sdncTopologyCreateRequest) execution.setVariable("sdncAdapterWorkflowRequest", sndcTopologyCreateRequesAsString) logger.debug("sdncAdapterWorkflowRequest - " + "\n" + sndcTopologyCreateRequesAsString) @@ -813,40 +674,20 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { String responseCode = execution.getVariable(Prefix + "sdncCreateReturnCode") String responseObj = execution.getVariable(Prefix + "SuccessIndicator") - def instnaceId = getInstnaceId(execution) + def instnaceId = getInstanceId(execution) execution.setVariable("resourceInstanceId", instnaceId) logger.info("response from sdnc, response code :" + responseCode + " response object :" + responseObj) logger.info(" ***** Exit prepareSDNCRequest *****") } - private def getInstnaceId(DelegateExecution execution) { + private def getInstanceId(DelegateExecution execution) { def response = new XmlSlurper().parseText(execution.getVariable("CRENWKI_createSDNCResponse")) ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(execution.getVariable(Prefix + "resourceInput"), ResourceInput.class) String modelName = resourceInputObj.getResourceModelInfo().getModelName() def val = "" - - //switch (modelName) { - // case ~/[\w\s\W]*deviceVF[\w\s\W]*/ : - // case ~/[\w\s\W]*SiteWANVF[\w\s\W]*/ : - // case ~/[\w\s\W]*Site[\w\s\W]*/: - // val = response."response-data"."RequestData"."output"."vnf-response-information"."instance-id" - // break - - // case ~/[\w\s\W]*sdwanvpnattachment[\w\s\W]*/ : - // case ~/[\w\s\W]*sotnvpprepareUpdateAfterCreateSDNCResourcenattachment[\w\s\W]*/: - // val = response."response-data"."RequestData"."output"."connection-attachment-response-information"."instance-id" - // break - - // for SDWANConnectivity and SOTNConnectivity and default: - // default: - // val = response."response-data"."RequestData"."output"."network-response-information"."instance-id" - // break - //} - - String modelType = resourceInputObj.getResourceModelInfo().getModelType() switch (modelType) { case "VNF" : @@ -855,7 +696,12 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { case "GROUP": val = response."response-data"."RequestData"."output"."vf-module-response-information"."instance-id" break + case "ALLOTTED_RESOURCE": + // sdwanvpnattachment or sotnvpnattachment + val = response."response-data"."RequestData"."output"."connection-attachment-response-information"."instance-id" + break default: + // SDWANConnectivity or SOTN Connectivity val = response."response-data"."RequestData"."output"."network-response-information"."instance-id" break } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy index 3d62a6ca90..097a1be291 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy @@ -118,6 +118,8 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId") String source = execution.getVariable("source") String sdnc_service_id = execution.getVariable(Prefix + "sdncServiceId") + String resourceInput = execution.getVariable("resourceInput") + String allotedParentServiceInstanceId = execution.getVariable("allotedParentServiceInstanceId") ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class) String serviceType = resourceInputObj.getServiceType() String serviceModelInvariantUuid = resourceInputObj.getServiceModelInfo().getModelInvariantUuid() @@ -268,6 +270,61 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor """.trim() break + // sdwanvpnattachment or sotnvpnattachment + case "ALLOTTED_RESOURCE" : + + sdncTopologyDeleteRequest = """ + + ${msoUtils.xmlEscape(hdrRequestId)} + ${msoUtils.xmlEscape(serviceInstanceId)} + ${msoUtils.xmlEscape(sdnc_svcAction)} + connection-attachment-topology-operation + sdncCallback + generic-resource + + + + ${msoUtils.xmlEscape(hdrRequestId)} + ${msoUtils.xmlEscape(sdnc_requestAction)} + ${msoUtils.xmlEscape(source)} + + + + + + ${msoUtils.xmlEscape(serviceInstanceId)} + ${msoUtils.xmlEscape(serviceType)} + + ${msoUtils.xmlEscape(serviceModelInvariantUuid)} + ${msoUtils.xmlEscape(serviceModelUuid)} + ${msoUtils.xmlEscape(serviceModelVersion)} + ${msoUtils.xmlEscape(serviceModelName)} + + ${msoUtils.xmlEscape(serviceInstanceId)} + ${msoUtils.xmlEscape(globalCustomerId)} + + + + $resourceInstnaceId + + $allotedParentServiceInstanceId + + ${msoUtils.xmlEscape(modelInvariantUuid)} + ${msoUtils.xmlEscape(modelCustomizationUuid)} + ${msoUtils.xmlEscape(modelUuid)} + ${msoUtils.xmlEscape(modelVersion)} + ${msoUtils.xmlEscape(modelName)} + + + + + + """.trim() + + break + // for SDWANConnectivity and SOTNConnectivity: default: sdncTopologyDeleteRequest = """ si = aaiResult.asBean(AllottedResource.class) + if((si.present) && (null != si.get().getRelationshipList()) && (null != si.get().getRelationshipList().getRelationship())) { + logger.debug("SI Data relationship-list exists") + List relationshipList = si.get().getRelationshipList().getRelationship() + for (Relationship relationship : relationshipList) { + String rt = relationship.getRelatedTo() + List rl_datas = relationship.getRelationshipData() + if(rt.equals("service-instance") ){ + for (RelationshipData rl_data : rl_datas) { + String eKey = rl_data.getRelationshipKey() + String eValue = rl_data.getRelationshipValue() + if(eKey.equals("service-instance.service-instance-id") && (!eValue.equals(serviceInstanceId))){ + return eValue + } + } + } + } + } + + logger.trace("Exited fetchParentServiceInstance") + }catch(Exception e){ + logger.debug("Error occured within deleteServiceInstance method: " + e) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Error occured during deleteServiceInstance from aai") + } + return null + } + /** * Pre Process the BPMN Flow Request * Includes: @@ -135,6 +200,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor { String sdnc_service_id = execution.getVariable(Prefix + "sdncServiceId") String resourceInput = execution.getVariable(Prefix + "resourceInput") logger.info("The resourceInput is: " + resourceInput) + String allotedParentServiceInstanceId = execution.getVariable("allotedParentServiceInstanceId") ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class) String serviceType = resourceInputObj.getServiceType() String serviceModelInvariantUuid = resourceInputObj.getServiceModelInfo().getModelInvariantUuid() @@ -285,7 +351,61 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor { """.trim() break - // for SDWANConnectivity and SOTNConnectivity: + // sdwanvpnattachment or sotnvpnattachment + case "ALLOTTED_RESOURCE" : + sdncTopologyDeleteRequest = """ + + ${msoUtils.xmlEscape(hdrRequestId)} + ${msoUtils.xmlEscape(serviceInstanceId)} + ${msoUtils.xmlEscape(sdnc_svcAction)} + connection-attachment-topology-operation + sdncCallback + generic-resource + + + + ${msoUtils.xmlEscape(hdrRequestId)} + ${msoUtils.xmlEscape(sdnc_requestAction)} + ${msoUtils.xmlEscape(source)} + + + + + + ${msoUtils.xmlEscape(serviceInstanceId)} + ${msoUtils.xmlEscape(serviceType)} + + ${msoUtils.xmlEscape(serviceModelInvariantUuid)} + ${msoUtils.xmlEscape(serviceModelUuid)} + ${msoUtils.xmlEscape(serviceModelVersion)} + ${msoUtils.xmlEscape(serviceModelName)} + + ${msoUtils.xmlEscape(serviceInstanceId)} + ${msoUtils.xmlEscape(globalCustomerId)} + + + + $resourceInstnaceId + + $allotedParentServiceInstanceId + + ${msoUtils.xmlEscape(modelInvariantUuid)} + ${msoUtils.xmlEscape(modelCustomizationUuid)} + ${msoUtils.xmlEscape(modelUuid)} + ${msoUtils.xmlEscape(modelVersion)} + ${msoUtils.xmlEscape(modelName)} + + + + + + """.trim() + + break + + // for SDWANConnectivity and SOTNConnectivity: default: sdncTopologyDeleteRequest = """ result = aaiResult.asMap() + List resources = + (List) result.getOrDefault("result-data", Collections.emptyList()); + if(resources.size()>0) { + String relationshipUrl = ((Map) resources.get(0)).get("resource-link") + + final Relationship body = new Relationship(); + body.setRelatedLink(relationshipUrl) + + createRelationShipInAAI(execution, body) + } else { + logger.warn("No resource-link found for the given sotnVpnName:"+vpnName) + } + + } else { + logger.error("VPNName not found in request input") + } + + + + } catch (BpmnError e) { + throw e; + } catch (Exception ex) { + + msg = "Exception in DoCreateE2EServiceInstance.createCustomRelationship. " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + logger.trace("Exit createCustomRelationship ") + } + + private void createRelationShipInAAI(DelegateExecution execution, final Relationship relationship){ + logger.trace("createRelationShipInAAI ") + String msg = "" + try { + String serviceInstanceId = execution.getVariable("serviceInstanceId") + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, execution.getVariable("globalSubscriberId"), execution.getVariable("serviceType"), serviceInstanceId).relationshipAPI() + client.create(uri, relationship) + + } catch (BpmnError e) { + throw e; + } catch (Exception ex) { + + msg = "Exception in DoCreateE2EServiceInstance.createRelationShipInAAI. " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + logger.trace("Exit createRelationShipInAAI ") + + } + + private String isNeedProcessCustomRelationship(String uuiRequest) { + String requestInput = jsonUtil.getJsonValue(uuiRequest, "service.parameters.requestInputs") + Map requestInputObject = getJsonObject(requestInput, Map.class); + if (requestInputObject == null) { + return null; + } + + Optional firstKey = + requestInputObject.entrySet() + .stream() + .filter({entry -> entry.getKey().toString().contains("_sotnVpnName")}) + .findFirst() + if (firstKey.isPresent()) { + return firstKey.get().getValue() + } + + return null + } + + private static T getJsonObject(String jsonstr, Class type) { + ObjectMapper mapper = new ObjectMapper(); + mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true); + try { + return mapper.readValue(jsonstr, type); + } catch (IOException e) { + logger.error("{} {} fail to unMarshal json", MessageEnum.RA_NS_EXC.toString(), + ErrorCode.BusinessProcesssError.getValue(), e); + } + return null; + } + + /** * Gets the service instance and its relationships from aai */ diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy index 587337b647..b1356b9fb6 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy @@ -28,7 +28,6 @@ import com.google.gson.Gson import org.apache.http.util.EntityUtils import org.onap.so.bpmn.common.resource.InstanceResourceList import org.onap.so.bpmn.common.scripts.CatalogDbUtilsFactory -import org.onap.so.bpmn.core.domain.GroupResource import org.onap.so.bpmn.core.domain.ModelInfo import org.onap.so.bpmn.core.domain.ResourceType import org.onap.so.bpmn.infrastructure.properties.BPMNProperties @@ -96,16 +95,6 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{ logger.trace("Exit preProcessRequest ") } - // this method will convert resource list to instance_resource_list - public void prepareInstanceResourceList(DelegateExecution execution) { - - String uuiRequest = execution.getVariable("uuiRequest") - List sequencedResourceList = execution.getVariable("sequencedResourceList") - List instanceResourceList = InstanceResourceList.getInstanceResourceList(sequencedResourceList, uuiRequest) - - execution.setVariable("instanceResourceList", instanceResourceList) - } - public void sequenceResoure(DelegateExecution execution) { logger.trace("Start sequenceResoure Process ") @@ -134,23 +123,20 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{ for (resourceType in resourceSequence) { for (resource in addResourceList) { if (StringUtils.containsIgnoreCase(resource.getModelInfo().getModelName(), resourceType)) { - sequencedResourceList.add(resource) + // if resource type is vnfResource then check for groups also // Did not use continue because if same model type is used twice // then we would like to add it twice for processing - // e.g. S{ V1{G1, G2, G1}} --> S{ V1{G1, G1, G2}} - if (resource instanceof VnfResource) { - if (resource.getGroupOrder() != null && !StringUtils.isEmpty(resource.getGroupOrder())) { - String[] grpSequence = resource.getGroupOrder().split(",") - for (String grpType in grpSequence) { - for (GroupResource gResource in resource.getGroups()) { - if (StringUtils.containsIgnoreCase(gResource.getModelInfo().getModelName(), grpType)) { - sequencedResourceList.add(gResource) - } - } - } - } + // ex-1. S{ V1{G1, G2}} --> S{ V1{G1, G1, G2}} + // ex-2. S{ V1{G1, G2}} --> S{ V1{G1, G2, G2, G2} V1 {G1, G1, G2}} + if ((resource.getResourceType() == ResourceType.VNF) && (resource instanceof VnfResource)) { + + // check the size of VNF/Group list from UUI + List sequencedInstanceResourceList = InstanceResourceList.getInstanceResourceList((VnfResource) resource, incomingRequest) + sequencedResourceList.addAll(sequencedInstanceResourceList) + } else { + sequencedResourceList.add(resource) } if (resource instanceof NetworkResource) { networkResourceList.add(resource) @@ -167,7 +153,9 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{ for (Resource rc : addResourceList){ if (rc instanceof VnfResource) { - vnfResourceList.add(rc) + // check the size of VNF/Group list from UUI + List sequencedGroupResourceList = InstanceResourceList.getInstanceResourceList((VnfResource) rc, incomingRequest) + vnfResourceList.addAll(sequencedGroupResourceList) } else if (rc instanceof NetworkResource) { networkResourceList.add(rc) } else if (rc instanceof AllottedResource) { @@ -216,8 +204,8 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{ public void getCurrentResoure(DelegateExecution execution){ logger.trace("Start getCurrentResoure Process ") def currentIndex = execution.getVariable("currentResourceIndex") - List instanceResourceList = execution.getVariable("instanceResourceList") - Resource currentResource = instanceResourceList.get(currentIndex) + List sequencedResourceList = execution.getVariable("sequencedResourceList") + Resource currentResource = sequencedResourceList.get(currentIndex) execution.setVariable("resourceType", currentResource.getModelInfo().getModelName()) logger.info("Now we deal with resource:" + currentResource.getModelInfo().getModelName()) logger.trace("COMPLETED getCurrentResource Process ") @@ -228,8 +216,8 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{ def currentIndex = execution.getVariable("currentResourceIndex") def nextIndex = currentIndex + 1 execution.setVariable("currentResourceIndex", nextIndex) - List instanceResourceList = execution.getVariable("instanceResourceList") - if(nextIndex >= instanceResourceList.size()){ + List sequencedResourceList = execution.getVariable("sequencedResourceList") + if(nextIndex >= sequencedResourceList.size()){ execution.setVariable("allResourceFinished", "true") }else{ execution.setVariable("allResourceFinished", "false") @@ -256,7 +244,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{ resourceInput.setOperationId(operationId) resourceInput.setOperationType(operationType); def currentIndex = execution.getVariable("currentResourceIndex") - List sequencedResourceList = execution.getVariable("instanceResourceList") + List sequencedResourceList = execution.getVariable("sequencedResourceList") Resource currentResource = sequencedResourceList.get(currentIndex) resourceInput.setResourceModelInfo(currentResource.getModelInfo()) resourceInput.getResourceModelInfo().setModelType(currentResource.getResourceType().toString()) @@ -320,8 +308,8 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{ HttpResponse resp = bpmnRestClient.post(recipeURL, requestId, recipeTimeOut, requestAction, serviceInstanceId, serviceType, resourceInput, recipeParamXsd) def currentIndex = execution.getVariable("currentResourceIndex") - List instanceResourceList = execution.getVariable("instanceResourceList") as List - Resource currentResource = instanceResourceList.get(currentIndex) + List sequencedResourceList = execution.getVariable("sequencedResourceList") as List + Resource currentResource = sequencedResourceList.get(currentIndex) if(ResourceType.VNF == currentResource.getResourceType()) { if (resp.getStatusLine().getStatusCode() > 199 && resp.getStatusLine().getStatusCode() < 300) { String responseString = EntityUtils.toString(resp.getEntity(), "UTF-8") diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy index e24597aab3..481a79a7ef 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy @@ -58,9 +58,9 @@ import org.onap.so.utils.TargetEntity import org.springframework.web.util.UriUtils import javax.ws.rs.NotFoundException +import javax.ws.rs.core.MediaType import javax.ws.rs.core.Response - import static org.apache.commons.lang3.StringUtils.isBlank /** @@ -237,6 +237,9 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { )) { jObj.put("resourceInstanceId", eValue) } + else if (rt.equals("allotted-resource") && eKey.equals("allotted-resource.id")){ + jObj.put("resourceInstanceId", eValue) + } // for sp-partner and others else if (eKey.endsWith("-id")) { jObj.put("resourceInstanceId", eValue) @@ -386,7 +389,10 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { URL url = new URL(serviceAaiPath) HttpClient client = new HttpClientFactory().newXmlClient(url, TargetEntity.AAI) - + client.addBasicAuthHeader(UrnPropertiesReader.getVariable("aai.auth", execution), UrnPropertiesReader.getVariable("mso.msoKey", execution)) + client.addAdditionalHeader("X-FromAppId", "MSO") + client.addAdditionalHeader("X-TransactionId", utils.getRequestID()) + client.setAcceptType(MediaType.APPLICATION_XML) Response response = client.get() int responseCode = response.getStatus() @@ -413,12 +419,17 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { if(jObj.has("model-invariant-id")) { modelInvariantId = jObj.get("model-invariant-id") modelUuid = jObj.get("model-version-id") - modelCustomizationId = jObj.get("model-customization-id") + if (jObj.has("model-customization-id")) { + modelCustomizationId = jObj.get("model-customization-id") + } else { + logger.info("resource customization id is not found for :" + url) + } } jObj.put("modelInvariantId", modelInvariantId) jObj.put("modelVersionId", modelUuid) jObj.put("modelCustomizationId", modelCustomizationId) + logger.info("resource detail from AAI:" + jObj) } else { String exceptionMessage = "Get RelatedResource Received a Bad Response Code. Response Code is: " + responseCode @@ -505,11 +516,12 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { String modelName = resource.getModelInfo().getModelName() String modelCustomizationUuid = resource.getModelInfo().getModelCustomizationUuid() + String modelUuid = resource.getModelInfo().getModelUuid() if (StringUtils.containsIgnoreCase(obj.get("resourceType"), modelName)) { resource.setResourceId(obj.get("resourceInstanceId")) //deleteRealResourceList.add(resource) matches = true; - } else if (modelCustomizationUuid.equals(obj.get("modelCustomizationId"))) { + } else if (modelCustomizationUuid.equals(obj.get("modelCustomizationId")) || modelUuid.equals(obj.get("model-version-id")) ) { resource.setResourceId(obj.get("resourceInstanceId")) resource.setResourceInstanceName(obj.get("resourceType")) //deleteRealResourceList.add(resource) @@ -624,4 +636,26 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { //to do } + /** + * Deletes the service instance in aai + */ + public void deleteServiceInstance(DelegateExecution execution) { + logger.trace("Entered deleteServiceInstance") + try { + String globalCustId = execution.getVariable("globalSubscriberId") + String serviceType = execution.getVariable("serviceType") + String serviceInstanceId = execution.getVariable("serviceInstanceId") + + AAIResourcesClient resourceClient = new AAIResourcesClient(); + AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustId, serviceType, serviceInstanceId) + resourceClient.delete(serviceInstanceUri) + + logger.trace("Exited deleteServiceInstance") + }catch(Exception e){ + logger.debug("Error occured within deleteServiceInstance method: " + e) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Error occured during deleteServiceInstance from aai") + } + } + + } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy index 2dcfcaa4f4..53c1e311e2 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy @@ -271,6 +271,7 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor { execution.setVariable("sequencedResourceList", sequencedResourceList) execution.setVariable("parentVNF", parentVNF) logger.debug("resourceSequence: " + resourceSequence) + logger.debug("delete resource sequence list : " + sequencedResourceList) logger.debug(" ======== END sequenceResource Process ======== ") } diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteSDNCNetworkResource.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteSDNCNetworkResource.bpmn index c2d4de3973..4cd4ab527f 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteSDNCNetworkResource.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteSDNCNetworkResource.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_1qo2pln_delete @@ -123,6 +123,7 @@ csi.sendSyncResponse(execution) + SequenceFlow_0h3klf0_delete SequenceFlow_00vqgvt_delete @@ -154,145 +155,145 @@ dcsi.prepareUpdateAfterDeleteSDNCResource(execution) - + - + - - + + - - + + - + - + - + - - + + - + - - + + - - + + - + - + - - + + - - - - - + + + + + - + - + - + - + - - + + - - + + - + - + - - + + - + - - - + + + - + - - + + - + - + - - + + - + - - + + diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn index 76dd6facd6..125f08c49e 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_1qiiycn @@ -9,8 +9,7 @@ SequenceFlow_0w9t6tc import org.onap.so.bpmn.infrastructure.scripts.* def dcsi = new DoCreateE2EServiceInstance() -dcsi.preProcessRequest(execution) - +dcsi.preProcessRequest(execution) @@ -38,8 +37,7 @@ dcsi.preProcessRequest(execution) SequenceFlow_1lqktwf import org.onap.so.bpmn.infrastructure.scripts.* def dcsi = new DoCreateE2EServiceInstance() -dcsi.preProcessRollback(execution) - +dcsi.preProcessRollback(execution) @@ -47,8 +45,7 @@ dcsi.preProcessRollback(execution) SequenceFlow_1xzgv5k import org.onap.so.bpmn.infrastructure.scripts.* def dcsi = new DoCreateE2EServiceInstance() -dcsi.postProcessRollback(execution) - +dcsi.postProcessRollback(execution) @@ -98,10 +95,10 @@ dcsi.prepareDecomposeService(execution) - SequenceFlow_1tkgqu3 + SequenceFlow_19zefa9 - + SequenceFlow_0yuzaen @@ -156,7 +153,7 @@ ddsi.preInitResourcesOperStatus(execution) - SequenceFlow_0b1dsaj + SequenceFlow_11zobkq SequenceFlow_0sphcy5 @@ -168,6 +165,7 @@ csi.preProcessForAddResource(execution) SequenceFlow_0sphcy5 + SequenceFlow_1mvvc6c SequenceFlow_18gnns6 import org.onap.so.bpmn.infrastructure.scripts.* def csi = new DoCreateE2EServiceInstance() @@ -193,253 +191,289 @@ dcsi.doTPResourcesAllocation(execution) - + + + + SequenceFlow_1tkgqu3 + SequenceFlow_19zefa9 + import org.onap.so.bpmn.infrastructure.scripts.* +def ddsi = new DoCreateE2EServiceInstance() +ddsi.createCustomRelationship(execution) + + + SequenceFlow_0b1dsaj + SequenceFlow_11zobkq + SequenceFlow_1mvvc6c + + + #{(execution.getVariable("isCreateResourceListValid" ) == true)} + + - + - + - + - + - + - + - + - - + + - - + + - + - + - - + + - + - - - - + + + + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - + - + - - - - + + - - - - + + + + - + - + - - - - + + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateResources.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateResources.bpmn index 75767929aa..2a2093522f 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateResources.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateResources.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_1qiiycn @@ -9,8 +9,7 @@ SequenceFlow_0w9t6tc import org.onap.so.bpmn.infrastructure.scripts.* def dcsi = new DoCreateResources() -dcsi.preProcessRequest(execution) - +dcsi.preProcessRequest(execution) SequenceFlow_16nxl6h @@ -48,7 +47,7 @@ ddsi.parseNextResource(execution) SequenceFlow_0q6uy30 - SequenceFlow_1obf0cq + SequenceFlow_1qozd66 SequenceFlow_0uiygod import org.onap.so.bpmn.infrastructure.scripts.* def ddsi = new DoCreateResources() @@ -103,7 +102,7 @@ ddsi.executeResourceRecipe(execution) - + SequenceFlow_0epxs3b @@ -134,252 +133,237 @@ def ddsi = new DoCreateResources() ddsi.prepareServiceTopologyRequest(execution) - - - SequenceFlow_1qozd66 - SequenceFlow_1obf0cq - import org.onap.so.bpmn.infrastructure.scripts.* -def ddsi = new DoCreateResources() -ddsi.prepareInstanceResourceList(execution) - - + - + - + - + - + - - - - + + + + - + - - + + - + - + - - - - + + + + - + - + - - + + - + - + - + - - + + - + - + - + - + - + - - + + - - - - + + + + - + - + - - - + + + - + - + - + - - + + - + - + - - + + - + - - + + - - + + - - + + - - + + - + - - + + - + - + - + - + - - + + - - + + - + - - + + - - - - - - - diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn index 4d0324e478..1149cc9ea9 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn @@ -9,8 +9,7 @@ SequenceFlow_11e6bfy import org.onap.so.bpmn.infrastructure.scripts.* def ddsi = new DoDeleteE2EServiceInstance() -ddsi.preProcessRequest(execution) - +ddsi.preProcessRequest(execution) SequenceFlow_0e7inkl @@ -27,7 +26,7 @@ ddsi.postProcessAAIGET(execution) SequenceFlow_12rr1yy SequenceFlow_0e7inkl import org.onap.so.bpmn.infrastructure.scripts.* -def ddsi = new DoCustomDeleteE2EServiceInstance() +def ddsi = new DoDeleteE2EServiceInstance() ddsi.deleteServiceInstance(execution) -- cgit 1.2.3-korg