diff options
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java | 14 |
1 files changed, 12 insertions, 2 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 dad84e53a9..279957ca1e 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 @@ -28,6 +28,7 @@ import java.util.Optional; import java.util.TreeSet; import java.util.UUID; import java.util.stream.Collectors; +import java.util.stream.Stream; import org.camunda.bpm.engine.delegate.BpmnError; import org.onap.so.bpmn.common.BuildingBlockExecution; @@ -204,7 +205,8 @@ public class AAICreateTasks { if (platform.getPlatformName() == null || "".equals(platform.getPlatformName())) { logger.debug("PlatformName is null in input. Skipping create platform..."); } else { - aaiVnfResources.createPlatformandConnectVnf(platform,vnf); + List<String> platforms = splitCDL(platform.getPlatformName()); + platforms.stream().forEach(platformName -> aaiVnfResources.createPlatformandConnectVnf(new Platform(platformName),vnf)); } } } catch (Exception ex) { @@ -213,6 +215,13 @@ public class AAICreateTasks { } + public List<String> splitCDL(String str){ + return Stream.of(str.split(",")) + .map(String::trim) + .map (elem -> new String(elem)) + .collect(Collectors.toList()); + } + public void createLineOfBusiness(BuildingBlockExecution execution) { try { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); @@ -221,7 +230,8 @@ public class AAICreateTasks { if (lineOfBusiness.getLineOfBusinessName() == null || "".equals(lineOfBusiness.getLineOfBusinessName())) { logger.info("lineOfBusiness is null in input. Skipping create lineOfBusiness..."); } else { - aaiVnfResources.createLineOfBusinessandConnectVnf(lineOfBusiness,vnf); + List<String> lineOfBussinesses = splitCDL(lineOfBusiness.getLineOfBusinessName()); + lineOfBussinesses.stream().forEach(lobName -> aaiVnfResources.createLineOfBusinessandConnectVnf(new LineOfBusiness(lobName),vnf)); } } } catch (Exception ex) { |