aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy12
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn26
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVnf.bpmn4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json3
7 files changed, 27 insertions, 26 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy
index d17a3c42a6..623d5a67e3 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy
@@ -36,9 +36,11 @@ import org.onap.so.client.HttpClient
import org.onap.so.client.HttpClientFactory
import org.slf4j.Logger
import org.slf4j.LoggerFactory
+import org.onap.so.db.catalog.beans.AuthenticationType
import org.onap.so.db.catalog.beans.CloudIdentity
import org.onap.so.db.catalog.beans.CloudSite
import org.onap.so.db.catalog.beans.HomingInstance
+import org.onap.so.db.catalog.beans.ServerType
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.utils.TargetEntity
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy
index a40bf59097..ebab6ad0ac 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy
@@ -226,6 +226,8 @@ public class UpdateAAIGenericVnf extends AbstractServiceTaskProcessor {
try {
getAAIClient().update(uri,payload)
+ execution.setVariable('UAAIGenVnf_updateGenericVnfResponseCode', 200)
+ execution.setVariable('UAAIGenVnf_updateGenericVnfResponse', "Success")
} catch (Exception ex) {
logger.debug('Exception occurred while executing AAI PATCH: {}', ex.getMessage(), ex)
execution.setVariable('UAAIGenVnf_updateGenericVnfResponseCode', 500)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy
index 261f107140..f06d71cec4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy
@@ -38,18 +38,26 @@ public class HandlePNF extends AbstractServiceTaskProcessor{
@Override
void preProcessRequest(DelegateExecution execution) {
logger.debug("Start preProcess for HandlePNF")
-
// set correlation ID
def resourceInput = execution.getVariable("resourceInput")
String serInput = jsonUtil.getJsonValue(resourceInput, "requestsInputs")
String correlationId = jsonUtil.getJsonValue(serInput, "service.parameters.requestInputs.ont_ont_pnf_name")
if (!StringUtils.isEmpty(correlationId)) {
- execution.setVariable(ExecutionVariableNames.CORRELATION_ID, correlationId)
+ execution.setVariable(ExecutionVariableNames.PNF_CORRELATION_ID, correlationId)
logger.debug("Found correlation id : " + correlationId)
} else {
logger.error("== correlation id is empty ==")
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "correlation id is not provided")
}
+
+ String serviceInstanceID = jsonUtil.getJsonValue(resourceInput, ExecutionVariableNames.SERVICE_INSTANCE_ID)
+ if (!StringUtils.isEmpty(serviceInstanceID)) {
+ execution.setVariable(ExecutionVariableNames.SERVICE_INSTANCE_ID, serviceInstanceID)
+ logger.debug("found serviceInstanceID: "+serviceInstanceID)
+ } else {
+ logger.error("== serviceInstance ID is empty ==")
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "serviceInstance ID is not provided")
+ }
// next task will set the uuid
logger.debug("exit preProcess for HandlePNF")
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn
index c81b289737..257a0dee64 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn
@@ -1,19 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.16.2">
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4">
<bpmn:process id="HandlePNF" name="HandlePNF" isExecutable="true">
<bpmn:startEvent id="createNS_StartEvent_pnf_disc" name="start PNF handling">
<bpmn:outgoing>SequenceFlow_1c92ks3_activate</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:scriptTask id="Task_13sx2bp_activate" name="Pre Process Request" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_1c92ks3_activate</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_17xr584</bpmn:outgoing>
<bpmn:outgoing>SequenceFlow_12q67gd</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def handlePNF = new HandlePNF()
handlePNF.preProcessRequest(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="SequenceFlow_1c92ks3_activate" sourceRef="createNS_StartEvent_pnf_disc" targetRef="Task_13sx2bp_activate" />
- <bpmn:sequenceFlow id="SequenceFlow_17xr584" sourceRef="Task_13sx2bp_activate" targetRef="Task_0kv28gm" />
<bpmn:sequenceFlow id="SequenceFlow_0pujwl4" sourceRef="Task_0657l04" targetRef="PostProcessPNFDiscovery" />
<bpmn:endEvent id="EndEvent_0pigsdfk3" name="end PNF hadler">
<bpmn:incoming>SequenceFlow_02fi1yn</bpmn:incoming>
@@ -21,8 +19,10 @@ handlePNF.preProcessRequest(execution)</bpmn:script>
<bpmn:sequenceFlow id="SequenceFlow_1la8oih" sourceRef="PostProcessPNFDiscovery" targetRef="Task_1r8h7of" />
<bpmn:callActivity id="Task_0657l04" name="invoke pnf handler" calledElement="CreateAndActivatePnfResource">
<bpmn:extensionElements>
- <camunda:in source="correlationId" target="correlationId" />
+ <camunda:in source="pnfCorrelationId" target="pnfCorrelationId" />
<camunda:in source="pnfUuid" target="pnfUuid" />
+ <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
+ <camunda:in businessKey="#{execution.processBusinessKey}" />
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_1apj1fn</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0pujwl4</bpmn:outgoing>
@@ -30,7 +30,6 @@ handlePNF.preProcessRequest(execution)</bpmn:script>
<bpmn:scriptTask id="PostProcessPNFDiscovery" name="Post Process Request" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_0pujwl4</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1la8oih</bpmn:outgoing>
- <bpmn:outgoing>SequenceFlow_1ezf4gu</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def handlePNF = new HandlePNF()
handlePNF.postProcessRequest(execution)</bpmn:script>
@@ -39,13 +38,10 @@ handlePNF.postProcessRequest(execution)</bpmn:script>
<bpmn:sequenceFlow id="SequenceFlow_1apj1fn" sourceRef="Task_0kv28gm" targetRef="Task_0657l04" />
<bpmn:serviceTask id="Task_0kv28gm" name="Generate PNF uuid" camunda:delegateExpression="${GeneratePnfUuidDelegate}">
<bpmn:incoming>SequenceFlow_12q67gd</bpmn:incoming>
- <bpmn:incoming>SequenceFlow_17xr584</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1apj1fn</bpmn:outgoing>
</bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_1ezf4gu" sourceRef="PostProcessPNFDiscovery" targetRef="Task_1r8h7of" />
<bpmn:sequenceFlow id="SequenceFlow_02fi1yn" sourceRef="Task_1r8h7of" targetRef="EndEvent_0pigsdfk3" />
<bpmn:scriptTask id="Task_1r8h7of" name="Send Sync Response" scriptFormat="groovy">
- <bpmn:incoming>SequenceFlow_1ezf4gu</bpmn:incoming>
<bpmn:incoming>SequenceFlow_1la8oih</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_02fi1yn</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
@@ -68,10 +64,6 @@ handlePNF.sendSyncResponse(execution)</bpmn:script>
<di:waypoint x="-428" y="324" />
<di:waypoint x="-341" y="324" />
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_17xr584_di" bpmnElement="SequenceFlow_17xr584">
- <di:waypoint x="-241" y="324" />
- <di:waypoint x="-180" y="324" />
- </bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0pujwl4_di" bpmnElement="SequenceFlow_0pujwl4">
<di:waypoint x="81" y="324" />
<di:waypoint x="156" y="324" />
@@ -94,19 +86,15 @@ handlePNF.sendSyncResponse(execution)</bpmn:script>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_12q67gd_di" bpmnElement="SequenceFlow_12q67gd">
<di:waypoint x="-241" y="324" />
- <di:waypoint x="-180" y="324" />
+ <di:waypoint x="-176" y="324" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1apj1fn_di" bpmnElement="SequenceFlow_1apj1fn">
- <di:waypoint x="-80" y="324" />
+ <di:waypoint x="-76" y="324" />
<di:waypoint x="-19" y="324" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_1y3h50n_di" bpmnElement="Task_0kv28gm">
- <dc:Bounds x="-180" y="284" width="100" height="80" />
+ <dc:Bounds x="-176" y="284" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1ezf4gu_di" bpmnElement="SequenceFlow_1ezf4gu">
- <di:waypoint x="256" y="324" />
- <di:waypoint x="353" y="324" />
- </bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_02fi1yn_di" bpmnElement="SequenceFlow_02fi1yn">
<di:waypoint x="453" y="324" />
<di:waypoint x="543" y="324" />
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVnf.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVnf.bpmn
index 50436352ea..df95cf0210 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVnf.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVnf.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="_DkzPAHB4EeaJwpcpVN5gXw" 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: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="_DkzPAHB4EeaJwpcpVN5gXw" 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:process id="DoCreateVnf" name="DoCreateVnf" isExecutable="true">
<bpmn2:startEvent id="StartEvent_1">
<bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
@@ -90,7 +90,7 @@ createVnf.preProcessSDNCActivateRequest(execution)]]></bpmn2:script>
<bpmn2:extensionElements>
<camunda:in source="DoCVNF_activateSDNCRequest" target="sdncAdapterWorkflowRequest" />
<camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
- <camunda:in source="mso-reqeuest-id" target="mso-request-id" />
+ <camunda:in source="mso-request-id" target="mso-request-id" />
<camunda:in source="mso-service-instance-id" target="mso-service-instance-id" />
<camunda:out source="WorkflowException" target="WorkflowException" />
<camunda:out source="sdncAdapterResponse" target="DoCVNF_activateSDNCAdapterResponse" />
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
index e8171ac834..bba8064f7c 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
@@ -175,7 +175,7 @@ public class WorkflowSpecificationsHandler {
private List<WorkflowInputParameter> buildWorkflowInputParameters(Workflow workflow) {
List<WorkflowActivitySpecSequence> workflowActivitySpecSequences = workflow.getWorkflowActivitySpecSequence();
if (workflowActivitySpecSequences == null || workflowActivitySpecSequences.size() == 0) {
- return null;
+ return new ArrayList<WorkflowInputParameter>();
}
Map<String, WorkflowInputParameter> workflowInputParameterMap = new HashMap<String, WorkflowInputParameter>();
for (WorkflowActivitySpecSequence workflowActivitySpecSequence : workflowActivitySpecSequences) {
@@ -199,7 +199,7 @@ public class WorkflowSpecificationsHandler {
}
if (workflowInputParameterMap.size() == 0) {
- return null;
+ return new ArrayList<WorkflowInputParameter>();
}
List<WorkflowInputParameter> workflowInputParameterList =
workflowInputParameterMap.values().stream().collect(Collectors.toList());
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json
index 545fbbe26c..59bc12d92d 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json
@@ -122,7 +122,8 @@
"operationName": "inPlaceSoftwareUpdate",
"workflowSource": "native",
"workflowResourceTarget": "vnf"
- }
+ },
+ "workflowInputParameters": []
}
}
]