fix update operation Status

fixing update of operation status for del e2e svc

IssueId: SO-263

Change-Id: I797f36c54d4fd90f697b22d576666197b311713f
Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
index 7ab651c..206e614 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
@@ -81,8 +81,7 @@
 				msg = "Input serviceInstanceId' is null"

 				exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)

 			}

-		

-			 

+						

 			String serviceType = execution.getVariable("serviceType")

 			if (isBlank(serviceType)) {

 				msg = "Input serviceType' is null"

@@ -90,6 +89,7 @@
 			} else {

 				execution.setVariable("serviceType", serviceType)

 			}

+			

 			//subscriberInfo

 			String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "globalSubscriberId")

 			if (isBlank(globalSubscriberId)) {

@@ -98,7 +98,16 @@
 			} else {

 				execution.setVariable("globalSubscriberId", globalSubscriberId)

 			}

-	execution.setVariable("URN_mso_adapters_openecomp_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")

+			

+			//operationId

+			String operationId = jsonUtil.getJsonValue(siRequest, "operationId")

+		 	if (isBlank(operationId)) {

+		 		operationId = UUID.randomUUID().toString()

+		 	 }   

+			execution.setVariable("operationId", operationId) 

+			

+			execution.setVariable("URN_mso_adapters_openecomp_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")

+			

 		} catch (BpmnError e) {

 			throw e;

 		} catch (Exception ex){

@@ -116,7 +125,7 @@
 		try {

 			String operationId = execution.getVariable("operationId")

 			

-			// RESTResponse (for API Handler (APIH) Reply Task)

+			// RESTResponse (for API Handler (APIH) Reply Task) :  :  

 			String syncResponse = """{"operationId":"${operationId}"}""".trim()

 			utils.log("DEBUG", " sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse, isDebugEnabled)

 			sendWorkflowResponse(execution, 202, syncResponse)

@@ -156,85 +165,6 @@
 

 	}

 	

-  public void preInitResourcesOperStatus(Execution execution){

-        def isDebugEnabled = execution.getVariable("isDebugLogEnabled")

-

-        utils.log("DEBUG", " ======== STARTED preInitResourcesOperStatus Process ======== ", isDebugEnabled)

-        try{

-            String serviceId = execution.getVariable("serviceInstanceId")

-            String operationId = UUID.randomUUID().toString()

-            String operationType = "DELETE"

-            String resourceTemplateUUIDs = ""

-            String result = "processing"

-            String progress = "0"

-            String reason = ""

-            String operationContent = "Prepare service creation"

-            utils.log("DEBUG", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + oprationType, isDebugEnabled)

-            serviceId = UriUtils.encode(serviceId,"UTF-8")

-            execution.setVariable("serviceInstanceId", serviceId)

-            execution.setVariable("operationId", operationId)

-            execution.setVariable("operationType", operationType)

-            // we use resource instance ids for delete flow as resourceTemplateUUIDs

-            /*[

-             {

-                 "resourceInstanceId":"1111",

-                 "resourceType":"vIMS"

-             },

-             {

-                 "resourceInstanceId":"222",

-                 "resourceType":"vEPC"

-             },

-             {

-                 "resourceInstanceId":"3333",

-                 "resourceType":"overlay"

-             },

-             {

-                 "resourceInstanceId":"4444",

-                 "resourceType":"underlay"

-             }

-         ]*/

-            String serviceRelationShip = execution.getVariable("serviceRelationShip")

-            

-            def jsonSlurper = new JsonSlurper()

-            def jsonOutput = new JsonOutput()         

-            List relationShipList =  jsonSlurper.parseText(serviceRelationShip)

-                    

-            if (relationShipList != null) {

-                relationShipList.each {

-                    resourceTemplateUUIDs  = resourceTemplateUUIDs + it.resourceInstanceId + ":"

-                }

-            }           

-

-            def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")

-            execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)

-            utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)

-

-            String payload =

-                """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

-                        xmlns:ns="http://org.openecomp.mso/requestsdb">

-                        <soapenv:Header/>

-                        <soapenv:Body>

-                            <ns:initResourceOperationStatus xmlns:ns="http://org.openecomp.mso/requestsdb">

-                            <serviceId>${serviceId}</serviceId>

-                            <operationId>${operationId}</operationId>

-                            <operationType>${operationType}</operationType>

-                            <resourceTemplateUUIDs>${resourceTemplateUUIDs}</resourceTemplateUUIDs>

-                        </ns:initResourceOperationStatus>

-                    </soapenv:Body>

-                </soapenv:Envelope>"""

-

-            payload = utils.formatXml(payload)

-            execution.setVariable("CVFMI_initResOperStatusRequest", payload)

-            utils.log("DEBUG", "Outgoing initResourceOperationStatus: \n" + payload, isDebugEnabled)

-            utils.logAudit("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)

-

-        }catch(Exception e){

-            utils.log("ERROR", "Exception Occured Processing preInitResourcesOperStatus. Exception is:\n" + e, isDebugEnabled)

-            execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())

-        }

-        utils.log("DEBUG", "======== COMPLETED preInitResourcesOperStatus Process ======== ", isDebugEnabled)  

-    }

-

 	public void prepareCompletionRequest (Execution execution) {

 		def isDebugEnabled=execution.getVariable("isDebugLogEnabled")

 		utils.log("DEBUG", " *** prepareCompletion *** ", isDebugEnabled)

diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
index f141bbd..cd0fe81 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
@@ -472,6 +472,85 @@
 		utils.log("DEBUG"," *** Exit postProcessAAIDEL *** ", isDebugEnabled)
 	}
 	
+	public void preInitResourcesOperStatus(Execution execution){
+        def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+
+        utils.log("DEBUG", " ======== STARTED preInitResourcesOperStatus Process ======== ", isDebugEnabled)
+        try{
+            String serviceId = execution.getVariable("serviceInstanceId")
+            String operationId = execution.getVariable("operationId")
+            String operationType = execution.getVariable("operationType")
+            String resourceTemplateUUIDs = ""
+            String result = "processing"
+            String progress = "0"
+            String reason = ""
+            String operationContent = "Prepare service creation"
+            utils.log("DEBUG", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + oprationType, isDebugEnabled)
+            serviceId = UriUtils.encode(serviceId,"UTF-8")
+            execution.setVariable("serviceInstanceId", serviceId)
+            execution.setVariable("operationId", operationId)
+            execution.setVariable("operationType", operationType)
+            // we use resource instance ids for delete flow as resourceTemplateUUIDs
+            /*[
+             {
+                 "resourceInstanceId":"1111",
+                 "resourceType":"vIMS"
+             },
+             {
+                 "resourceInstanceId":"222",
+                 "resourceType":"vEPC"
+             },
+             {
+                 "resourceInstanceId":"3333",
+                 "resourceType":"overlay"
+             },
+             {
+                 "resourceInstanceId":"4444",
+                 "resourceType":"underlay"
+             }
+         ]*/
+            String serviceRelationShip = execution.getVariable("serviceRelationShip")
+            
+            def jsonSlurper = new JsonSlurper()
+            def jsonOutput = new JsonOutput()         
+            List relationShipList =  jsonSlurper.parseText(serviceRelationShip)
+                    
+            if (relationShipList != null) {
+                relationShipList.each {
+                    resourceTemplateUUIDs  = resourceTemplateUUIDs + it.resourceInstanceId + ":"
+                }
+            }           
+
+            def dbAdapterEndpoint = execution.getVariable("URN_mso_openecomp_adapters_db_endpoint")
+            execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
+            utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
+
+            String payload =
+                """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+                        xmlns:ns="http://org.openecomp.mso/requestsdb">
+                        <soapenv:Header/>
+                        <soapenv:Body>
+                            <ns:initResourceOperationStatus xmlns:ns="http://org.openecomp.mso/requestsdb">
+                            <serviceId>${serviceId}</serviceId>
+                            <operationId>${operationId}</operationId>
+                            <operationType>${operationType}</operationType>
+                            <resourceTemplateUUIDs>${resourceTemplateUUIDs}</resourceTemplateUUIDs>
+                        </ns:initResourceOperationStatus>
+                    </soapenv:Body>
+                </soapenv:Envelope>"""
+
+            payload = utils.formatXml(payload)
+            execution.setVariable("CVFMI_initResOperStatusRequest", payload)
+            utils.log("DEBUG", "Outgoing initResourceOperationStatus: \n" + payload, isDebugEnabled)
+            utils.logAudit("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
+
+        }catch(Exception e){
+            utils.log("ERROR", "Exception Occured Processing preInitResourcesOperStatus. Exception is:\n" + e, isDebugEnabled)
+            execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
+        }
+        utils.log("DEBUG", "======== COMPLETED preInitResourcesOperStatus Process ======== ", isDebugEnabled)  
+    }
+    
    /**
     * prepare delete parameters
     */
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn
index 0273983..c6a6d02 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn
@@ -109,7 +109,7 @@
       <bpmn:sequenceFlow id="SequenceFlow_1py6yqz" sourceRef="ScriptTask_0so3xj0" targetRef="CallActivity_1qhekgt" />
     </bpmn:subProcess>
     <bpmn:scriptTask id="ScriptTask_1mao77y" name="Send Sync Ack Response" scriptFormat="groovy">
-      <bpmn:incoming>SequenceFlow_1x62wqv</bpmn:incoming>
+      <bpmn:incoming>SequenceFlow_0yowshs</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0zf2qyk</bpmn:outgoing>
       <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
 def csi = new  DeleteCustomE2EServiceInstance()
@@ -128,20 +128,12 @@
     <bpmn:sequenceFlow id="SequenceFlow_0zf2qyk" sourceRef="ScriptTask_1mao77y" targetRef="CallActivity_1vyx9hu" />
     <bpmn:sequenceFlow id="SequenceFlow_07hrbs0" sourceRef="CallActivity_1vyx9hu" targetRef="ExclusiveGateway_0vu8gx6" />
     <bpmn:sequenceFlow id="SequenceFlow_1ab5l2q" sourceRef="CallActivity_1wx4ihe" targetRef="EndEvent_0db8bs6" />
-    <bpmn:sequenceFlow id="SequenceFlow_0yowshs" sourceRef="ScriptTask_0a63hms" targetRef="ScriptTask_1fhsuor" />
+    <bpmn:sequenceFlow id="SequenceFlow_0yowshs" sourceRef="ScriptTask_0a63hms" targetRef="ScriptTask_1mao77y" />
     <bpmn:sequenceFlow id="SequenceFlow_04urx2e" name="yes" sourceRef="ExclusiveGateway_0vu8gx6" targetRef="ScriptTask_1fzpbop">
       <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("WorkflowException") == null}]]></bpmn:conditionExpression>
     </bpmn:sequenceFlow>
     <bpmn:sequenceFlow id="SequenceFlow_1ii935p" sourceRef="ScriptTask_1fzpbop" targetRef="CallActivity_1wx4ihe" />
     <bpmn:sequenceFlow id="SequenceFlow_1t6ekab" name="no" sourceRef="ExclusiveGateway_0vu8gx6" targetRef="EndEvent_1i1g9s6" />
-    <bpmn:scriptTask id="ScriptTask_1fhsuor" name="Prepare Resource Oper Status">
-      <bpmn:incoming>SequenceFlow_0yowshs</bpmn:incoming>
-      <bpmn:outgoing>SequenceFlow_1x62wqv</bpmn:outgoing>
-      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
-def ddsi = new DeleteCustomE2EServiceInstance()
-ddsi.preInitResourcesOperStatus(execution)]]></bpmn:script>
-    </bpmn:scriptTask>
-    <bpmn:sequenceFlow id="SequenceFlow_1x62wqv" sourceRef="ScriptTask_1fhsuor" targetRef="ScriptTask_1mao77y" />
   </bpmn:process>
   <bpmn:error id="Error_1erlsmy" name="MSO Workflow Exception" errorCode="MSOWorkflowException" />
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
@@ -156,39 +148,39 @@
         <dc:Bounds x="834" y="660" width="394" height="188" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="CallActivity_1vyx9hu_di" bpmnElement="CallActivity_1vyx9hu">
-        <dc:Bounds x="1385" y="187" width="100" height="80" />
+        <dc:Bounds x="1159" y="187" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="EndEvent_0db8bs6_di" bpmnElement="EndEvent_0db8bs6">
-        <dc:Bounds x="1910" y="304" width="36" height="36" />
+        <dc:Bounds x="1686" y="304" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1921" y="340" width="19" height="12" />
+          <dc:Bounds x="1696" y="340" width="22" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_0a63hms_di" bpmnElement="ScriptTask_0a63hms">
         <dc:Bounds x="724" y="187" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_1fzpbop_di" bpmnElement="ScriptTask_1fzpbop">
-        <dc:Bounds x="1717" y="187" width="100" height="80" />
+        <dc:Bounds x="1493" y="187" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="CallActivity_1wx4ihe_di" bpmnElement="CallActivity_1wx4ihe">
-        <dc:Bounds x="1878" y="187" width="100" height="80" />
+        <dc:Bounds x="1654" y="187" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="SubProcess_1vbcima_di" bpmnElement="SubProcess_1vbcima" isExpanded="true">
         <dc:Bounds x="736" y="374" width="679" height="194" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_1mao77y_di" bpmnElement="ScriptTask_1mao77y">
-        <dc:Bounds x="1221" y="187" width="100" height="80" />
+        <dc:Bounds x="936" y="187" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ExclusiveGateway_0vu8gx6_di" bpmnElement="ExclusiveGateway_0vu8gx6" isMarkerVisible="true">
-        <dc:Bounds x="1582" y="202" width="50" height="50" />
+        <dc:Bounds x="1358" y="202" width="50" height="50" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1582" y="174" width="49" height="12" />
+          <dc:Bounds x="1358" y="174" width="50" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="EndEvent_1i1g9s6_di" bpmnElement="EndEvent_1i1g9s6">
-        <dc:Bounds x="1589" y="304" width="36" height="36" />
+        <dc:Bounds x="1365" y="304" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1517" y="340" width="90" height="12" />
+          <dc:Bounds x="1293" y="340" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_1wxumid_di" bpmnElement="SequenceFlow_1wxumid">
@@ -199,54 +191,52 @@
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0zf2qyk_di" bpmnElement="SequenceFlow_0zf2qyk">
-        <di:waypoint xsi:type="dc:Point" x="1321" y="227" />
-        <di:waypoint xsi:type="dc:Point" x="1385" y="227" />
+        <di:waypoint xsi:type="dc:Point" x="1036" y="227" />
+        <di:waypoint xsi:type="dc:Point" x="1159" y="227" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1308" y="206" width="90" height="12" />
+          <dc:Bounds x="1052.5" y="206" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_07hrbs0_di" bpmnElement="SequenceFlow_07hrbs0">
-        <di:waypoint xsi:type="dc:Point" x="1485" y="227" />
-        <di:waypoint xsi:type="dc:Point" x="1582" y="227" />
+        <di:waypoint xsi:type="dc:Point" x="1259" y="227" />
+        <di:waypoint xsi:type="dc:Point" x="1358" y="227" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1488.5" y="206" width="90" height="12" />
+          <dc:Bounds x="1263.5" y="206" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1ab5l2q_di" bpmnElement="SequenceFlow_1ab5l2q">
-        <di:waypoint xsi:type="dc:Point" x="1928" y="267" />
-        <di:waypoint xsi:type="dc:Point" x="1928" y="304" />
+        <di:waypoint xsi:type="dc:Point" x="1704" y="267" />
+        <di:waypoint xsi:type="dc:Point" x="1704" y="304" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1898" y="280" width="90" height="12" />
+          <dc:Bounds x="1674" y="280" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0yowshs_di" bpmnElement="SequenceFlow_0yowshs">
         <di:waypoint xsi:type="dc:Point" x="824" y="227" />
-        <di:waypoint xsi:type="dc:Point" x="892" y="227" />
+        <di:waypoint xsi:type="dc:Point" x="936" y="227" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="813" y="206" width="90" height="12" />
+          <dc:Bounds x="835" y="206" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_04urx2e_di" bpmnElement="SequenceFlow_04urx2e">
-        <di:waypoint xsi:type="dc:Point" x="1632" y="227" />
-        <di:waypoint xsi:type="dc:Point" x="1717" y="227" />
+        <di:waypoint xsi:type="dc:Point" x="1408" y="227" />
+        <di:waypoint xsi:type="dc:Point" x="1493" y="227" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1634" y="203" width="19" height="12" />
+          <dc:Bounds x="1410" y="203" width="20" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1ii935p_di" bpmnElement="SequenceFlow_1ii935p">
-        <di:waypoint xsi:type="dc:Point" x="1817" y="227" />
-        <di:waypoint xsi:type="dc:Point" x="1878" y="227" />
+        <di:waypoint xsi:type="dc:Point" x="1593" y="227" />
+        <di:waypoint xsi:type="dc:Point" x="1654" y="227" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1759" y="212" width="90" height="12" />
+          <dc:Bounds x="1535" y="212" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1t6ekab_di" bpmnElement="SequenceFlow_1t6ekab">
-        <di:waypoint xsi:type="dc:Point" x="1607" y="252" />
-        <di:waypoint xsi:type="dc:Point" x="1607" y="277" />
-        <di:waypoint xsi:type="dc:Point" x="1607" y="277" />
-        <di:waypoint xsi:type="dc:Point" x="1607" y="304" />
+        <di:waypoint xsi:type="dc:Point" x="1383" y="252" />
+        <di:waypoint xsi:type="dc:Point" x="1383" y="304" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1616" y="277" width="12" height="12" />
+          <dc:Bounds x="1391" y="277" width="15" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_1c6ogpt_di" bpmnElement="ScriptTask_1c6ogpt">
@@ -331,16 +321,6 @@
           <dc:Bounds x="1060" y="463" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="ScriptTask_1fhsuor_di" bpmnElement="ScriptTask_1fhsuor">
-        <dc:Bounds x="892" y="187" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_1x62wqv_di" bpmnElement="SequenceFlow_1x62wqv">
-        <di:waypoint xsi:type="dc:Point" x="992" y="227" />
-        <di:waypoint xsi:type="dc:Point" x="1221" y="227" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="1061.5" y="206" width="90" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn:definitions>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCustomDeleteE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCustomDeleteE2EServiceInstance.bpmn
index ea7056d..2224631 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCustomDeleteE2EServiceInstance.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCustomDeleteE2EServiceInstance.bpmn
@@ -112,7 +112,7 @@
       <bpmn:incoming>SequenceFlow_1wmjau1</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0qquvgc</bpmn:outgoing>
     </bpmn:callActivity>
-    <bpmn:sequenceFlow id="SequenceFlow_1av166w" sourceRef="ExclusiveGateway_0veiutm" targetRef="ScriptTask_0z30dax" />
+    <bpmn:sequenceFlow id="SequenceFlow_1av166w" sourceRef="ExclusiveGateway_0veiutm" targetRef="ScriptTask_146jt8v" />
     <bpmn:sequenceFlow id="SequenceFlow_0qquvgc" sourceRef="CallActivity_Del_VFC" targetRef="ScriptTask_0mdub03" />
     <bpmn:scriptTask id="ScriptTask_0vcz9mj" name="Prepare Resource Delele For vEPC" scriptFormat="groovy">
       <bpmn:incoming>SequenceFlow_1931m8u</bpmn:incoming>
@@ -142,7 +142,7 @@
 ddsi.postProcessSDNCDelete(execution, response, "delete")]]></bpmn:script>
     </bpmn:scriptTask>
     <bpmn:scriptTask id="ScriptTask_0z30dax" name="Prepare Resource Delele For Overlay" scriptFormat="groovy">
-      <bpmn:incoming>SequenceFlow_1av166w</bpmn:incoming>
+      <bpmn:incoming>SequenceFlow_0l4w9nr</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1dza4q4</bpmn:outgoing>
       <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
 String resourceName = "overlay"
@@ -203,6 +203,37 @@
       <bpmn:incoming>SequenceFlow_1g4djgh</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0uc2beq</bpmn:outgoing>
     </bpmn:serviceTask>
+    <bpmn:scriptTask id="ScriptTask_146jt8v" name="Prepare Resource Oper Status">
+      <bpmn:incoming>SequenceFlow_1av166w</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_1ym9otf</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def ddsi = new DoCustomDeleteE2EServiceInstance()
+ddsi.preInitResourcesOperStatus(execution)]]></bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:serviceTask id="ServiceTask_00tg69u" name="Init Resource Oper Status">
+      <bpmn:extensionElements>
+        <camunda:connector>
+          <camunda:inputOutput>
+            <camunda:inputParameter name="url">${URN_mso_openecomp_adapters_db_endpoint}</camunda:inputParameter>
+            <camunda:inputParameter name="headers">
+              <camunda:map>
+                <camunda:entry key="content-type">application/soap+xml</camunda:entry>
+                <camunda:entry key="Authorization">#{BasicAuthHeaderValueDB}</camunda:entry>
+              </camunda:map>
+            </camunda:inputParameter>
+            <camunda:inputParameter name="payload">${CVFMI_initResOperStatusRequest}</camunda:inputParameter>
+            <camunda:inputParameter name="method">POST</camunda:inputParameter>
+            <camunda:outputParameter name="CVFMI_dbResponseCode">${statusCode}</camunda:outputParameter>
+            <camunda:outputParameter name="CVFMI_dbResponse">${response}</camunda:outputParameter>
+          </camunda:inputOutput>
+          <camunda:connectorId>http-connector</camunda:connectorId>
+        </camunda:connector>
+      </bpmn:extensionElements>
+      <bpmn:incoming>SequenceFlow_1ym9otf</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0l4w9nr</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_1ym9otf" sourceRef="ScriptTask_146jt8v" targetRef="ServiceTask_00tg69u" />
+    <bpmn:sequenceFlow id="SequenceFlow_0l4w9nr" sourceRef="ServiceTask_00tg69u" targetRef="ScriptTask_0z30dax" />
   </bpmn:process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
     <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCustomDeleteE2EServiceInstance">
@@ -344,9 +375,9 @@
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_1av166w_di" bpmnElement="SequenceFlow_1av166w">
         <di:waypoint xsi:type="dc:Point" x="42" y="-17" />
-        <di:waypoint xsi:type="dc:Point" x="167" y="-17" />
+        <di:waypoint xsi:type="dc:Point" x="83" y="-17" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="59.5" y="-38" width="90" height="12" />
+          <dc:Bounds x="17.5" y="-38" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0qquvgc_di" bpmnElement="SequenceFlow_0qquvgc">
@@ -373,20 +404,20 @@
         <dc:Bounds x="1188" y="-57" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_0z30dax_di" bpmnElement="ScriptTask_0z30dax">
-        <dc:Bounds x="167" y="-57" width="100" height="80" />
+        <dc:Bounds x="356" y="-57" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_1dza4q4_di" bpmnElement="SequenceFlow_1dza4q4">
-        <di:waypoint xsi:type="dc:Point" x="267" y="-17" />
-        <di:waypoint xsi:type="dc:Point" x="360" y="-17" />
+        <di:waypoint xsi:type="dc:Point" x="456" y="-17" />
+        <di:waypoint xsi:type="dc:Point" x="524" y="-17" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="268.5" y="-38" width="90" height="12" />
+          <dc:Bounds x="445" y="-38" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0rpu756_di" bpmnElement="SequenceFlow_0rpu756">
-        <di:waypoint xsi:type="dc:Point" x="460" y="-17" />
-        <di:waypoint xsi:type="dc:Point" x="564" y="-17" />
+        <di:waypoint xsi:type="dc:Point" x="624" y="-17" />
+        <di:waypoint xsi:type="dc:Point" x="692" y="-17" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="467" y="-38" width="90" height="12" />
+          <dc:Bounds x="613" y="-38" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0uhpfcl_di" bpmnElement="SequenceFlow_0uhpfcl">
@@ -432,38 +463,58 @@
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ServiceTask_0v9q75y_di" bpmnElement="CallActivity_Del_SDNC_cust">
-        <dc:Bounds x="360" y="-57" width="100" height="80" />
+        <dc:Bounds x="524" y="-57" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_0d9lmlv_di" bpmnElement="SequenceFlow_0d9lmlv">
-        <di:waypoint xsi:type="dc:Point" x="664" y="-17" />
-        <di:waypoint xsi:type="dc:Point" x="769" y="-17" />
+        <di:waypoint xsi:type="dc:Point" x="792" y="-17" />
+        <di:waypoint xsi:type="dc:Point" x="855" y="-17" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="671.5" y="-38" width="90" height="12" />
+          <dc:Bounds x="778.5" y="-38" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1g4djgh_di" bpmnElement="SequenceFlow_1g4djgh">
-        <di:waypoint xsi:type="dc:Point" x="869" y="-17" />
-        <di:waypoint xsi:type="dc:Point" x="971" y="-17" />
+        <di:waypoint xsi:type="dc:Point" x="955" y="-17" />
+        <di:waypoint xsi:type="dc:Point" x="1021" y="-17" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="875" y="-38" width="90" height="12" />
+          <dc:Bounds x="943" y="-38" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0uc2beq_di" bpmnElement="SequenceFlow_0uc2beq">
-        <di:waypoint xsi:type="dc:Point" x="1071" y="-17" />
+        <di:waypoint xsi:type="dc:Point" x="1121" y="-17" />
         <di:waypoint xsi:type="dc:Point" x="1188" y="-17" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1084.5" y="-38" width="90" height="12" />
+          <dc:Bounds x="1109.5" y="-38" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_1e5z0wu_di" bpmnElement="Task_14erap6">
-        <dc:Bounds x="564" y="-57" width="100" height="80" />
+        <dc:Bounds x="692" y="-57" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ServiceTask_0f0965f_di" bpmnElement="Task_1j1u666">
-        <dc:Bounds x="769" y="-57" width="100" height="80" />
+        <dc:Bounds x="855" y="-57" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ServiceTask_0p4b7e1_di" bpmnElement="Task_0edkv0m">
-        <dc:Bounds x="971" y="-57" width="100" height="80" />
+        <dc:Bounds x="1021" y="-57" width="100" height="80" />
       </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ScriptTask_146jt8v_di" bpmnElement="ScriptTask_146jt8v">
+        <dc:Bounds x="83" y="-57" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_00tg69u_di" bpmnElement="ServiceTask_00tg69u">
+        <dc:Bounds x="208" y="-57" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_1ym9otf_di" bpmnElement="SequenceFlow_1ym9otf">
+        <di:waypoint xsi:type="dc:Point" x="183" y="-17" />
+        <di:waypoint xsi:type="dc:Point" x="208" y="-17" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="151.5" y="-38" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_0l4w9nr_di" bpmnElement="SequenceFlow_0l4w9nr">
+        <di:waypoint xsi:type="dc:Point" x="308" y="-17" />
+        <di:waypoint xsi:type="dc:Point" x="356" y="-17" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="332" y="-38" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn:definitions>