aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/main/groovy/org
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-05-22 12:44:45 +0000
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2018-05-22 12:44:45 +0000
commit21bdd6099cfdebad231dc5d4374fc2d9af7bd1d7 (patch)
tree973e0c1ed6e7dc896042490134177aadcbf3c873 /bpmn/MSOInfrastructureBPMN/src/main/groovy/org
parent730c553397a3ead6e4f14b018bf898c9858be3c1 (diff)
Fix resource looping if AAI response empty
Fix ressource looping if AAI response is empty for resource list. Change-Id: I244d3836beb98ec2689c71df5c61f24f40619d96 Issue-ID: SO-632 Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy/org')
-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)