summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/main
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2019-03-20 16:19:39 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-03-21 13:29:05 -0400
commite8689688629582187b2484eda21524ee70abbb9f (patch)
tree49ee8dc72349a4929dc2bfd45bc6ef203f1d1e88 /bpmn/so-bpmn-tasks/src/main
parent353782a4d50f3764f71916385dc062401aa7456d (diff)
Corrected hibernate for cfvc customization table
fix two tests that did not ignore some properties fix schema sql file that was missing fields Properly wire hibernate entities, clean up db tables Update schema.sql files to be consistent add junit for customization linked to same cvnfc Change-Id: I4bc0a83cb3908f5b34224416e75446b6cd166b9e Issue-ID: SO-1689 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/workflow/tasks/WorkflowActionBBTasks.java49
1 files changed, 17 insertions, 32 deletions
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);
}