X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=bpmn%2FMSOCommonBPMN%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fso%2Fbpmn%2Fservicedecomposition%2Ftasks%2FBBInputSetup.java;h=178612c4bd77e80beefe78e607e6ca351ddc06c1;hb=1a6b1ef83417efbbb8ec7cfe204c105e49e7e1f2;hp=0c5e2d1410845153a31cd33514784a8a5feb9f8a;hpb=9cb10c58aacb2c0a79b0c93accf1ca4fe29522f9;p=so.git 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)) {