summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/main/java
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2019-02-06 21:16:05 -0500
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-02-06 21:16:18 -0500
commit8195d32a2056fcd875001c4e569242506020940a (patch)
treed3822b424af1708fa9237327e58d942763d0adf7 /bpmn/so-bpmn-tasks/src/main/java
parentd109233f1a626d5bbb299209ff94dcee3aac4693 (diff)
improve vf module logic
remove vf module from list when calculating index Change-Id: I4b88a679eb79bfac6f25a26b10671cca4cf3c48d Issue-ID: SO-1476 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main/java')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
index 4dd0147163..e2caaf2a67 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
@@ -21,7 +21,9 @@
package org.onap.so.bpmn.infrastructure.aai.tasks;
import java.util.Arrays;
+import java.util.List;
import java.util.TreeSet;
+import java.util.stream.Collectors;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.onap.so.bpmn.common.BuildingBlockExecution;
@@ -455,9 +457,10 @@ public class AAICreateTasks {
if (genericVnf != null && genericVnf.getVfModules() != null && !genericVnf.getVfModules().isEmpty()) {
+ List<VfModule> modules = genericVnf.getVfModules().stream().filter(item -> !item.getVfModuleId().equals(newVfModule.getVfModuleId())).collect(Collectors.toList());
TreeSet<Integer> moduleIndices = new TreeSet<>();
int nullIndexFound = 0;
- for (VfModule vfModule : genericVnf.getVfModules()) {
+ for (VfModule vfModule : modules) {
if (vfModule.getModelInfoVfModule() != null) {
if (vfModule.getModelInfoVfModule().getModelInvariantUUID().equals(newVfModuleModelInvariantUUID)) {
if (vfModule.getModuleIndex() != null) {