diff options
author | Steve Smokowski <ss835w@att.com> | 2019-03-21 18:41:24 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-21 18:41:24 +0000 |
commit | 189ee75f7dbf9c00c21c1a1163629b31cbf08e18 (patch) | |
tree | 3c682fb6eb453bca782a066d1774e9cb4d78a90b /bpmn | |
parent | ae62cbb1785ea581be62496170ce5595bacd51da (diff) | |
parent | e8689688629582187b2484eda21524ee70abbb9f (diff) |
Merge "Corrected hibernate for cfvc customization table"
Diffstat (limited to 'bpmn')
2 files changed, 18 insertions, 33 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java index 36a6bf37d9..88ed5d37d9 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java @@ -146,7 +146,7 @@ public class BBInputSetupUtils { } public VnfVfmoduleCvnfcConfigurationCustomization getVnfVfmoduleCvnfcConfigurationCustomizationByActionAndIsALaCarteAndRequestScopeAndCloudOwner(String vnfCustomizationUuid, - String vfModuleCustomizationUuid, String cvnfcCustomizationUuid) { + String vfModuleCustomizationUuid, String cvnfcCustomizationUuid){ return catalogDbClient.getVnfVfmoduleCvnfcConfigurationCustomizationByVnfCustomizationUuidAndVfModuleCustomizationUuidAndCvnfcCustomizationUuid(vnfCustomizationUuid, vfModuleCustomizationUuid, cvnfcCustomizationUuid); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java index 482957e006..242f125bde 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java @@ -375,38 +375,23 @@ public class WorkflowActionBBTasks { List<Vnfc> vnfcs = workflowAction.getRelatedResourcesInVfModule(vnfId, vfModuleId, Vnfc.class, AAIObjectType.VNFC); for(Vnfc vnfc : vnfcs) { String modelCustomizationId = vnfc.getModelCustomizationId(); - List<CvnfcCustomization> cvnfcCustomizations = catalogDbClient.getCvnfcCustomizationByVnfCustomizationUUIDAndVfModuleCustomizationUUID(vnfCustomizationUUID, vfModuleCustomizationUUID); - CvnfcCustomization cvnfcCustomization = null; - for(CvnfcCustomization cvnfc : cvnfcCustomizations) { - if(cvnfc.getModelCustomizationUUID().equalsIgnoreCase(modelCustomizationId)) { - cvnfcCustomization = cvnfc; - } - } - if(cvnfcCustomization != null) { - VnfVfmoduleCvnfcConfigurationCustomization fabricConfig = null; - for(VnfVfmoduleCvnfcConfigurationCustomization customization : cvnfcCustomization.getVnfVfmoduleCvnfcConfigurationCustomization()){ - if(customization.getConfigurationResource().getToscaNodeType().contains(FABRIC_CONFIGURATION)){ - if(fabricConfig == null) { - fabricConfig = customization; - } else { - throw new Exception("Multiple Fabric configs found for this vnfc"); - } - } - } - if(fabricConfig != null) { - String configurationId = UUID.randomUUID().toString(); - ConfigurationResourceKeys configurationResourceKeys = new ConfigurationResourceKeys(); - configurationResourceKeys.setCvnfcCustomizationUUID(modelCustomizationId); - configurationResourceKeys.setVfModuleCustomizationUUID(vfModuleCustomizationUUID); - configurationResourceKeys.setVnfResourceCustomizationUUID(vnfCustomizationUUID); - configurationResourceKeys.setVnfcName(vnfc.getVnfcName()); - ExecuteBuildingBlock assignConfigBB = getExecuteBBForConfig(ASSIGN_FABRIC_CONFIGURATION_BB, ebb, configurationId, configurationResourceKeys); - ExecuteBuildingBlock activateConfigBB = getExecuteBBForConfig(ACTIVATE_FABRIC_CONFIGURATION_BB, ebb, configurationId, configurationResourceKeys); - flowsToExecute.add(assignConfigBB); - flowsToExecute.add(activateConfigBB); - execution.setVariable("flowsToExecute", flowsToExecute); - execution.setVariable("completed", false); - } + VnfVfmoduleCvnfcConfigurationCustomization fabricConfig = + catalogDbClient.getVnfVfmoduleCvnfcConfigurationCustomizationByVnfCustomizationUuidAndVfModuleCustomizationUuidAndCvnfcCustomizationUuid(vnfCustomizationUUID, vfModuleCustomizationUUID, modelCustomizationId); + if(fabricConfig != null && fabricConfig.getConfigurationResource() != null + && fabricConfig.getConfigurationResource().getToscaNodeType() != null + && fabricConfig.getConfigurationResource().getToscaNodeType().contains(FABRIC_CONFIGURATION)) { + String configurationId = UUID.randomUUID().toString(); + ConfigurationResourceKeys configurationResourceKeys = new ConfigurationResourceKeys(); + configurationResourceKeys.setCvnfcCustomizationUUID(modelCustomizationId); + configurationResourceKeys.setVfModuleCustomizationUUID(vfModuleCustomizationUUID); + configurationResourceKeys.setVnfResourceCustomizationUUID(vnfCustomizationUUID); + configurationResourceKeys.setVnfcName(vnfc.getVnfcName()); + ExecuteBuildingBlock assignConfigBB = getExecuteBBForConfig(ASSIGN_FABRIC_CONFIGURATION_BB, ebb, configurationId, configurationResourceKeys); + ExecuteBuildingBlock activateConfigBB = getExecuteBBForConfig(ACTIVATE_FABRIC_CONFIGURATION_BB, ebb, configurationId, configurationResourceKeys); + flowsToExecute.add(assignConfigBB); + flowsToExecute.add(activateConfigBB); + execution.setVariable("flowsToExecute", flowsToExecute); + execution.setVariable("completed", false); } else { logger.debug("No cvnfcCustomization found for customizationId: " + modelCustomizationId); } |