diff options
author | Steve Smokowski <ss835w@att.com> | 2019-12-10 13:28:08 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-12-10 13:28:08 +0000 |
commit | 15b9f3c6cbb69a243e4fd98add2cc2aebe83daf4 (patch) | |
tree | 073879f018f9b314ea07af323b98be727aa16ad8 /bpmn/so-bpmn-tasks/src/main | |
parent | 2ded41a112f4a70b4488b5887ba366d159ea76a4 (diff) | |
parent | 9eab6407fe2982fe0d38feb7fa7637d8917aea90 (diff) |
Merge "serviceinstanceid being overwritten by vnfid in"
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 | 16 |
1 files changed, 12 insertions, 4 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 b5b1f5db2f..58bf17f08b 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 @@ -335,8 +335,14 @@ public class WorkflowAction { orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte, cloudOwner, serviceType); } - flowsToExecute = buildExecuteBuildingBlockList(orchFlows, resourceCounter, requestId, apiVersion, - resourceId, requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails); + boolean vnfReplace = false; + if (resourceType.equals(WorkflowType.VNF) && ("replaceInstance".equalsIgnoreCase(requestAction) + || "replaceInstanceRetainAssignments".equalsIgnoreCase(requestAction))) { + vnfReplace = true; + } + flowsToExecute = + buildExecuteBuildingBlockList(orchFlows, resourceCounter, requestId, apiVersion, resourceId, + requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails, vnfReplace); if (!resourceCounter.stream().filter(x -> WorkflowType.NETWORKCOLLECTION == x.getResourceType()) .collect(Collectors.toList()).isEmpty()) { logger.info("Sorting for Vlan Tagging"); @@ -1402,13 +1408,15 @@ public class WorkflowAction { protected List<ExecuteBuildingBlock> buildExecuteBuildingBlockList(List<OrchestrationFlow> orchFlows, List<Resource> resourceCounter, String requestId, String apiVersion, String resourceId, String requestAction, boolean aLaCarte, String vnfType, WorkflowResourceIds workflowResourceIds, - RequestDetails requestDetails) { + RequestDetails requestDetails, boolean replaceVnf) { List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>(); for (OrchestrationFlow orchFlow : orchFlows) { if (orchFlow.getFlowName().contains(SERVICE)) { for (int i = 0; i < resourceCounter.stream().filter(x -> WorkflowType.SERVICE == x.getResourceType()) .collect(Collectors.toList()).size(); i++) { - workflowResourceIds.setServiceInstanceId(resourceId); + if (!replaceVnf) { + workflowResourceIds.setServiceInstanceId(resourceId); + } flowsToExecute.add(buildExecuteBuildingBlock(orchFlow, requestId, resourceCounter.stream().filter(x -> WorkflowType.SERVICE == x.getResourceType()) .collect(Collectors.toList()).get(i), |