From 2b0b9c4b6810d37b72fcb3bbbe5d8a1e1ed41c05 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Thu, 4 Apr 2019 17:18:37 -0400 Subject: Add support to parse cdl inside LOB and platform Add support to parse cdl inside LOB and platform Change-Id: Ie1013d2ba606767d372cfedd4acfb500db209bd3 Issue-ID: SO-1748 Signed-off-by: Benjamin, Max (mb388a) --- .../so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'bpmn/so-bpmn-tasks/src/main/java') 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 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 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 lineOfBussinesses = splitCDL(lineOfBusiness.getLineOfBusinessName()); + lineOfBussinesses.stream().forEach(lobName -> aaiVnfResources.createLineOfBusinessandConnectVnf(new LineOfBusiness(lobName),vnf)); } } } catch (Exception ex) { -- cgit 1.2.3-korg