summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/main/groovy/org
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-04-24 04:29:50 +0000
committerGerrit Code Review <gerrit@onap.org>2018-04-24 04:29:50 +0000
commitfa1d708ff89dd3ed4230142997eef1827a9cb949 (patch)
treed37e54d158cf8668ef9efbc858ac38100f7b04be /bpmn/MSOInfrastructureBPMN/src/main/groovy/org
parent8fb59190c471aeaa416a43fc3a24492f12a11f1c (diff)
parent91b1523358123f41c689722eaaf26a33ca47552f (diff)
Merge "Update resource instance id for Decomposed service"
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy/org')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy20
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy4
2 files changed, 21 insertions, 3 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)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy
index 63ecb45e28..a7f461b973 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy
@@ -239,8 +239,8 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
String resourceInstanceId = execution.getVariable("resourceInstanceId")
String resourceUuid = execution.getVariable("resourceUuid")
- String requestAction = execution.getVariable("operationType")
- JSONObject resourceRecipe = cutils.getResourceRecipe(execution, resourceUuid, requestAction)
+ String action = "deleteInstance"
+ JSONObject resourceRecipe = cutils.getResourceRecipe(execution, resourceUuid, action)
String recipeUri = resourceRecipe.getString("orchestrationUri")
int recipeTimeout = resourceRecipe.getInt("recipeTimeout")
String recipeParamXsd = resourceRecipe.get("paramXSD")