aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/main/groovy
diff options
context:
space:
mode:
authorYulian Han <elaine.hanyulian@huawei.com>2018-04-25 16:04:19 +0800
committerYulian Han <elaine.hanyulian@huawei.com>2018-04-25 16:04:19 +0800
commitc7c76f0e6d6aacf6f1b1cd07a42360291fde7e85 (patch)
tree3e4af429e475da4ac48a0ea1d42f2e241e6e6dd9 /bpmn/MSOInfrastructureBPMN/src/main/groovy
parent46fb3092fe5bb518f220a6b38650d08cb4fda20d (diff)
add serviceDecomposition input para for deleteE2E
Change-Id: Idaa55084f5ecb0dd3636c232cebc14fa5f064309 Issue-ID: SO-578 Signed-off-by: Yulian Han <elaine.hanyulian@huawei.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy42
1 files changed, 31 insertions, 11 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy
index f29db9252f..dff1ecf68e 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy
@@ -226,23 +226,43 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
utils.log("INFO"," *** Exit postProcessForAddResource *** ", isDebugEnabled)
}
- public void preProcessForDeleteResource(DelegateExecution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ public void preProcessForDeleteResource(DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** preProcessForDeleteResource ***** ", isDebugEnabled)
-
+
execution.setVariable("operationType", "delete")
-
- execution.setVariable("hasResourcetoDelete", false)
+
+ def hasResourcetoDelete = false
List<Resource> delResourceList = execution.getVariable("delResourceList")
if(delResourceList != null && !delResourceList.isEmpty()) {
- execution.setVariable("hasResourcetoDelete", true)
- }
-
- execution.setVariable("resourceInstanceIDs", execution.getVariable("serviceRelationShip"))
+ hasResourcetoDelete = true
+ }
+ execution.setVariable("hasResourcetoDelete", hasResourcetoDelete)
+
+ if(hasResourcetoDelete) {
+ def jsonSlurper = new JsonSlurper()
+ String serviceRelationShip = execution.getVariable("serviceRelationShip")
+ List relationShipList = jsonSlurper.parseText(serviceRelationShip)
+
+ //Set the real resource instance id to the decomosed resource list
+ for(Resource resource: delResourceList){
+ //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);
+ }
+ }
+ }
+ }
+ }
- utils.log("INFO"," *** Exit preProcessForDeleteResource *** ", isDebugEnabled)
+ execution.setVariable("deleteResourceList", delResourceList)
- }
+ utils.log("INFO"," *** Exit preProcessForDeleteResource *** ", isDebugEnabled)
+ }
public void postProcessForDeleteResource(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")