diff options
author | 2018-04-23 19:42:22 +0800 | |
---|---|---|
committer | 2018-04-23 20:31:32 +0800 | |
commit | 91b1523358123f41c689722eaaf26a33ca47552f (patch) | |
tree | 4628100c87bcc19a98ff5aeaa8e227804f7839fb /bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy | |
parent | 3872932ec4eecff0aee99fef242c3b7133da63de (diff) |
Update resource instance id for Decomposed service
Update resourceinstanceid for Decomposed service
Change-Id: Iaadd8b6d3fb861058eed56cbf33b3a0dc6a060d0
Issue-ID: SO-587
Signed-off-by: c00149107 <chenchuanyu@huawei.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy')
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy | 20 |
1 files changed, 19 insertions, 1 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 71aea024bf..2efd86eb99 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 @@ -355,8 +355,26 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { try { ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition") List<Resource> deleteResourceList = serviceDecomposition.getServiceResources() + String serviceRelationShip = execution.getVariable("serviceRelationShip") + def jsonSlurper = new JsonSlurper() + def jsonOutput = new JsonOutput() + List 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(""); + //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); + } + } + } + } execution.setVariable("deleteResourceList", deleteResourceList) - execution.setVariable("resourceInstanceIDs", execution.getVariable("serviceRelationShip")) } catch (Exception ex) { String exceptionMessage = "Bpmn error encountered in create generic e2e service flow. processDecomposition() - " + ex.getMessage() utils.log("DEBUG", exceptionMessage, isDebugEnabled) |