From f73e27f96ee88bee8f95da6470d5b7693efd2100 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Tue, 5 Feb 2019 17:19:30 -0500 Subject: provide correct custIds correct variable name and use bean comparison included object assertion in junit on catalog client update test name to reflect return value fix cvnfc query by 2 customization uuid relationships provide customization ids to module query input Change-Id: I99df11c417230e398f86554d889a40e9d157544c Issue-ID: SO-1466 Signed-off-by: Benjamin, Max (mb388a) --- .../workflow/tasks/WorkflowAction.java | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'bpmn/so-bpmn-tasks/src/main/java') diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index 0c0e1464b2..0082545fa1 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -68,6 +68,8 @@ import org.onap.so.logger.MsoLogger; import org.onap.so.serviceinstancebeans.ModelInfo; import org.onap.so.serviceinstancebeans.ModelType; import org.onap.so.serviceinstancebeans.Networks; +import org.onap.so.serviceinstancebeans.RelatedInstance; +import org.onap.so.serviceinstancebeans.RelatedInstanceList; import org.onap.so.serviceinstancebeans.RequestDetails; import org.onap.so.serviceinstancebeans.Service; import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; @@ -198,7 +200,7 @@ public class WorkflowAction { if (orchFlows == null || orchFlows.isEmpty()) { orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte, cloudOwner, serviceType); } - orchFlows = filterOrchFlows(orchFlows, resourceType, execution); + orchFlows = filterOrchFlows(sIRequest, orchFlows, resourceType, execution); String key = ""; ModelInfo modelInfo = sIRequest.getRequestDetails().getModelInfo(); if(modelInfo.getModelType().equals(ModelType.service)) { @@ -1103,10 +1105,22 @@ public class WorkflowAction { return listToExecute; } - protected List filterOrchFlows(List orchFlows, WorkflowType resourceType, DelegateExecution execution) { + protected List filterOrchFlows(ServiceInstancesRequest sIRequest, List orchFlows, WorkflowType resourceType, DelegateExecution execution) { List result = new ArrayList<>(orchFlows); + String vnfCustomizationUUID = ""; + String vfModuleCustomizationUUID = sIRequest.getRequestDetails().getModelInfo().getModelCustomizationUuid(); + RelatedInstanceList[] relatedInstanceList = sIRequest.getRequestDetails().getRelatedInstanceList(); + if (relatedInstanceList != null) { + for (RelatedInstanceList relatedInstList : relatedInstanceList) { + RelatedInstance relatedInstance = relatedInstList.getRelatedInstance(); + if (relatedInstance.getModelInfo().getModelType().equals(ModelType.vnf)) { + vnfCustomizationUUID = relatedInstance.getModelInfo().getModelCustomizationUuid(); + } + } + } + if (resourceType.equals(WorkflowType.VFMODULE)) { - List fabricCustomizations = traverseCatalogDbForConfiguration((String)execution.getVariable("vnfId"), (String)execution.getVariable("vfModuleId")); + List fabricCustomizations = traverseCatalogDbForConfiguration(vnfCustomizationUUID, vfModuleCustomizationUUID); if (fabricCustomizations.isEmpty()) { result = orchFlows.stream().filter(item -> !item.getFlowName().contains(FABRIC_CONFIGURATION)).collect(Collectors.toList()); } -- cgit 1.2.3-korg