From 24a3f5ce8387ea861f7b8d8997d72032c18d7fb0 Mon Sep 17 00:00:00 2001 From: sanket12345 Date: Wed, 23 Feb 2022 20:36:28 +0530 Subject: CNF - Upgrade Functionality - BPMN Infra -Adding new blocking UpgradeVfModuleBB -Integrating new block in bpmn-infra wih new macro-action in catalogDB. -Changes added in Workflow to call UpgradeVfModuleBB. Issue-ID: SO-3857 Change-Id: I98f81f325a311d723f62f0a802bcd8641b9a6cbc Signed-off-by: sanket12345 Signed-off-by: Lukasz.Rajewski --- .../BuildingBlock/UpgradeVfModuleBB.bpmn | 215 +++++++++++++++++++++ .../tasks/ExecuteBuildingBlockBuilder.java | 5 + .../workflow/tasks/WorkflowAction.java | 4 + .../workflow/tasks/WorkflowActionConstants.java | 1 + 4 files changed, 225 insertions(+) create mode 100644 bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/UpgradeVfModuleBB.bpmn diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/UpgradeVfModuleBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/UpgradeVfModuleBB.bpmn new file mode 100644 index 0000000000..59bb404936 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/UpgradeVfModuleBB.bpmn @@ -0,0 +1,215 @@ + + + + + SequenceFlow_1xr6chl + + + SequenceFlow_1s4rpyp + Flow_0gbxjjk + + + SequenceFlow_1vbwdaw + + + SequenceFlow_1xr6chl + SequenceFlow_1s4rpyp + + + SequenceFlow_0rds4rj + SequenceFlow_1vbwdaw + + + SequenceFlow_15do1tu + SequenceFlow_0rds4rj + + + Flow_1c9ox62 + SequenceFlow_0xqhep5 + + + SequenceFlow_0xqhep5 + SequenceFlow_1yo6mvv + + + SequenceFlow_1yo6mvv + SequenceFlow_1i03uy2 + + + SequenceFlow_1i03uy2 + SequenceFlow_15do1tu + + + Flow_0gbxjjk + Flow_1il4743 + + + + Flow_03q6ty9 + + + Flow_1sqy91r + Flow_03q6ty9 + + + + + Flow_1sqy91r + + + + + + + + + + + Flow_1il4743 + Flow_0piytnn + + + + + + + + + + + + Flow_0piytnn + + + + + + Flow_1c9ox62 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilder.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilder.java index 920369784e..377d0bbf06 100755 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilder.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilder.java @@ -55,6 +55,7 @@ public class ExecuteBuildingBlockBuilder { private static final String VFMODULE = "VfModule"; private static final String NETWORK = "Network"; private static final String HEALTH_CHECK = "HealthCheckBB"; + private static final String UPGRADE_CNF = "UpgradeVfModuleBB"; protected List buildExecuteBuildingBlockList(List orchFlows, List originalResourceList, String requestId, String apiVersion, String resourceId, @@ -124,6 +125,10 @@ public class ExecuteBuildingBlockBuilder { && (VNF).equalsIgnoreCase(orchFlow.getBpmnScope())) { addBuildingBlockToExecuteBBList(flowsToExecute, resource, WorkflowType.VNF, orchFlow, requestId, apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, false, false); + } else if ((orchFlow.getFlowName().equalsIgnoreCase(UPGRADE_CNF)) + && (VNF).equalsIgnoreCase(orchFlow.getBpmnScope())) { + addBuildingBlockToExecuteBBList(flowsToExecute, resource, WorkflowType.VNF, orchFlow, requestId, apiVersion, + resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, false, false); } else if (orchFlow.getFlowName().contains(PNF) || (orchFlow.getFlowName().contains(CONTROLLER) && (PNF).equalsIgnoreCase(orchFlow.getBpmnScope()))) { addBuildingBlockToExecuteBBList(flowsToExecute, resource, WorkflowType.PNF, orchFlow, requestId, apiVersion, diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index 10cea171ce..ef32ac5cbb 100755 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -40,6 +40,7 @@ import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConst import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.UPDATE_INSTANCE; import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.HEALTH_CHECK; import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.WORKFLOW_ACTION_ERROR_MESSAGE; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.UPGRADE_CNF; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; @@ -303,6 +304,9 @@ public class WorkflowAction { } else if (resourceType == WorkflowType.VNF && HEALTH_CHECK.equalsIgnoreCase(requestAction)) { vnfEBBLoader.customTraverseAAIVnf(execution, resourceList, workflowResourceIds.getServiceInstanceId(), workflowResourceIds.getVnfId(), aaiResourceIds); + } else if (resourceType == WorkflowType.VNF && UPGRADE_CNF.equalsIgnoreCase(requestAction)) { + vnfEBBLoader.customTraverseAAIVnf(execution, resourceList, workflowResourceIds.getServiceInstanceId(), + workflowResourceIds.getVnfId(), aaiResourceIds); } else { buildAndThrowException(execution, "Current Macro Request is not supported"); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java index a41613982d..093bab66bf 100755 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java @@ -52,5 +52,6 @@ public final class WorkflowActionConstants { public static final String VOLUMEGROUP = "VolumeGroup"; public static final String HEALTH_CHECK = "healthCheck"; public static final String WORKFLOW_ACTION_ERROR_MESSAGE = "WorkflowActionErrorMessage"; + public static final String UPGRADE_CNF = "upgradeCnf"; } -- cgit 1.2.3-korg