From 1a6b1ef83417efbbb8ec7cfe204c105e49e7e1f2 Mon Sep 17 00:00:00 2001 From: "raviteja.karumuri" Date: Wed, 25 Jan 2023 13:45:59 +0000 Subject: [SO] Create changes for SO-API and BPMN-INFRA to support CNF's through ASD Issue-ID: SO-4069 Signed-off-by: raviteja.karumuri Change-Id: Ia8defe62c70e126df683ca523b10efe55a26db87 --- .../so/bpmn/servicedecomposition/tasks/BBInputSetup.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'bpmn/MSOCommonBPMN') diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java index 0c5e2d1410..178612c4bd 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java @@ -8,6 +8,8 @@ * ================================================================================ * Modifications Copyright (c) 2020 Nokia * ================================================================================ + * Modifications Copyright (c) 2023 Nordix Foundation + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -410,7 +412,7 @@ public class BBInputSetup implements JavaDelegate { if (modelType.equals(ModelType.network)) { parameter.getLookupKeyMap().put(ResourceKey.NETWORK_ID, parameter.getResourceId()); this.populateL3Network(parameter); - } else if (modelType.equals(ModelType.vnf)) { + } else if (modelType.equals(ModelType.vnf) || modelType.equals(ModelType.cnf)) { parameter.getLookupKeyMap().put(ResourceKey.GENERIC_VNF_ID, parameter.getResourceId()); this.populateGenericVnf(parameter); } else if (modelType.equals(ModelType.volumeGroup) || (modelType.equals(ModelType.vfModule) @@ -897,7 +899,8 @@ public class BBInputSetup implements JavaDelegate { break; } } - if (vnf == null && parameter.getBbName().equalsIgnoreCase(AssignFlows.VNF.toString())) { + if ((vnf == null && parameter.getBbName().equalsIgnoreCase(AssignFlows.VNF.toString())) + || (parameter.getRequestDetails() != null && this.isCnf(parameter.getRequestDetails()))) { vnf = createGenericVnf(parameter.getLookupKeyMap(), parameter.getInstanceName(), parameter.getPlatform(), parameter.getLineOfBusiness(), parameter.getResourceId(), generatedVnfType, parameter.getInstanceParams(), parameter.getProductFamilyId(), parameter.getApplicationId()); @@ -914,6 +917,15 @@ public class BBInputSetup implements JavaDelegate { } } + private boolean isCnf(final RequestDetails requestDetails) { + logger.debug("Executing isCNF to check the model type is CNF"); + if (requestDetails.getModelInfo() != null) { + return ModelType.cnf.equals(requestDetails.getModelInfo().getModelType()); + } + logger.debug("Not a CNF model type:{}", requestDetails); + return false; + } + protected boolean instanceGroupInList(GenericVnf vnf, String instanceGroupId) { for (InstanceGroup instanceGroup : vnf.getInstanceGroups()) { if (instanceGroup.getId() != null && instanceGroup.getId().equalsIgnoreCase(instanceGroupId)) { -- cgit 1.2.3-korg