summaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
authorc00149107 <chenchuanyu@huawei.com>2018-04-23 16:05:56 +0800
committerc00149107 <chenchuanyu@huawei.com>2018-04-23 16:05:56 +0800
commit3872932ec4eecff0aee99fef242c3b7133da63de (patch)
tree32d673f62071e661c2f6a56008f579d18e3ea902 /bpmn
parent8fa2659ec0f0b94f22f5caa5d7e61048be18068c (diff)
Update resource UUids for resource status
Update resource UUids for resource status Change-Id: I37bd5f9c6a2b30695b39e78dc64ab219831a3828 Issue-ID: SO-587 Signed-off-by: c00149107 <chenchuanyu@huawei.com>
Diffstat (limited to 'bpmn')
-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 =