fixed filter of configuration flow calls 85/62085/1
authorBenjamin, Max (mb388a) <mb388a@us.att.com>
Thu, 23 Aug 2018 12:41:08 +0000 (08:41 -0400)
committerBenjamin, Max (mb388a) <mb388a@us.att.com>
Thu, 23 Aug 2018 12:41:20 +0000 (08:41 -0400)
fix filtering of configuration flow calls

Change-Id: I80f25d1b78b7268f92cb78b70f350ede100fe35e
Issue-ID: SO-888
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java

index c6a63e1..2e4a4d0 100644 (file)
@@ -88,6 +88,7 @@ public class WorkflowAction {
        private static final String VOLUMEGROUP = "VolumeGroup";
        private static final String NETWORK = "Network";
        private static final String NETWORKCOLLECTION = "NetworkCollection";
+       private static final String CONFIGURATION = "Configuration";
        private static final String ASSIGNINSTANCE = "assignInstance";
        private static final String CREATEINSTANCE = "createInstance";
        private static final String USERPARAMSERVICE = "service";
@@ -802,6 +803,12 @@ public class WorkflowAction {
                                                        .collect(Collectors.toList()).get(i).getResourceId(), apiVersion, resourceId,
                                                        requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails, false, null));
                                }
+                       } else if (orchFlow.getFlowName().contains(CONFIGURATION)) {
+                               for (int i = 0; i < resourceCounter.stream().filter(x -> WorkflowType.CONFIGURATION == x.getResourceType()).collect(Collectors.toList()).size(); i++) {
+                                       flowsToExecute.add(buildExecuteBuildingBlock(orchFlow, requestId, resourceCounter.stream().filter(x -> WorkflowType.CONFIGURATION == x.getResourceType())
+                                                       .collect(Collectors.toList()).get(i).getResourceId(), apiVersion, resourceId,
+                                                       requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails, false, null));
+                               }
                        } else {
                                flowsToExecute.add(buildExecuteBuildingBlock(orchFlow, requestId, "", apiVersion, resourceId,
                                                requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails, false, null));
index 283f888..8de32ea 100644 (file)
@@ -427,14 +427,20 @@ public class WorkflowActionTest extends BaseTaskTest {
                orch12.setFlowName("ActivateVfModuleBB");
                orchFlows.add(orch12);
                OrchestrationFlow orch13 = new OrchestrationFlow();
-               orch13.setFlowName("ActivateVnfBB");
+               orch13.setFlowName("AssignFabricConfigurationBB");
                orchFlows.add(orch13);
                OrchestrationFlow orch14 = new OrchestrationFlow();
-               orch14.setFlowName("ActivateNetworkCollectionBB");
+               orch14.setFlowName("ActivateFabricConfigurationBB");
                orchFlows.add(orch14);
                OrchestrationFlow orch15 = new OrchestrationFlow();
-               orch15.setFlowName("ActivateServiceInstanceBB");
+               orch15.setFlowName("ActivateVnfBB");
                orchFlows.add(orch15);
+               OrchestrationFlow orch16 = new OrchestrationFlow();
+               orch16.setFlowName("ActivateNetworkCollectionBB");
+               orchFlows.add(orch16);
+               OrchestrationFlow orch17 = new OrchestrationFlow();
+               orch17.setFlowName("ActivateServiceInstanceBB");
+               orchFlows.add(orch17);
                
                Service service = new Service();
                doReturn(service).when(catalogDbClient).getServiceByID("3c40d244-808e-42ca-b09a-256d83d19d0a");