aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/main/groovy
diff options
context:
space:
mode:
authorChuanyu Chen <chenchuanyu@huawei.com>2018-05-23 01:31:00 +0000
committerGerrit Code Review <gerrit@onap.org>2018-05-23 01:31:00 +0000
commit58b633b666f5608fbd00c75edf0b2e6d5c0d1d16 (patch)
tree41c8c8fd89f966edaa0fc15a54cf1b3e3e10b24f /bpmn/MSOInfrastructureBPMN/src/main/groovy
parent2298ad16d68120854a64e1b81f7c63390496544c (diff)
parent21bdd6099cfdebad231dc5d4374fc2d9af7bd1d7 (diff)
Merge "Fix resource looping if AAI response empty"
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy24
1 files changed, 14 insertions, 10 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 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)