From 525416ca5d9fd84be3e2d5693f242455dbb83a39 Mon Sep 17 00:00:00 2001 From: "Kuleshov, Elena" Date: Wed, 1 Jul 2020 09:43:53 -0400 Subject: Preserve placement of Config BBs Preserve placement of Config BBs in the Replace VfModule execution list. Issue-ID: SO-3012 Signed-off-by: Benjamin, Max (mb388a) Change-Id: Ia3abd3e154a5e0e62a3dc45d74baece7cb19e63e --- .../workflow/tasks/WorkflowAction.java | 60 +++++++++++++++------- 1 file changed, 42 insertions(+), 18 deletions(-) (limited to 'bpmn/so-bpmn-tasks/src/main') 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 cc89d00e29..dd05b6b73a 100644 --- 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 @@ -221,18 +221,6 @@ public class WorkflowAction { cloudOwner, serviceType); } Resource resourceKey = getResourceKey(sIRequest, resourceType); - if (isConfiguration(orchFlows) && !requestAction.equalsIgnoreCase(CREATEINSTANCE)) { - List configBuildingBlocks = getConfigBuildingBlocks( - new ConfigBuildingBlocksDataObject().setsIRequest(sIRequest).setOrchFlows(orchFlows) - .setRequestId(requestId).setResourceKey(resourceKey).setApiVersion(apiVersion) - .setResourceId(resourceId).setRequestAction(requestAction).setaLaCarte(true) - .setVnfType(vnfType).setWorkflowResourceIds(workflowResourceIds) - .setRequestDetails(requestDetails).setExecution(execution)); - - flowsToExecute.addAll(configBuildingBlocks); - } - orchFlows = orchFlows.stream().filter(item -> !item.getFlowName().contains(FABRIC_CONFIGURATION)) - .collect(Collectors.toList()); if ((requestAction.equalsIgnoreCase(REPLACEINSTANCE) || requestAction.equalsIgnoreCase(REPLACEINSTANCERETAINASSIGNMENTS)) @@ -244,12 +232,48 @@ public class WorkflowAction { .setResourceId(resourceId).setRequestAction(requestAction).setaLaCarte(true) .setVnfType(vnfType).setWorkflowResourceIds(workflowResourceIds) .setRequestDetails(requestDetails).setExecution(execution)); - } - for (OrchestrationFlow orchFlow : orchFlows) { - ExecuteBuildingBlock ebb = buildExecuteBuildingBlock(orchFlow, requestId, resourceKey, - apiVersion, resourceId, requestAction, true, vnfType, workflowResourceIds, - requestDetails, false, null, null, false); - flowsToExecute.add(ebb); + for (OrchestrationFlow orchFlow : orchFlows) { + if (orchFlow.getFlowName().contains(CONFIGURATION)) { + List configOrchFlows = new ArrayList(); + configOrchFlows.add(orchFlow); + List configBuildingBlocks = + getConfigBuildingBlocks(new ConfigBuildingBlocksDataObject() + .setsIRequest(sIRequest).setOrchFlows(configOrchFlows) + .setRequestId(requestId).setResourceKey(resourceKey) + .setApiVersion(apiVersion).setResourceId(resourceId) + .setRequestAction(requestAction).setaLaCarte(true).setVnfType(vnfType) + .setWorkflowResourceIds(workflowResourceIds) + .setRequestDetails(requestDetails).setExecution(execution)); + flowsToExecute.addAll(configBuildingBlocks); + } else { + ExecuteBuildingBlock ebb = buildExecuteBuildingBlock(orchFlow, requestId, resourceKey, + apiVersion, resourceId, requestAction, true, vnfType, workflowResourceIds, + requestDetails, false, null, null, false); + flowsToExecute.add(ebb); + } + } + } else { + if (isConfiguration(orchFlows) && !requestAction.equalsIgnoreCase(CREATEINSTANCE)) { + List configBuildingBlocks = + getConfigBuildingBlocks(new ConfigBuildingBlocksDataObject().setsIRequest(sIRequest) + .setOrchFlows(orchFlows).setRequestId(requestId).setResourceKey(resourceKey) + .setApiVersion(apiVersion).setResourceId(resourceId) + .setRequestAction(requestAction).setaLaCarte(true).setVnfType(vnfType) + .setWorkflowResourceIds(workflowResourceIds) + .setRequestDetails(requestDetails).setExecution(execution)); + + flowsToExecute.addAll(configBuildingBlocks); + } + orchFlows = + orchFlows.stream().filter(item -> !item.getFlowName().contains(FABRIC_CONFIGURATION)) + .collect(Collectors.toList()); + + for (OrchestrationFlow orchFlow : orchFlows) { + ExecuteBuildingBlock ebb = buildExecuteBuildingBlock(orchFlow, requestId, resourceKey, + apiVersion, resourceId, requestAction, true, vnfType, workflowResourceIds, + requestDetails, false, null, null, false); + flowsToExecute.add(ebb); + } } } else { boolean foundRelated = false; -- cgit 1.2.3-korg