summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java7
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java27
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateVcpeResCustService.bpmn3
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVnfAndModules.bpmn11
4 files changed, 46 insertions, 2 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
index 503de0429e..bcc2e15a7d 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
@@ -686,6 +686,13 @@ public class ASDCController {
try {
this.processCsarServiceArtifacts(iNotif, toscaResourceStructure);
+ IArtifactInfo iArtifact = toscaResourceStructure.getToscaArtifact();
+ String filePath = System.getProperty("mso.config.path") + "/ASDC/" + iArtifact.getArtifactVersion() + "/" + iArtifact.getArtifactName();
+ File csarFile = new File(filePath);
+ String csarFilePath = csarFile.getAbsolutePath();
+ if (bpmnInstaller.containsWorkflows(csarFilePath)) {
+ bpmnInstaller.installBpmn(csarFilePath);
+ }
for (IResourceInstance resource : iNotif.getResources()){
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java
index f131b73175..0fde1332d6 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java
@@ -23,6 +23,7 @@ package org.onap.so.asdc.installer.bpmn;
import java.io.*;
import java.nio.file.Path;
import java.nio.file.Paths;
+import java.util.Enumeration;
import java.util.zip.*;
import org.apache.commons.io.IOUtils;
@@ -105,6 +106,30 @@ public class BpmnInstaller {
}
return;
}
+
+ public boolean containsWorkflows(String csarFilePath) {
+ boolean workflowsInCsar = false;
+ try {
+ ZipFile zipFile = new ZipFile(csarFilePath);
+ Enumeration<? extends ZipEntry> zipEntries = zipFile.entries();
+ while (zipEntries.hasMoreElements()) {
+ String fileName = ((ZipEntry) zipEntries.nextElement()).getName();
+ if (fileName.endsWith(BPMN_SUFFIX)) {
+ workflowsInCsar = true;
+ break;
+ }
+ }
+ }
+ catch (Exception e) {
+ LOGGER.debug("Exception :",e);
+ LOGGER.error(MessageEnum.ASDC_ARTIFACT_CHECK_EXC,
+ csarFilePath,
+ "",
+ "",
+ e.getMessage(), "", "", MsoLogger.ErrorCode.DataError, "ASDC Unable to check CSAR entries");
+ }
+ return workflowsInCsar;
+ }
protected HttpResponse sendDeploymentRequest(String bpmnFileName) throws Exception {
HttpClient client = HttpClientBuilder.create().build();
@@ -149,6 +174,8 @@ public class BpmnInstaller {
.setField("Content-Disposition", String.format("form-data; name=\"%s\"; filename=\"%s\"; size=%d", bpmnFileName, bpmnFileName, bytesToSend.length))
.build())
.build();
+
+ IOUtils.closeQuietly(bpmnFileStream);
return requestEntity;
}
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateVcpeResCustService.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateVcpeResCustService.bpmn
index 7413e6df83..54f0947d29 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateVcpeResCustService.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateVcpeResCustService.bpmn
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.11.3" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="CreateVcpeResCustService" name="CreateVcpeResCustService" isExecutable="true">
<bpmn2:scriptTask id="sendSyncAckResponse_ScriptTask" name="Send Sync Ack Response" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_7</bpmn2:incoming>
@@ -518,6 +518,7 @@ CreateVcpeResCustService.prepareCreateAllottedResourceBRG(execution)]]></bpmn2:s
<camunda:in source="serviceModelInfo" target="serviceModelInfo" />
<camunda:in source="globalSubscriberId" target="globalSubscriberId" />
<camunda:in source="serviceDecomposition" target="serviceDecomposition" />
+ <camunda:in source="vfModuleNames" target="vfModuleNames" />
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_0ws7fjn</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_1mkdhw9</bpmn2:outgoing>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVnfAndModules.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVnfAndModules.bpmn
index dec841c021..016aaa20d2 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVnfAndModules.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVnfAndModules.bpmn
@@ -134,6 +134,7 @@ doCreateVnfAndModules.validateAddOnModule(execution)]]></bpmn:script>
<camunda:in source="vnfResourceDecomposition" target="vnfResourceDecomposition" />
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_19ohb1a</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0oxfrrr</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:scriptTask id="PreProcessAddOnModule" name="PreProcess Add-On Module" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_0jz6bqn</bpmn:incoming>
@@ -251,7 +252,7 @@ doCreateVnfAndModules.postProcessAddOnModule(execution)]]></bpmn:script>
<bpmn:sequenceFlow id="SequenceFlow_1t407j7" sourceRef="Task_1mrb29r" targetRef="Task_0qrf3e8" />
<bpmn:sequenceFlow id="SequenceFlow_0baw1tl" sourceRef="Task_0qrf3e8" targetRef="ExclusiveGateway_06ccv8x" />
<bpmn:scriptTask id="Task_1mrb29r" name="Create Platform" scriptFormat="groovy">
- <bpmn:incoming>SequenceFlow_07u8e3l</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_0oxfrrr</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1t407j7</bpmn:outgoing>
<bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
def doCreateVnfAndModules = new DoCreateVnfAndModules()
@@ -283,6 +284,7 @@ doCreateVnfAndModules.createLineOfBusiness(execution)]]></bpmn:script>
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("addOnVfModuleName") == null}]]></bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="SequenceFlow_12ffqm1" name="no" sourceRef="ExclusiveGateway_03anzqd" targetRef="CreateAddOnVfModule" />
+ <bpmn:sequenceFlow id="SequenceFlow_0oxfrrr" sourceRef="CreateVNF" targetRef="Task_1mrb29r" />
</bpmn:process>
<bpmn:error id="Error_1" name="Java Lang Exception" errorCode="java.lang.Exception" />
<bpmn:error id="Error_2" name="MSO Workflow Exception" errorCode="MSOWorkflowException" />
@@ -576,6 +578,13 @@ doCreateVnfAndModules.createLineOfBusiness(execution)]]></bpmn:script>
<dc:Bounds x="2055" y="76" width="15" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0oxfrrr_di" bpmnElement="SequenceFlow_0oxfrrr">
+ <di:waypoint xsi:type="dc:Point" x="674" y="165" />
+ <di:waypoint xsi:type="dc:Point" x="742" y="165" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="708" y="144" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>