aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/main
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2019-04-04 17:18:37 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-04-04 17:18:59 -0400
commit2b0b9c4b6810d37b72fcb3bbbe5d8a1e1ed41c05 (patch)
tree8239461fcbe31f7a9ec801182bd41037a3cff2c2 /bpmn/so-bpmn-tasks/src/main
parentf81920304c7b62637d32473e672a1e51275ce54b (diff)
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) <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/aai/tasks/AAICreateTasks.java14
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) {