Update response for delete e2e service 81/44081/1
authorc00149107 <chenchuanyu@huawei.com>
Mon, 23 Apr 2018 03:37:23 +0000 (11:37 +0800)
committerc00149107 <chenchuanyu@huawei.com>
Mon, 23 Apr 2018 03:37:23 +0000 (11:37 +0800)
Update response for delete e2e service

Change-Id: I8cd96981e085111e55211e8a24cb3b2cebe7ef9a
Issue-ID: SO-587
Signed-off-by: c00149107 <chenchuanyu@huawei.com>
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn

index d218adc..ebf9ae7 100644 (file)
@@ -73,9 +73,9 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
                        \r
 \r
                        String requestId = execution.getVariable("mso-request-id")\r
-                       execution.setVariable("msoRequestId", requestId)\r
+                       execution.setVariable("msoRequestId", requestId)                        \r
                        utils.log("INFO", "Input Request:" + siRequest + " reqId:" + requestId, isDebugEnabled)\r
-                       \r
+               \r
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")\r
                        if (isBlank(serviceInstanceId)) {\r
                                msg = "Input serviceInstanceId' is null"\r
@@ -114,7 +114,9 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
                        } else {\r
                                execution.setVariable("subscriptionServiceType", subscriptionServiceType)\r
                        }\r
-\r
+                       String operationId = jsonUtil.getJsonValue(siRequest, "operationId")\r
+                       execution.setVariable("operationId", operationId)\r
+                                       \r
                        execution.setVariable("operationType", "DELETE")\r
                } catch (BpmnError e) {\r
                        throw e;\r
@@ -129,13 +131,9 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
        public void sendSyncResponse (DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                utils.log("INFO", " *** sendSyncResponse  *** ", isDebugEnabled)\r
-\r
                try {\r
-                       String requestId = execution.getVariable("msoRequestId")\r
-                       String serviceInstanceId = execution.getVariable("serviceInstanceId")\r
-\r
-                       // RESTResponse (for API Handler (APIH) Reply Task)\r
-                       String syncResponse = """{"requestReferences":{"instanceId":"${serviceInstanceId}","requestId":"${requestId}"}}""".trim()\r
+                       String operationId = execution.getVariable("operationId")\r
+                       String syncResponse = """{"operationId":"${operationId}"}""".trim()\r
                        utils.log("INFO", " sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse, isDebugEnabled)\r
                        sendWorkflowResponse(execution, 202, syncResponse)\r
 \r
index 2068625..8a3d441 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.11.3">
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0">
   <bpmn:process id="DoDeleteE2EServiceInstance" name="All Resources Deleted" isExecutable="true">
     <bpmn:startEvent id="StartEvent_0212h2r" name="Start Flow">
       <bpmn:outgoing>SequenceFlow_0vz7cd9</bpmn:outgoing>
@@ -165,6 +165,7 @@ dcsi.postDecomposeService(execution)]]></bpmn:script>
         <camunda:in source="deleteResourceList" target="deleteResourceList" />
         <camunda:in source="resourceInstanceIDs" target="resourceInstanceIDs" />
         <camunda:in source="operationType" target="operationType" />
+        <camunda:in source="operationId" target="operationId" />
       </bpmn:extensionElements>
       <bpmn:incoming>SequenceFlow_1j08ko3</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1cevtpy</bpmn:outgoing>
@@ -180,6 +181,10 @@ dcsi.postDecomposeService(execution)]]></bpmn:script>
       <bpmn:linkEventDefinition name="DecomposeService" />
     </bpmn:intermediateThrowEvent>
     <bpmn:sequenceFlow id="SequenceFlow_0vi0sv6" sourceRef="ScriptTask_1rtnsh8" targetRef="StartEvent_1qh5a34" />
+    <bpmn:scriptTask id="ScriptTask_08a4vhm" name="Send Sync Ack Response" scriptFormat="groovy">    <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def csi = new  CompareModelofE2EServiceInstance()
+csi.sendSyncResponse(execution)]]></bpmn:script>
+</bpmn:scriptTask>
   </bpmn:process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
     <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoDeleteE2EServiceInstance">
@@ -398,6 +403,9 @@ dcsi.postDecomposeService(execution)]]></bpmn:script>
           <dc:Bounds x="-16" y="-39" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ScriptTask_08a4vhm_di" bpmnElement="ScriptTask_08a4vhm">
+        <dc:Bounds x="494" y="260" width="100" height="80" />
+      </bpmndi:BPMNShape>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn:definitions>