aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy22
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy9
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy22
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy42
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java (renamed from bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyConsumer.java)66
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn30
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteSDNCNetworkResource.bpmn38
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateCustomE2EServiceInstance.bpmn1
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoUpdateE2EServiceInstance.bpmn9
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/webapp/WEB-INF/applicationContext.xml6
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java (renamed from bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyConsumerTest.java)15
11 files changed, 177 insertions, 83 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
index f265638423..43b32a4d85 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
@@ -67,7 +67,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
try {
//get bpmn inputs from resource request.
- String requestId = execution.getVariable("requestId")
+ String requestId = execution.getVariable("mso-request-id")
String requestAction = execution.getVariable("requestAction")
utils.log("INFO","The requestAction is: " + requestAction, isDebugEnabled)
String recipeParamsFromRequest = execution.getVariable("recipeParams")
@@ -318,4 +318,24 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
utils.log("INFO","response from sdnc, response code :" + responseCode + " response object :" + responseObj, isDebugEnabled)
utils.log("INFO"," ***** Exit prepareSDNCRequest *****", isDebugEnabled)
}
+
+ public void sendSyncResponse (DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled)
+
+ try {
+ String operationStatus = "finished"
+ // RESTResponse for main flow
+ String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
+ utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + resourceOperationResp, isDebugEnabled)
+ sendWorkflowResponse(execution, 202, resourceOperationResp)
+ execution.setVariable("sentSyncResponse", true)
+
+ } catch (Exception ex) {
+ String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ utils.log("DEBUG"," ***** Exit sendSyncResopnse *****", isDebugEnabled)
+ }
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
index 9f3910beed..5390ee92db 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
@@ -269,7 +269,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
utils.log("INFO", " ======== Started Execute AAI Put Process ======== ", isDebugEnabled)
APIResponse apiResponse = null
try{
- String uuid = utils.getRequestID()
+ String uuid = execution.getVariable("mso-request-id");
utils.log("INFO","Generated uuid is: " + uuid, isDebugEnabled)
utils.log("INFO","URL to be used is: " + url, isDebugEnabled)
String userName = execution.getVariable("URN_aai_auth")
@@ -317,12 +317,11 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled)
try {
- String nsInstanceId = execution.getVariable("nsInstanceId")
String operationStatus = execution.getVariable("operationStatus")
// RESTResponse for main flow
- String createVFCResourceRestRsp = """{"nsInstanceId":"${nsInstanceId}","operationStatus":"${operationStatus}"}""".trim()
- utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + createVFCResourceRestRsp, isDebugEnabled)
- sendWorkflowResponse(execution, 202, createVFCResourceRestRsp)
+ String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
+ utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + resourceOperationResp, isDebugEnabled)
+ sendWorkflowResponse(execution, 202, resourceOperationResp)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
index 73230c6f21..447fa63baf 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
@@ -67,7 +67,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
try {
//get bpmn inputs from resource request.
- String requestId = execution.getVariable("requestId")
+ String requestId = execution.getVariable("mso-request-id")
String requestAction = execution.getVariable("requestAction")
utils.log("INFO","The requestAction is: " + requestAction, isDebugEnabled)
String recipeParamsFromRequest = execution.getVariable("recipeParams")
@@ -297,4 +297,24 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
utils.log("INFO","response from sdnc, response code :" + responseCode + " response object :" + responseObj, isDebugEnabled)
utils.log("INFO"," ***** Exit prepareSDNCRequest *****", isDebugEnabled)
}
+
+ public void sendSyncResponse (DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled)
+
+ try {
+ String operationStatus = "finished"
+ // RESTResponse for main flow
+ String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
+ utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + resourceOperationResp, isDebugEnabled)
+ sendWorkflowResponse(execution, 202, resourceOperationResp)
+ execution.setVariable("sentSyncResponse", true)
+
+ } catch (Exception ex) {
+ String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ utils.log("DEBUG"," ***** Exit sendSyncResopnse *****", isDebugEnabled)
+ }
}
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")
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyConsumer.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
index 1fd2de97f2..830574bad4 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyConsumer.java
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
@@ -20,7 +20,6 @@
package org.openecomp.mso.bpmn.infrastructure.pnf.dmaap;
-import com.google.common.annotations.VisibleForTesting;
import java.io.IOException;
import java.net.URI;
import java.util.Map;
@@ -38,7 +37,7 @@ import org.apache.http.util.EntityUtils;
import org.openecomp.mso.jsonpath.JsonPathUtil;
import org.openecomp.mso.logger.MsoLogger;
-public class PnfEventReadyConsumer implements DmaapClient {
+public class PnfEventReadyDmaapClient implements DmaapClient {
private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
@@ -57,7 +56,7 @@ public class PnfEventReadyConsumer implements DmaapClient {
private int dmaapClientDelayInSeconds;
private volatile boolean dmaapThreadListenerIsRunning;
- public PnfEventReadyConsumer() {
+ public PnfEventReadyDmaapClient() {
httpClient = HttpClientBuilder.create().build();
pnfCorrelationIdToThreadMap = new ConcurrentHashMap<>();
executor = null;
@@ -67,17 +66,6 @@ public class PnfEventReadyConsumer implements DmaapClient {
getRequest = new HttpGet(buildURI());
}
- //TODO: extract this logic to separate class and test it there to avoid using VisibleForTesting
- @VisibleForTesting
- void sendRequest() {
- try {
- HttpResponse response = httpClient.execute(getRequest);
- getCorrelationIdFromResponse(response).ifPresent(this::informAboutPnfReadyIfCorrelationIdFound);
- } catch (IOException e) {
- LOGGER.error("Exception caught during sending rest request to dmaap for listening event topic", e);
- }
- }
-
@Override
public synchronized void registerForUpdate(String correlationId, Runnable informConsumer) {
pnfCorrelationIdToThreadMap.put(correlationId, informConsumer);
@@ -98,7 +86,7 @@ public class PnfEventReadyConsumer implements DmaapClient {
private synchronized void startDmaapThreadListener() {
if (!dmaapThreadListenerIsRunning) {
executor = Executors.newScheduledThreadPool(1);
- executor.scheduleWithFixedDelay(this::sendRequest, 0,
+ executor.scheduleWithFixedDelay(new DmaapTopicListenerThread(), 0,
dmaapClientDelayInSeconds, TimeUnit.SECONDS);
dmaapThreadListenerIsRunning = true;
}
@@ -120,24 +108,6 @@ public class PnfEventReadyConsumer implements DmaapClient {
.path(consumerGroup).path(consumerId).build();
}
- private Optional<String> getCorrelationIdFromResponse(HttpResponse response) throws IOException {
- if (response.getStatusLine().getStatusCode() == 200) {
- String responseString = EntityUtils.toString(response.getEntity(), "UTF-8");
- if (responseString != null) {
- return JsonPathUtil.getInstance().locateResult(responseString, JSON_PATH_CORRELATION_ID);
- }
- }
- return Optional.empty();
- }
-
-
- private synchronized void informAboutPnfReadyIfCorrelationIdFound(String correlationId) {
- Runnable runnable = unregister(correlationId);
- if (runnable != null) {
- runnable.run();
- }
- }
-
public void setDmaapHost(String dmaapHost) {
this.dmaapHost = dmaapHost;
}
@@ -170,4 +140,34 @@ public class PnfEventReadyConsumer implements DmaapClient {
this.dmaapClientDelayInSeconds = dmaapClientDelayInSeconds;
}
+ class DmaapTopicListenerThread implements Runnable {
+
+ @Override
+ public void run() {
+ try {
+ HttpResponse response = httpClient.execute(getRequest);
+ getCorrelationIdFromResponse(response).ifPresent(this::informAboutPnfReadyIfCorrelationIdFound);
+ } catch (IOException e) {
+ LOGGER.error("Exception caught during sending rest request to dmaap for listening event topic", e);
+ }
+ }
+
+ private Optional<String> getCorrelationIdFromResponse(HttpResponse response) throws IOException {
+ if (response.getStatusLine().getStatusCode() == 200) {
+ String responseString = EntityUtils.toString(response.getEntity(), "UTF-8");
+ if (responseString != null) {
+ return JsonPathUtil.getInstance().locateResult(responseString, JSON_PATH_CORRELATION_ID);
+ }
+ }
+ return Optional.empty();
+ }
+
+ private synchronized void informAboutPnfReadyIfCorrelationIdFound(String correlationId) {
+ Runnable runnable = unregister(correlationId);
+ if (runnable != null) {
+ runnable.run();
+ }
+ }
+ }
+
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn
index 46555cf2d4..c074571265 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn
@@ -14,7 +14,7 @@ def dcsi = new CreateSDNCNetworkResource()
dcsi.prepareSDNCRequest(execution)]]></bpmn:script>
</bpmn:scriptTask>
<bpmn:endEvent id="EndEvent_1x6k78c" name="create SDNC call end">
- <bpmn:incoming>SequenceFlow_0ow44q0</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_17md60u</bpmn:incoming>
</bpmn:endEvent>
<bpmn:callActivity id="CallActivity_1600xlj" name="Call SDNC RSRC Create&#10; Adapter V1&#10;" calledElement="sdncAdapter">
<bpmn:extensionElements>
@@ -31,7 +31,7 @@ dcsi.prepareSDNCRequest(execution)]]></bpmn:script>
<bpmn:outgoing>SequenceFlow_1xk5xed</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:sequenceFlow id="SequenceFlow_1xk5xed" sourceRef="CallActivity_1600xlj" targetRef="Task_0uwlr22" />
- <bpmn:sequenceFlow id="SequenceFlow_0ow44q0" sourceRef="Task_023hred" targetRef="EndEvent_1x6k78c" />
+ <bpmn:sequenceFlow id="SequenceFlow_0ow44q0" sourceRef="Task_023hred" targetRef="ScriptTask_1g5zyi6" />
<bpmn:scriptTask id="Task_023hred" name="post SDNC create call">
<bpmn:incoming>SequenceFlow_1vnx1pp</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0ow44q0</bpmn:outgoing>
@@ -117,6 +117,14 @@ dcsi.prepareUpdateAfterCreateSDNCResource(execution)]]></bpmn:script>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_1jr6zi0" sourceRef="Task_0uwlr22" targetRef="ServiceTask_1cm8iwr" />
<bpmn:sequenceFlow id="SequenceFlow_1vnx1pp" sourceRef="ServiceTask_1cm8iwr" targetRef="Task_023hred" />
+ <bpmn:scriptTask id="ScriptTask_1g5zyi6" name="Send Sync Ack Response" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_0ow44q0</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_17md60u</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def csi = new CreateSDNCNetworkResource()
+csi.sendSyncResponse(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_17md60u" sourceRef="ScriptTask_1g5zyi6" targetRef="EndEvent_1x6k78c" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CreateSDNCNetworkResource">
@@ -145,9 +153,9 @@ dcsi.prepareUpdateAfterCreateSDNCResource(execution)]]></bpmn:script>
<dc:Bounds x="313" y="89" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c">
- <dc:Bounds x="875" y="317" width="36" height="36" />
+ <dc:Bounds x="1040" y="317" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="836" y="359" width="86" height="24" />
+ <dc:Bounds x="1004" y="359" width="81" height="28" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_1600xlj_di" bpmnElement="CallActivity_1600xlj">
@@ -162,9 +170,9 @@ dcsi.prepareUpdateAfterCreateSDNCResource(execution)]]></bpmn:script>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0ow44q0_di" bpmnElement="SequenceFlow_0ow44q0">
<di:waypoint xsi:type="dc:Point" x="795" y="335" />
- <di:waypoint xsi:type="dc:Point" x="875" y="335" />
+ <di:waypoint xsi:type="dc:Point" x="856" y="335" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="790" y="314" width="90" height="12" />
+ <dc:Bounds x="780.5" y="314" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0gyej62_di" bpmnElement="Task_023hred">
@@ -235,6 +243,16 @@ dcsi.prepareUpdateAfterCreateSDNCResource(execution)]]></bpmn:script>
<dc:Bounds x="641" y="314" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_1g5zyi6_di" bpmnElement="ScriptTask_1g5zyi6">
+ <dc:Bounds x="856" y="295" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_17md60u_di" bpmnElement="SequenceFlow_17md60u">
+ <di:waypoint xsi:type="dc:Point" x="956" y="335" />
+ <di:waypoint xsi:type="dc:Point" x="1040" y="335" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="998" y="313" width="0" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteSDNCNetworkResource.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteSDNCNetworkResource.bpmn
index 7786299ab8..216b67a8bb 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteSDNCNetworkResource.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteSDNCNetworkResource.bpmn
@@ -14,7 +14,7 @@ def dcsi = new DeleteSDNCNetworkResource()
dcsi.prepareSDNCRequest(execution)]]></bpmn:script>
</bpmn:scriptTask>
<bpmn:endEvent id="EndEvent_1x6k78c" name="delete SDNC call end">
- <bpmn:incoming>SequenceFlow_0ow44q0</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_15wux6a</bpmn:incoming>
</bpmn:endEvent>
<bpmn:callActivity id="CallActivity_1600xlj" name="Call SDNC RSRC &#10; Adapter V1&#10;" calledElement="sdncAdapter">
<bpmn:extensionElements>
@@ -31,7 +31,7 @@ dcsi.prepareSDNCRequest(execution)]]></bpmn:script>
<bpmn:outgoing>SequenceFlow_1xk5xed</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:sequenceFlow id="SequenceFlow_1xk5xed" sourceRef="CallActivity_1600xlj" targetRef="Task_0uwlr22" />
- <bpmn:sequenceFlow id="SequenceFlow_0ow44q0" sourceRef="Task_023hred" targetRef="EndEvent_1x6k78c" />
+ <bpmn:sequenceFlow id="SequenceFlow_0ow44q0" sourceRef="Task_023hred" targetRef="ScriptTask_1emjxm2" />
<bpmn:scriptTask id="Task_023hred" name="post SDNC delete call">
<bpmn:incoming>SequenceFlow_1vnx1pp</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0ow44q0</bpmn:outgoing>
@@ -117,6 +117,14 @@ dcsi.prepareUpdateAfterDeleteSDNCResource(execution)]]></bpmn:script>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_1jr6zi0" sourceRef="Task_0uwlr22" targetRef="ServiceTask_1cm8iwr" />
<bpmn:sequenceFlow id="SequenceFlow_1vnx1pp" sourceRef="ServiceTask_1cm8iwr" targetRef="Task_023hred" />
+ <bpmn:scriptTask id="ScriptTask_1emjxm2" name="Send Sync Ack Response" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_0ow44q0</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_15wux6a</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def csi = new DeleteSDNCNetworkResource()
+csi.sendSyncResponse(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_15wux6a" sourceRef="ScriptTask_1emjxm2" targetRef="EndEvent_1x6k78c" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteSDNCNetworkResource">
@@ -145,9 +153,9 @@ dcsi.prepareUpdateAfterDeleteSDNCResource(execution)]]></bpmn:script>
<dc:Bounds x="313" y="89" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c">
- <dc:Bounds x="875" y="317" width="36" height="36" />
+ <dc:Bounds x="967" y="317" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="841" y="359" width="79" height="28" />
+ <dc:Bounds x="933" y="359" width="79" height="28" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_1600xlj_di" bpmnElement="CallActivity_1600xlj">
@@ -161,14 +169,14 @@ dcsi.prepareUpdateAfterDeleteSDNCResource(execution)]]></bpmn:script>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0ow44q0_di" bpmnElement="SequenceFlow_0ow44q0">
- <di:waypoint xsi:type="dc:Point" x="795" y="335" />
- <di:waypoint xsi:type="dc:Point" x="875" y="335" />
+ <di:waypoint xsi:type="dc:Point" x="735" y="335" />
+ <di:waypoint xsi:type="dc:Point" x="793" y="335" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="790" y="314" width="90" height="12" />
+ <dc:Bounds x="719" y="314" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0gyej62_di" bpmnElement="Task_023hred">
- <dc:Bounds x="695" y="295" width="100" height="80" />
+ <dc:Bounds x="635" y="295" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0w2es8j_di" bpmnElement="SequenceFlow_0w2es8j">
<di:waypoint xsi:type="dc:Point" x="90" y="129" />
@@ -230,9 +238,19 @@ dcsi.prepareUpdateAfterDeleteSDNCResource(execution)]]></bpmn:script>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1vnx1pp_di" bpmnElement="SequenceFlow_1vnx1pp">
<di:waypoint xsi:type="dc:Point" x="587" y="335" />
- <di:waypoint xsi:type="dc:Point" x="695" y="335" />
+ <di:waypoint xsi:type="dc:Point" x="635" y="335" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="566" y="314" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_1emjxm2_di" bpmnElement="ScriptTask_1emjxm2">
+ <dc:Bounds x="793" y="295" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_15wux6a_di" bpmnElement="SequenceFlow_15wux6a">
+ <di:waypoint xsi:type="dc:Point" x="893" y="335" />
+ <di:waypoint xsi:type="dc:Point" x="967" y="335" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="641" y="314" width="0" height="12" />
+ <dc:Bounds x="930" y="313" width="0" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateCustomE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateCustomE2EServiceInstance.bpmn
index ae84d894c0..b33187852f 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateCustomE2EServiceInstance.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateCustomE2EServiceInstance.bpmn
@@ -44,6 +44,7 @@ ex.processJavaException(execution)]]></bpmn:script>
<camunda:in source="serviceDecomposition_Original" target="serviceDecomposition_Original" />
<camunda:in source="addResourceList" target="addResourceList" />
<camunda:in source="delResourceList" target="delResourceList" />
+ <camunda:in source="serviceRelationShip" target="serviceRelationShip" />
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_04qwbbf</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0klbpxx</bpmn:outgoing>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoUpdateE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoUpdateE2EServiceInstance.bpmn
index 067012e675..35cd0399cf 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoUpdateE2EServiceInstance.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoUpdateE2EServiceInstance.bpmn
@@ -240,11 +240,10 @@ dcsi.preProcessAAIPUT(execution)]]></bpmn2:script>
<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>
@@ -252,15 +251,11 @@ dcsi.preProcessAAIPUT(execution)]]></bpmn2:script>
<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" />
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/webapp/WEB-INF/applicationContext.xml b/bpmn/MSOInfrastructureBPMN/src/main/webapp/WEB-INF/applicationContext.xml
index 4ddeba16be..13ab4f8f17 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/webapp/WEB-INF/applicationContext.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/main/webapp/WEB-INF/applicationContext.xml
@@ -15,14 +15,14 @@
</bean>
<bean id="informDmaapClient" class="org.openecomp.mso.bpmn.infrastructure.pnf.delegate.InformDmaapClient">
- <property name="dmaapClient" ref="pnfEventReadyConsumer"/>
+ <property name="dmaapClient" ref="pnfEventReadyDmaapClient"/>
</bean>
<bean id="cancelDmaapSubscription" class="org.openecomp.mso.bpmn.infrastructure.pnf.delegate.CancelDmaapSubscription">
- <property name="dmaapClient" ref="pnfEventReadyConsumer"/>
+ <property name="dmaapClient" ref="pnfEventReadyDmaapClient"/>
</bean>
- <bean id="pnfEventReadyConsumer" class="org.openecomp.mso.bpmn.infrastructure.pnf.dmaap.PnfEventReadyConsumer"
+ <bean id="pnfEventReadyDmaapClient" class="org.openecomp.mso.bpmn.infrastructure.pnf.dmaap.PnfEventReadyDmaapClient"
init-method="init">
<property name="dmaapHost" value="${host}"/>
<property name="dmaapPort" value="${port}"/>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyConsumerTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java
index 73b8247ebc..393730ed43 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyConsumerTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java
@@ -43,8 +43,9 @@ import org.apache.http.message.BasicHttpResponse;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
+import org.openecomp.mso.bpmn.infrastructure.pnf.dmaap.PnfEventReadyDmaapClient.DmaapTopicListenerThread;
-public class PnfEventReadyConsumerTest {
+public class PnfEventReadyDmaapClientTest {
private static final String CORRELATION_ID = "corrTestId";
private static final String CORRELATION_ID_NOT_FOUND_IN_MAP = "otherCorrId";
@@ -61,14 +62,15 @@ public class PnfEventReadyConsumerTest {
private static final String CONSUMER_ID = "consumerTestId";
private static final String CONSUMER_GROUP = "consumerGroupTest";
- private PnfEventReadyConsumer testedObject;
+ private PnfEventReadyDmaapClient testedObject;
+ private DmaapTopicListenerThread testedObjectInnerClassThread;
private HttpClient httpClientMock;
private Runnable threadMockToNotifyCamundaFlow;
private ScheduledExecutorService executorMock;
@Before
public void init() throws NoSuchFieldException, IllegalAccessException {
- testedObject = new PnfEventReadyConsumer();
+ testedObject = new PnfEventReadyDmaapClient();
testedObject.setDmaapHost(HOST);
testedObject.setDmaapPort(PORT);
testedObject.setDmaapProtocol(PROTOCOL);
@@ -78,6 +80,7 @@ public class PnfEventReadyConsumerTest {
testedObject.setConsumerGroup(CONSUMER_GROUP);
testedObject.setDmaapClientDelayInSeconds(1);
testedObject.init();
+ testedObjectInnerClassThread = testedObject.new DmaapTopicListenerThread();
httpClientMock = mock(HttpClient.class);
threadMockToNotifyCamundaFlow = mock(Runnable.class);
executorMock = mock(ScheduledExecutorService.class);
@@ -96,7 +99,7 @@ public class PnfEventReadyConsumerTest {
throws IOException {
when(httpClientMock.execute(any(HttpGet.class))).
thenReturn(createResponse(String.format(JSON_EXAMPLE_WITH_CORRELATION_ID, CORRELATION_ID)));
- testedObject.sendRequest();
+ testedObjectInnerClassThread.run();
ArgumentCaptor<HttpGet> captor1 = ArgumentCaptor.forClass(HttpGet.class);
verify(httpClientMock).execute(captor1.capture());
assertThat(captor1.getValue().getURI()).hasHost(HOST).hasPort(PORT).hasScheme(PROTOCOL)
@@ -119,7 +122,7 @@ public class PnfEventReadyConsumerTest {
when(httpClientMock.execute(any(HttpGet.class))).
thenReturn(createResponse(
String.format(JSON_EXAMPLE_WITH_CORRELATION_ID, CORRELATION_ID_NOT_FOUND_IN_MAP)));
- testedObject.sendRequest();
+ testedObjectInnerClassThread.run();
verifyZeroInteractions(threadMockToNotifyCamundaFlow, executorMock);
}
@@ -133,7 +136,7 @@ public class PnfEventReadyConsumerTest {
public void correlationIdIsNotFoundInHttpResponse() throws IOException {
when(httpClientMock.execute(any(HttpGet.class))).
thenReturn(createResponse(JSON_EXAMPLE_WITH_NO_CORRELATION_ID));
- testedObject.sendRequest();
+ testedObjectInnerClassThread.run();
verifyZeroInteractions(threadMockToNotifyCamundaFlow, executorMock);
}