diff options
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common')
3 files changed, 49 insertions, 6 deletions
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 8b9726c2b7..7d1bc4c779 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 @@ -127,11 +127,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { String key = iterator.next() HashMap<String, String> hashMap = new HashMap() hashMap.put("name", key) - if(jsonObject.get(key)==null){ - hashMap.put("value", "") - }else{ - hashMap.put("value", jsonObject.get(key)) - } + hashMap.put("value", jsonObject.get(key)) paramList.add(hashMap) } Map<String, List<Map<String, Object>>> paramMap = new HashMap() @@ -260,6 +256,17 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { break + case ~/[\w\s\W]*UNI[\w\s\W]*/ : + def resourceInput = resourceInputObj.getResourceParameters() + String incomingRequest = resourceInputObj.getRequestsInputs() + String serviceParameters = JsonUtils.getJsonValue(incomingRequest, "service.parameters") + String requestInputs = JsonUtils.getJsonValue(serviceParameters, "requestInputs") + JSONObject inputParameters = new JSONObject(requestInputs) + String uResourceInput = jsonUtil.addJsonValue(resourceInput, "requestInputs.service-name", inputParameters.get("name")) + resourceInputObj.setResourceParameters(uResourceInput) + execution.setVariable(Prefix + "resourceInput", resourceInputObj.toString()) + break + case ~/[\w\s\W]*sdwanvpnattachment[\w\s\W]*/ : case ~/[\w\s\W]*sotnvpnattachment[\w\s\W]*/ : case ~/[\w\s\W]*SOTN-Attachment[\w\s\W]*/ : @@ -363,7 +370,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { <sdncadapter:MsoAction>opticalservice</sdncadapter:MsoAction> </sdncadapter:RequestHeader> <sdncadapterworkflow:SDNCRequestData> - <request-id>${msoUtils.xmlEscape(hdrRequestId)}</request-id> + <request-id>${msoUtils.xmlEscape(serviceInstanceId)}</request-id> <global-customer-id>${msoUtils.xmlEscape(globalCustomerId)}</global-customer-id> <service-type>${msoUtils.xmlEscape(serviceType)}</service-type> <notification-url>sdncCallback</notification-url> diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy index 61b1250522..cdc242dbd8 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy @@ -221,6 +221,30 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor { switch (modelType) { case "VNF": + if(modelName.contains("UNI") && "MDONS_OTN".equals(serviceType)){ + String serviceInstanceName = resourceInputObj.getResourceInstanceName() + sdncTopologyDeleteRequest = """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1" + xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1" + xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1"> + <sdncadapter:RequestHeader> + <sdncadapter:RequestId>${MsoUtils.xmlEscape(hdrRequestId)}</sdncadapter:RequestId> + <sdncadapter:SvcInstanceId>${MsoUtils.xmlEscape(serviceInstanceId)}</sdncadapter:SvcInstanceId> + <sdncadapter:SvcAction>${MsoUtils.xmlEscape(sdnc_svcAction)}</sdncadapter:SvcAction> + <sdncadapter:SvcOperation>optical-service-delete</sdncadapter:SvcOperation> + <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl> + <sdncadapter:MsoAction>opticalservice</sdncadapter:MsoAction> + </sdncadapter:RequestHeader> + <sdncadapterworkflow:SDNCRequestData> + <request-id>${msoUtils.xmlEscape(serviceInstanceId)}</request-id> + <payload> + <param> + <name>service-name</name> + <value>${msoUtils.xmlEscape(serviceInstanceName)}</value> + </param> + </payload> + </sdncadapterworkflow:SDNCRequestData> + </aetgt:SDNCAdapterWorkflowRequest>""".trim() + } else{ sdncTopologyDeleteRequest = """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1" xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1" xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1"> @@ -275,6 +299,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor { </vnf-request-input> </sdncadapterworkflow:SDNCRequestData> </aetgt:SDNCAdapterWorkflowRequest>""".trim() + } break case "GROUP" : //When a new resource creation request reaches SO, the parent resources information needs to be provided 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 a24bc4411e..35af3d34d6 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 @@ -450,6 +450,16 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { execution.setVariable("serviceModelInfo", serviceDecomposition.getModelInfo()) List<Resource> deleteResourceList = serviceDecomposition.getServiceResources() + if (serviceDecomposition.getServiceType().equals("MDONS_OTN")){ + for (Resource resource : deleteResourceList) { + String serviceName = execution.getVariable("serviceInstanceName") + String serviceInstanceId = execution.getVariable("serviceInstanceId") + resource.setResourceId(serviceInstanceId) + resource.setResourceInstanceName(serviceName) + def delMap = new ImmutablePair(resource, null) + deleteRealResourceList.add(delMap) + } + } else{ String serviceRelationShip = execution.getVariable("serviceRelationShip") def jsonSlurper = new JsonSlurper() def jsonOutput = new JsonOutput() @@ -492,6 +502,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { } } } + } // only delete real existing resources execution.setVariable("deleteResourceList", deleteRealResourceList) |