diff options
6 files changed, 25 insertions, 5 deletions
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 6d5eb63b0d..a5c23681e2 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 @@ -232,6 +232,7 @@ public class BBInputSetup implements JavaDelegate { String requestId = executeBB.getRequestId(); this.populateLookupKeyMapWithIds(executeBB.getWorkflowResourceIds(), lookupKeyMap); RequestDetails requestDetails = executeBB.getRequestDetails(); + logger.debug("Resource ID, vnfType, requestAction: {},{},{}", resourceId, vnfType, requestAction); if (requestDetails == null) { requestDetails = bbInputSetupUtils.getRequestDetails(requestId); } @@ -273,6 +274,7 @@ public class BBInputSetup implements JavaDelegate { ServiceModel serviceModel = new ServiceModel(); Service service = null; Service newService = null; + logger.debug("getGBBALaCarteNonService: {}", bbName); boolean isReplace = false; if (serviceInstanceId != null) { aaiServiceInstance = bbInputSetupUtils.getAAIServiceInstanceById(serviceInstanceId); @@ -397,6 +399,7 @@ public class BBInputSetup implements JavaDelegate { parameter.setPlatform(parameter.getRequestDetails().getPlatform()); parameter.setLineOfBusiness(parameter.getRequestDetails().getLineOfBusiness()); String applicationId = ""; + logger.debug("populateObjectsOnAssignAndCreateFlows: {}", modelType); if (parameter.getRequestDetails().getRequestInfo().getApplicationId() != null) { applicationId = parameter.getRequestDetails().getRequestInfo().getApplicationId(); parameter.setApplicationId(applicationId); @@ -405,7 +408,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) @@ -892,7 +895,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()); @@ -909,6 +913,17 @@ public class BBInputSetup implements JavaDelegate { } } + private boolean isCnf(final RequestDetails requestDetails) { + logger.debug("Inside isCNF"); + if (requestDetails.getModelInfo() != null) { + logger.debug("Inside isCNF {}", requestDetails); + return ModelType.cnf.equals(requestDetails.getModelInfo().getModelType()); + } + + logger.debug("Inside isCNF returning false:{}", requestDetails); + return false; + } + protected boolean instanceGroupInList(GenericVnf vnf, String instanceGroupId) { for (InstanceGroup instanceGroup : vnf.getInstanceGroups()) { if (instanceGroup.getId() != null && instanceGroup.getId().equalsIgnoreCase(instanceGroupId)) { diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java index f233de2baa..598a64ae76 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java @@ -154,9 +154,11 @@ public class OrchestrationStatusValidator { orchestrationStatus = serviceInstance.getOrchestrationStatus(); break; case VNF: + case CNF: GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); orchestrationStatus = genericVnf.getOrchestrationStatus(); break; + case VF_MODULE: VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID); orchestrationStatus = vfModule.getOrchestrationStatus(); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java index 811d88869e..f8ab2cb0b9 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java @@ -716,7 +716,8 @@ public class MsoRequest { } else if (requestScope.equalsIgnoreCase(ModelType.vfModule.name())) { vnfType = serviceModelName + "/" + vnfModelName; sir.setVolumeGroupInstanceId(volumeGroupId); - } else if (requestScope.equalsIgnoreCase(ModelType.vnf.name())) + } else if (requestScope.equalsIgnoreCase(ModelType.vnf.name()) + || requestScope.equalsIgnoreCase(ModelType.cnf.name())) vnfType = serviceModelName + "/" + sir.getRequestDetails().getModelInfo().getModelCustomizationName(); return vnfType; diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java index efa037d393..e0511f259e 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java @@ -408,7 +408,8 @@ public class RequestHandlerUtils extends AbstractRestHandler { if (StringUtils.isNotBlank(instanceId)) { if (ModelType.service.name().equalsIgnoreCase(requestScope)) { currentActiveReq.setServiceInstanceId(instanceId); - } else if (ModelType.vnf.name().equalsIgnoreCase(requestScope)) { + } else if (ModelType.vnf.name().equalsIgnoreCase(requestScope) + || ModelType.cnf.name().equalsIgnoreCase(requestScope)) { currentActiveReq.setVnfId(instanceId); } else if (ModelType.vfModule.name().equalsIgnoreCase(requestScope)) { currentActiveReq.setVfModuleId(instanceId); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/vnfbeans/ModelType.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/vnfbeans/ModelType.java index e24ecd4eac..723bdd558b 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/vnfbeans/ModelType.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/vnfbeans/ModelType.java @@ -24,5 +24,5 @@ package org.onap.so.apihandlerinfra.vnfbeans; * Enum for Status values returned by API Handler to Tail-F */ public enum ModelType { - service, vnf, vfModule, volumeGroup, network + service, vnf, vfModule, volumeGroup, network, cnf } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java index 74f58a210c..c69c0a7aab 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java @@ -23,6 +23,7 @@ package org.onap.so.db.catalog.beans; public enum ResourceType { SERVICE("Service", "SERVICE_INSTANCE_ID"), VNF("Vnf", "GENERIC_VNF_ID"), + CNF("Cnf", "GENERIC_VNF_ID"), VOLUME_GROUP("VolumeGroup", "VOLUME_GROUP_ID"), VF_MODULE("VfModule", "VF_MODULE_ID"), NETWORK("Network", "NETWORK_ID"), |