diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-01-11 21:54:58 -0500 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-01-11 21:55:51 -0500 |
commit | cd85fa3ff3322c0990430efe55dedc2f7577ee6b (patch) | |
tree | 95c7d8c2694cd8eca5a305a98e55974a2d375e51 /bpmn/so-bpmn-tasks/src/main | |
parent | de5958dddd97b086ec8b603974f434fd814386ac (diff) |
Miscellaneous fixes
updated common pom to use aai schema version 1.4.1
removed handle sync error from SDNCHandler bpmn flow
added mso-request-id to in mapping of delete vnf flows
moved temporary test file to temporary folder
Removed obsolete genericVnfNode parameter from updateGenericVnfNode
sorted vfmodules by base last for negative action reqs
Change-Id: I7a5018d67292cfaac8d923ac3bd9b27ed037be57
Issue-ID: SO-1382
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java | 20 |
1 files changed, 19 insertions, 1 deletions
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 10ee13ebed..50f2091ae2 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 @@ -344,6 +344,18 @@ public class WorkflowAction { } return vfModuleResources; } + + protected List<Resource> sortVfModulesByBaseLast(List<Resource> vfModuleResources) { + int count = 0; + for(Resource resource : vfModuleResources){ + if(resource.isBaseVfModule()){ + Collections.swap(vfModuleResources, vfModuleResources.size()-1, count); + break; + } + count++; + } + return vfModuleResources; + } private void updateResourceIdsFromAAITraversal(List<ExecuteBuildingBlock> flowsToExecute, List<Resource> resourceCounter, List<Pair<WorkflowType, String>> aaiResourceIds, String serviceInstanceId) { @@ -969,8 +981,14 @@ public class WorkflowAction { requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails, true, resource.getVirtualLinkKey(), false)); } } else if (orchFlow.getFlowName().contains(VFMODULE)) { - List<Resource> vfModuleResourcesSorted = sortVfModulesByBaseFirst(resourceCounter.stream().filter(x -> WorkflowType.VFMODULE == x.getResourceType()) + List<Resource> vfModuleResourcesSorted = null; + if(requestAction.equals("createInstance")||requestAction.equals("assignInstance")||requestAction.equals("activateInstance")){ + vfModuleResourcesSorted = sortVfModulesByBaseFirst(resourceCounter.stream().filter(x -> WorkflowType.VFMODULE == x.getResourceType()) .collect(Collectors.toList())); + }else{ + vfModuleResourcesSorted = sortVfModulesByBaseLast(resourceCounter.stream().filter(x -> WorkflowType.VFMODULE == x.getResourceType()) + .collect(Collectors.toList())); + } for (int i = 0; i < vfModuleResourcesSorted.size(); i++) { flowsToExecute.add(buildExecuteBuildingBlock(orchFlow, requestId, vfModuleResourcesSorted.get(i), apiVersion, resourceId, requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails, false, null, false)); |