aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src
diff options
context:
space:
mode:
authormaopeng zhang <zhang.maopeng1@zte.com.cn>2018-04-23 09:12:38 +0000
committerGerrit Code Review <gerrit@onap.org>2018-04-23 09:12:38 +0000
commit2b544715bd299ec1d45ca55f79f0e88646f8f600 (patch)
treed52e6159105e609c3e933fbb964114a919e5ffba /bpmn/MSOInfrastructureBPMN/src
parent58dd35b739d5a141467866580b95e30aff03b4f2 (diff)
parent3872932ec4eecff0aee99fef242c3b7133da63de (diff)
Merge "Update resource UUids for resource status"
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy43
1 files changed, 16 insertions, 27 deletions
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 d44de7c27d..71aea024bf 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
@@ -209,7 +209,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
if (utils.nodeExists(siData, "relationship-list")) {
utils.log("INFO", "SI Data relationship-list exists:", isDebugEnabled)
//test(siData)
- NodeList nodeList = serviceXml.getElementsByTagName("relationship").item(0).getChildNodes()
+ NodeList nodeList = serviceXml.getElementsByTagName("relationship")
JSONArray jArray = new JSONArray()
for (int x = 0; x < nodeList.getLength(); x++) {
Node node = nodeList.item(x)
@@ -225,18 +225,11 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
for (int i = 0; i < dataList.getLength(); i++) {
Node dNode = dataList.item(i)
if(dNode.getNodeName() == "relationship-data") {
-
- NodeList rdNodes = dNode.getChildNodes()
- for(int j = 0; j < rdNodes.getLength(); j++) {
- Node rdNode = rdNodes.item(j);
- if (rdNode instanceof Element) {
- Element rDataEle = (Element) rdNode
- def eKey = rDataEle.getElementsByTagName("relationship-key").item(0).getTextContent()
- def eValue = rDataEle.getElementsByTagName("relationship-value").item(0).getTextContent()
- if (eKey.equals("service-instance.service-instance-id")) {
- jObj.put("resourceInstanceId", eValue)
- }
- }
+ Element rDataEle = (Element)dNode
+ def eKey = rDataEle.getElementsByTagName("relationship-key").item(0).getTextContent()
+ def eValue = rDataEle.getElementsByTagName("relationship-value").item(0).getTextContent()
+ if(eKey.equals("service-instance.service-instance-id")){
+ jObj.put("resourceInstanceId", eValue)
}
}
@@ -342,8 +335,8 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
//here modelVersion is not set, we use modelUuid to decompose the service.
String serviceModelInfo = """{
"modelInvariantUuid":"${modelInvariantUuid}",
- "modelUuid":"",
- "modelVersion":"${modelVersionId}"
+ "modelUuid":"${modelVersionId}",
+ "modelVersion":""
}"""
execution.setVariable("serviceModelInfo", serviceModelInfo)
@@ -390,18 +383,14 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("serviceInstanceId", serviceId)
execution.setVariable("operationId", operationId)
execution.setVariable("operationType", operationType)
-
- String serviceRelationShip = execution.getVariable("serviceRelationShip")
-
- def jsonSlurper = new JsonSlurper()
- def jsonOutput = new JsonOutput()
- List relationShipList = jsonSlurper.parseText(serviceRelationShip)
-
- if (relationShipList != null) {
- relationShipList.each {
- resourceTemplateUUIDs = resourceTemplateUUIDs + it.resourceInstanceId + ":"
- }
- }
+ List<Resource> deleteResourceList = execution.getVariable("deleteResourceList")
+
+ String serviceRelationShip = execution.getVariable("serviceRelationShip")
+ for(Resource resource : deleteResourceList){
+ resourceTemplateUUIDs = resourceTemplateUUIDs + resource.getModelInfo().getModelCustomizationUuid() + ":"
+ }
+
+
execution.setVariable("URN_mso_adapters_openecomp_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
String payload =