utils.log("INFO"," *** Exit postProcessForAddResource *** ", isDebugEnabled)\r
}\r
\r
- public void preProcessForDeleteResource(DelegateExecution execution) {\r
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
+ public void preProcessForDeleteResource(DelegateExecution execution) {\r
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
utils.log("INFO"," ***** preProcessForDeleteResource ***** ", isDebugEnabled)\r
- \r
+\r
execution.setVariable("operationType", "delete")\r
- \r
- execution.setVariable("hasResourcetoDelete", false)\r
+\r
+ def hasResourcetoDelete = false\r
List<Resource> delResourceList = execution.getVariable("delResourceList")\r
if(delResourceList != null && !delResourceList.isEmpty()) {\r
- execution.setVariable("hasResourcetoDelete", true)\r
- } \r
- \r
- execution.setVariable("resourceInstanceIDs", execution.getVariable("serviceRelationShip"))\r
+ hasResourcetoDelete = true\r
+ }\r
+ execution.setVariable("hasResourcetoDelete", hasResourcetoDelete)\r
+\r
+ if(hasResourcetoDelete) {\r
+ def jsonSlurper = new JsonSlurper()\r
+ String serviceRelationShip = execution.getVariable("serviceRelationShip") \r
+ List relationShipList = jsonSlurper.parseText(serviceRelationShip)\r
+\r
+ //Set the real resource instance id to the decomosed resource list\r
+ for(Resource resource: delResourceList){\r
+ //reset the resource instance id , because in the decompose flow ,its a random one.\r
+ resource.setResourceId("");\r
+ //match the resource-instance-name and the model name\r
+ if (relationShipList != null) {\r
+ relationShipList.each {\r
+ if(StringUtils.containsIgnoreCase(it.resourceType, resource.getModelInfo().getModelName())){\r
+ resource.setResourceId(it.resourceInstanceId);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
\r
- utils.log("INFO"," *** Exit preProcessForDeleteResource *** ", isDebugEnabled)\r
+ execution.setVariable("deleteResourceList", delResourceList)\r
\r
- }\r
+ utils.log("INFO"," *** Exit preProcessForDeleteResource *** ", isDebugEnabled)\r
+ }\r
\r
public void postProcessForDeleteResource(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
<camunda:in source="serviceType" target="serviceType" />
<camunda:in source="serviceInstanceId" target="serviceInstanceId" />
<camunda:in source="URN_mso_workflow_sdncadapter_callback" target="URN_mso_workflow_sdncadapter_callback" />
- <camunda:in source="serviceInputParams" target="serviceInputParams" />
- <camunda:in source="delResourceList" target="deleteResourceList" />
- <camunda:in source="resourceInstanceIDs" target="resourceInstanceIDs" />
+ <camunda:in source="deleteResourceList" target="deleteResourceList" />
<camunda:in source="operationType" target="operationType" />
<camunda:in source="operationId" target="operationId" />
+ <camunda:in source="serviceDecomposition_Original" target="serviceDecomposition" />
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_0ur34hv</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0w4t4ao</bpmn2:outgoing>
<bpmn2:sequenceFlow id="SequenceFlow_0w4t4ao" sourceRef="CallActivity_11obqi0" targetRef="ScriptTask_00wgfrc" />
<bpmn2:callActivity id="CallActivity_07pl1uw" name="Call DoCreateResources" calledElement="DoCreateResourcesV3">
<bpmn2:extensionElements>
- <camunda:in source="nsServiceName" target="nsServiceName" />
<camunda:in source="serviceDescription" target="nsServiceDescription" />
<camunda:in source="globalSubscriberId" target="globalSubscriberId" />
<camunda:in source="serviceType" target="serviceType" />
<camunda:in source="serviceInstanceId" target="serviceInstanceId" />
<camunda:in source="operationId" target="operationId" />
- <camunda:in source="resourceType" target="resourceType" />
- <camunda:in source="resourceUUID" target="resourceUUID" />
- <camunda:in source="resourceParameters" target="resourceParameters" />
<camunda:in source="operationType" target="operationType" />
<camunda:in source="addResourceList" target="addResourceList" />
<camunda:in source="serviceInstanceName" target="serviceInstanceName" />