summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorseshukm <seshu.kumar.m@huawei.com>2017-10-25 09:47:33 +0530
committerseshukm <seshu.kumar.m@huawei.com>2017-10-25 09:47:33 +0530
commit7ff576f74b103e9d93e60bb89ffda3860a47aa28 (patch)
tree8da028775112ce9af5f58790f7908f33fae6c06e
parenteb7b6b427608fa21cf6241620202a803089020af (diff)
update operation status for E2Edelete
IssueId: SO-258 Change-Id: I7699b44d5e72fdcec96f86b0c493b969f9c91598 Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy81
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy79
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn98
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCustomDeleteE2EServiceInstance.bpmn97
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java126
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/DelE2ESvcResp.java37
6 files changed, 315 insertions, 203 deletions
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 3cd2b282e0..7ab651c9b0 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
@@ -98,7 +98,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
} else {
execution.setVariable("globalSubscriberId", globalSubscriberId)
}
-
+ 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){
@@ -156,6 +156,85 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
}
+ 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 b26976d985..f141bbdeb0 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,85 +472,6 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
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_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)
- }
-
/**
* prepare delete parameters
*/
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn
index f24acb4a51..0273983104 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn
@@ -109,7 +109,7 @@ csi.sendSyncError(execution)]]></bpmn:script>
<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_0yowshs</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_1x62wqv</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0zf2qyk</bpmn:outgoing>
<bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
def csi = new DeleteCustomE2EServiceInstance()
@@ -128,16 +128,24 @@ csi.sendSyncResponse(execution)]]></bpmn:script>
<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_1mao77y" />
+ <bpmn:sequenceFlow id="SequenceFlow_0yowshs" sourceRef="ScriptTask_0a63hms" targetRef="ScriptTask_1fhsuor" />
<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">
- <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteCustomE2EServiceInstance">
<bpmndi:BPMNShape id="StartEvent_00m8zen_di" bpmnElement="StartEvent_00m8zen">
<dc:Bounds x="577" y="209" width="36" height="36" />
<bpmndi:BPMNLabel>
@@ -148,99 +156,97 @@ csi.sendSyncResponse(execution)]]></bpmn:script>
<dc:Bounds x="834" y="660" width="394" height="188" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_1vyx9hu_di" bpmnElement="CallActivity_1vyx9hu">
- <dc:Bounds x="1121" y="187" width="100" height="80" />
+ <dc:Bounds x="1385" y="187" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_0db8bs6_di" bpmnElement="EndEvent_0db8bs6">
- <dc:Bounds x="1646" y="304" width="36" height="36" />
+ <dc:Bounds x="1910" y="304" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1657" y="340" width="19" height="12" />
+ <dc:Bounds x="1921" y="340" width="19" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_0a63hms_di" bpmnElement="ScriptTask_0a63hms">
- <dc:Bounds x="741" y="187" width="100" height="80" />
+ <dc:Bounds x="724" y="187" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1fzpbop_di" bpmnElement="ScriptTask_1fzpbop">
- <dc:Bounds x="1453" y="187" width="100" height="80" />
+ <dc:Bounds x="1717" y="187" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_1wx4ihe_di" bpmnElement="CallActivity_1wx4ihe">
- <dc:Bounds x="1614" y="187" width="100" height="80" />
+ <dc:Bounds x="1878" 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="920" y="187" width="100" height="80" />
+ <dc:Bounds x="1221" y="187" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ExclusiveGateway_0vu8gx6_di" bpmnElement="ExclusiveGateway_0vu8gx6" isMarkerVisible="true">
- <dc:Bounds x="1318" y="202" width="50" height="50" />
+ <dc:Bounds x="1582" y="202" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1318" y="174" width="49" height="12" />
+ <dc:Bounds x="1582" y="174" width="49" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_1i1g9s6_di" bpmnElement="EndEvent_1i1g9s6">
- <dc:Bounds x="1325" y="304" width="36" height="36" />
+ <dc:Bounds x="1589" y="304" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1298" y="340" width="0" height="12" />
+ <dc:Bounds x="1517" y="340" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1wxumid_di" bpmnElement="SequenceFlow_1wxumid">
<di:waypoint xsi:type="dc:Point" x="613" y="227" />
- <di:waypoint xsi:type="dc:Point" x="741" y="227" />
+ <di:waypoint xsi:type="dc:Point" x="724" y="227" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="587" y="212" width="90" height="12" />
+ <dc:Bounds x="623.5" y="206" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0zf2qyk_di" bpmnElement="SequenceFlow_0zf2qyk">
- <di:waypoint xsi:type="dc:Point" x="1020" y="227" />
- <di:waypoint xsi:type="dc:Point" x="1073" y="227" />
- <di:waypoint xsi:type="dc:Point" x="1073" y="227" />
- <di:waypoint xsi:type="dc:Point" x="1121" y="227" />
+ <di:waypoint xsi:type="dc:Point" x="1321" y="227" />
+ <di:waypoint xsi:type="dc:Point" x="1385" y="227" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1043" y="227" width="0" height="12" />
+ <dc:Bounds x="1308" 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="1221" y="227" />
- <di:waypoint xsi:type="dc:Point" x="1318" y="227" />
+ <di:waypoint xsi:type="dc:Point" x="1485" y="227" />
+ <di:waypoint xsi:type="dc:Point" x="1582" y="227" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1225.5" y="212" width="0" height="12" />
+ <dc:Bounds x="1488.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="1664" y="267" />
- <di:waypoint xsi:type="dc:Point" x="1664" y="304" />
+ <di:waypoint xsi:type="dc:Point" x="1928" y="267" />
+ <di:waypoint xsi:type="dc:Point" x="1928" y="304" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1634" y="279.5" width="90" height="12" />
+ <dc:Bounds x="1898" 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="841" y="227" />
- <di:waypoint xsi:type="dc:Point" x="920" y="227" />
+ <di:waypoint xsi:type="dc:Point" x="824" y="227" />
+ <di:waypoint xsi:type="dc:Point" x="892" y="227" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="835.5" y="206" width="90" height="12" />
+ <dc:Bounds x="813" 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="1368" y="227" />
- <di:waypoint xsi:type="dc:Point" x="1453" y="227" />
+ <di:waypoint xsi:type="dc:Point" x="1632" y="227" />
+ <di:waypoint xsi:type="dc:Point" x="1717" y="227" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1370.25" y="203" width="18" height="12" />
+ <dc:Bounds x="1634" y="203" width="19" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1ii935p_di" bpmnElement="SequenceFlow_1ii935p">
- <di:waypoint xsi:type="dc:Point" x="1553" y="227" />
- <di:waypoint xsi:type="dc:Point" x="1614" y="227" />
+ <di:waypoint xsi:type="dc:Point" x="1817" y="227" />
+ <di:waypoint xsi:type="dc:Point" x="1878" y="227" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1495" y="212" width="90" height="12" />
+ <dc:Bounds x="1759" 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="1343" y="252" />
- <di:waypoint xsi:type="dc:Point" x="1343" y="277" />
- <di:waypoint xsi:type="dc:Point" x="1343" y="277" />
- <di:waypoint xsi:type="dc:Point" x="1343" y="304" />
+ <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" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1352" y="277" width="12" height="12" />
+ <dc:Bounds x="1616" y="277" width="12" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_1c6ogpt_di" bpmnElement="ScriptTask_1c6ogpt">
@@ -325,6 +331,16 @@ csi.sendSyncResponse(execution)]]></bpmn:script>
<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 581ab3a47d..ea7056d1b4 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCustomDeleteE2EServiceInstance.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCustomDeleteE2EServiceInstance.bpmn
@@ -112,7 +112,7 @@ ex.processJavaException(execution)]]></bpmn:script>
<bpmn:incoming>SequenceFlow_1wmjau1</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0qquvgc</bpmn:outgoing>
</bpmn:callActivity>
- <bpmn:sequenceFlow id="SequenceFlow_1av166w" sourceRef="ExclusiveGateway_0veiutm" targetRef="Task_0oriv78" />
+ <bpmn:sequenceFlow id="SequenceFlow_1av166w" sourceRef="ExclusiveGateway_0veiutm" targetRef="ScriptTask_0z30dax" />
<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 @@ def ddsi = new DoCustomDeleteE2EServiceInstance()
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_13sc98g</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_1av166w</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1dza4q4</bpmn:outgoing>
<bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
String resourceName = "overlay"
@@ -154,36 +154,6 @@ ddsi.preResourceDelete(execution, resourceName )]]></bpmn:script>
<bpmn:sequenceFlow id="SequenceFlow_0uhpfcl" name="yes" sourceRef="ExclusiveGateway_0veiutm" targetRef="CallActivity_06izbke">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{ execution.getVariable("sdncVersion" ) == "1610" }]]></bpmn:conditionExpression>
</bpmn:sequenceFlow>
- <bpmn:sequenceFlow id="SequenceFlow_030y6yz" sourceRef="Task_0oriv78" targetRef="Task_0pkgoxn" />
- <bpmn:scriptTask id="Task_0oriv78" name="Prepare Resource Oper Status">
- <bpmn:incoming>SequenceFlow_1av166w</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_030y6yz</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="Task_0pkgoxn" name="Init Resource Oper Status">
- <bpmn:extensionElements>
- <camunda:connector>
- <camunda:inputOutput>
- <camunda:inputParameter name="url">${URN_mso_adapters_openecomp_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_030y6yz</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_13sc98g</bpmn:outgoing>
- </bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_1wnkgpx" sourceRef="Task_0z1x3sg" targetRef="Task_0963dho" />
<bpmn:sequenceFlow id="SequenceFlow_1931m8u" sourceRef="Task_0963dho" targetRef="ScriptTask_0vcz9mj" />
<bpmn:scriptTask id="Task_0z1x3sg" name="Prepare Resource Delele For vIMS">
@@ -195,7 +165,6 @@ def ddsi = new DoCustomDeleteE2EServiceInstance()
ddsi.preResourceDelete(execution, resourceName )]]></bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="SequenceFlow_1m7tont" sourceRef="ScriptTask_1g0tsto" targetRef="Task_0z1x3sg" />
- <bpmn:sequenceFlow id="SequenceFlow_13sc98g" sourceRef="Task_0pkgoxn" targetRef="ScriptTask_0z30dax" />
<bpmn:callActivity id="Task_0963dho" name="Call Network Service Delete for vIMS" calledElement="DODeleteVFCNetworkServiceInstance">
<bpmn:extensionElements>
<camunda:in source="globalSubscriberId" target="globalSubscriberId" />
@@ -375,9 +344,9 @@ ddsi.preResourceDelete(execution, resourceName )]]></bpmn:script>
</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="87" y="-17" />
+ <di:waypoint xsi:type="dc:Point" x="167" y="-17" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="19.5" y="-38" width="90" height="12" />
+ <dc:Bounds x="59.5" y="-38" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0qquvgc_di" bpmnElement="SequenceFlow_0qquvgc">
@@ -404,20 +373,20 @@ ddsi.preResourceDelete(execution, resourceName )]]></bpmn:script>
<dc:Bounds x="1188" y="-57" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_0z30dax_di" bpmnElement="ScriptTask_0z30dax">
- <dc:Bounds x="377" y="-57" width="100" height="80" />
+ <dc:Bounds x="167" y="-57" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1dza4q4_di" bpmnElement="SequenceFlow_1dza4q4">
- <di:waypoint xsi:type="dc:Point" x="477" y="-17" />
- <di:waypoint xsi:type="dc:Point" x="523" y="-17" />
+ <di:waypoint xsi:type="dc:Point" x="267" y="-17" />
+ <di:waypoint xsi:type="dc:Point" x="360" y="-17" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="455" y="-38" width="90" height="12" />
+ <dc:Bounds x="268.5" 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="623" y="-17" />
- <di:waypoint xsi:type="dc:Point" x="711" y="-17" />
+ <di:waypoint xsi:type="dc:Point" x="460" y="-17" />
+ <di:waypoint xsi:type="dc:Point" x="564" y="-17" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="622" y="-38" width="90" height="12" />
+ <dc:Bounds x="467" y="-38" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0uhpfcl_di" bpmnElement="SequenceFlow_0uhpfcl">
@@ -428,19 +397,6 @@ ddsi.preResourceDelete(execution, resourceName )]]></bpmn:script>
<dc:Bounds x="540.0043516100959" y="793" width="19" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_030y6yz_di" bpmnElement="SequenceFlow_030y6yz">
- <di:waypoint xsi:type="dc:Point" x="187" y="-17" />
- <di:waypoint xsi:type="dc:Point" x="212" y="-17" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="199.5" y="-38" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ScriptTask_19o0tpz_di" bpmnElement="Task_0oriv78">
- <dc:Bounds x="87" y="-57" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ServiceTask_07erhm6_di" bpmnElement="Task_0pkgoxn">
- <dc:Bounds x="212" y="-57" width="100" height="80" />
- </bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1wnkgpx_di" bpmnElement="SequenceFlow_1wnkgpx">
<di:waypoint xsi:type="dc:Point" x="1237" y="134" />
<di:waypoint xsi:type="dc:Point" x="1238" y="192" />
@@ -465,13 +421,6 @@ ddsi.preResourceDelete(execution, resourceName )]]></bpmn:script>
<dc:Bounds x="1253" y="32.5" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_13sc98g_di" bpmnElement="SequenceFlow_13sc98g">
- <di:waypoint xsi:type="dc:Point" x="312" y="-17" />
- <di:waypoint xsi:type="dc:Point" x="377" y="-17" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="344.5" y="-38" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="CallActivity_1mwacgl_di" bpmnElement="Task_0963dho">
<dc:Bounds x="1188" y="192" width="100" height="80" />
</bpmndi:BPMNShape>
@@ -483,37 +432,37 @@ ddsi.preResourceDelete(execution, resourceName )]]></bpmn:script>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0v9q75y_di" bpmnElement="CallActivity_Del_SDNC_cust">
- <dc:Bounds x="523" y="-57" width="100" height="80" />
+ <dc:Bounds x="360" y="-57" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0d9lmlv_di" bpmnElement="SequenceFlow_0d9lmlv">
- <di:waypoint xsi:type="dc:Point" x="811" y="-17" />
- <di:waypoint xsi:type="dc:Point" x="898" y="-17" />
+ <di:waypoint xsi:type="dc:Point" x="664" y="-17" />
+ <di:waypoint xsi:type="dc:Point" x="769" y="-17" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="854.5" y="-38" width="0" height="12" />
+ <dc:Bounds x="671.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="998" y="-17" />
- <di:waypoint xsi:type="dc:Point" x="1052" y="-17" />
+ <di:waypoint xsi:type="dc:Point" x="869" y="-17" />
+ <di:waypoint xsi:type="dc:Point" x="971" y="-17" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1025" y="-38" width="0" height="12" />
+ <dc:Bounds x="875" 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="1152" y="-17" />
+ <di:waypoint xsi:type="dc:Point" x="1071" y="-17" />
<di:waypoint xsi:type="dc:Point" x="1188" y="-17" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1170" y="-38" width="0" height="12" />
+ <dc:Bounds x="1084.5" y="-38" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_1e5z0wu_di" bpmnElement="Task_14erap6">
- <dc:Bounds x="711" y="-57" width="100" height="80" />
+ <dc:Bounds x="564" y="-57" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0f0965f_di" bpmnElement="Task_1j1u666">
- <dc:Bounds x="898" y="-57" width="100" height="80" />
+ <dc:Bounds x="769" y="-57" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0p4b7e1_di" bpmnElement="Task_0edkv0m">
- <dc:Bounds x="1052" y="-57" width="100" height="80" />
+ <dc:Bounds x="971" y="-57" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
index 2d1d572927..83755ca253 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
@@ -29,6 +29,7 @@ import java.util.Map;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
@@ -40,14 +41,19 @@ import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.codehaus.jackson.map.ObjectMapper;
import org.hibernate.Session;
-
+import org.json.JSONObject;
import org.openecomp.mso.apihandler.common.ErrorNumbers;
import org.openecomp.mso.apihandler.common.RequestClient;
import org.openecomp.mso.apihandler.common.RequestClientFactory;
import org.openecomp.mso.apihandler.common.ResponseHandler;
+import org.openecomp.mso.apihandlerinfra.Messages;
+import org.openecomp.mso.apihandlerinfra.MsoException;
+import org.openecomp.mso.apihandlerinfra.MsoRequest;
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.DelE2ESvcResp;
import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceDeleteRequest;
import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceRequest;
import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EUserParam;
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.GetE2EServiceInstanceResponse;
import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.ModelInfo;
import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestDetails;
import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestInfo;
@@ -115,11 +121,65 @@ public class E2EServiceInstances {
return deleteE2EserviceInstances(request, Action.deleteInstance, instanceIdMap, version);
}
+
+ @GET
+ @Path("/{version:[vV][3-5]}/{serviceId}/operations/{operationId}")
+ @ApiOperation(value = "Find e2eServiceInstances Requests for a given serviceId and operationId", response = Response.class)
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response getE2EServiceInstances(@PathParam("serviceId") String serviceId,
+ @PathParam("version") String version, @PathParam("operationId") String operationId) {
+ RequestsDatabase requestsDB = RequestsDatabase.getInstance();
+
+ GetE2EServiceInstanceResponse e2eServiceResponse = new GetE2EServiceInstanceResponse();
+
+ MsoRequest msoRequest = new MsoRequest(serviceId);
+
+ long startTime = System.currentTimeMillis();
+
+ OperationStatus operationStatus = null;
+
+ try {
+ operationStatus = requestsDB.getOperationStatus(serviceId, operationId);
+
+ } catch (Exception e) {
+ msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",
+ MsoLogger.ErrorCode.AvailabilityError,
+ "Exception while communciate with Request DB - Infra Request Lookup", e);
+ msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+ Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
+ MsoException.ServiceException, e.getMessage(), ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB, null);
+ alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL,
+ Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB));
+ msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
+ "Exception while communciate with Request DB");
+ msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+ return response;
+
+ }
+
+ if (operationStatus == null) {
+ Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NO_CONTENT,
+ MsoException.ServiceException, "E2E serviceId " + serviceId + " is not found in DB",
+ ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
+ msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+ MsoLogger.ErrorCode.BusinessProcesssError,
+ "Null response from RequestDB when searching by serviceId");
+ msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+ "Null response from RequestDB when searching by serviceId");
+ msoLogger.debug("End of the transaction, the final response is: " + (String) resp.getEntity());
+ return resp;
+
+ }
+
+ e2eServiceResponse.setE2eRequest(operationStatus);
+
+ return Response.status(200).entity(e2eServiceResponse).build();
+ }
private Response deleteE2EserviceInstances(String requestJSON, Action action,
HashMap<String, String> instanceIdMap, String version) {
-
- String requestId = UUIDChecker.generateUUID(msoLogger);
+ //TODO should be a new one or the same service instance Id
+ String requestId = instanceIdMap.get("serviceId");
long startTime = System.currentTimeMillis();
msoLogger.debug("requestId is: " + requestId);
E2EServiceInstanceDeleteRequest e2eDelReq = null;
@@ -236,7 +296,7 @@ public class E2EServiceInstances {
ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
int bpelStatus = respHandler.getStatus();
- return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus);
+ return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action);
}
private Response processE2EserviceInstances(String requestJSON, Action action,
@@ -451,7 +511,7 @@ public class E2EServiceInstances {
ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
int bpelStatus = respHandler.getStatus();
- return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus);
+ return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action);
}
private void closeCatalogDB(CatalogDatabase db) {
@@ -495,12 +555,28 @@ public class E2EServiceInstances {
}
private Response beplStatusUpdate(String requestId, long startTime, MsoRequest msoRequest,
- RequestClient requestClient, ResponseHandler respHandler, int bpelStatus) {
- // BPEL accepted the request, the request is in progress
+ RequestClient requestClient, ResponseHandler respHandler, int bpelStatus, Action action) {
+ // BPMN accepted the request, the request is in progress
if (bpelStatus == HttpStatus.SC_ACCEPTED) {
String camundaJSONResponseBody = respHandler.getResponseBody();
msoLogger.debug("Received from Camunda: " + camundaJSONResponseBody);
-
+
+ // currently only for delete case we update the status here
+ if(action.name().equals("DELETE")){
+ ObjectMapper mapper = new ObjectMapper();
+ try{
+ DelE2ESvcResp jo = mapper.readValue(camundaJSONResponseBody, DelE2ESvcResp.class);
+ String operationId = jo.getOperationId();
+
+ this.createOperationStatusRecord("DELETE", requestId, operationId);
+ }
+ catch(Exception ex)
+ {
+ msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR, requestClient.getUrl(), "", "",
+ MsoLogger.ErrorCode.BusinessProcesssError,
+ "Response from BPEL engine is failed with HTTP Status=" + bpelStatus);
+ }
+ }
msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
"BPMN accepted the request, the request is in progress");
msoLogger.debug(END_OF_THE_TRANSACTION + camundaJSONResponseBody);
@@ -711,6 +787,40 @@ public class E2EServiceInstances {
if (null != session) {
session.close();
}
+ }
}
+ private void createOperationStatusRecord(String actionNm, String serviceId, String operationId) {
+
+ AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager();
+
+ Session session = null;
+ try {
+
+ session = requestsDbSessionFactoryManager.getSessionFactory().openSession();
+ session.beginTransaction();
+
+ OperationStatus os = new OperationStatus();
+ os.setOperation(actionNm);
+ os.setOperationContent("");
+ os.setOperationId(operationId);
+ os.setProgress("0");
+ os.setReason("");
+ os.setResult("processing");
+ os.setServiceId(serviceId);
+ //TODO : to be updated...
+ os.setUserId("");
+ os.setFinishedAt(new Timestamp(System.currentTimeMillis()));
+ os.setOperateAt(new Timestamp(System.currentTimeMillis()));
+
+ session.save(os);
+ session.getTransaction().commit();
+
+ } catch (Exception e) {
+ msoLogger.error (MessageEnum.APIH_DB_INSERT_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception when creation record request in Operation", e);
+ } finally {
+ if (null != session) {
+ session.close();
+ }
+ }
}
} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/DelE2ESvcResp.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/DelE2ESvcResp.java
new file mode 100644
index 0000000000..c05b0977ba
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/DelE2ESvcResp.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans;
+
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_DEFAULT)
+public class DelE2ESvcResp {
+
+ private String operationId;
+
+ public String getOperationId() {
+ return operationId;
+ }
+
+ public void setOperationId(String operationId) {
+ this.operationId = operationId;
+ }
+}