diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-02-05 17:19:30 -0500 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-02-05 17:20:20 -0500 |
commit | f73e27f96ee88bee8f95da6470d5b7693efd2100 (patch) | |
tree | c0b7a746951875b950ba9b633ab3086252e989b9 /bpmn/so-bpmn-tasks/src/main/java/org | |
parent | 632f2ff1ef005a801c0676367e90417f9ca00c57 (diff) |
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) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main/java/org')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java | 20 |
1 files changed, 17 insertions, 3 deletions
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<OrchestrationFlow> filterOrchFlows(List<OrchestrationFlow> orchFlows, WorkflowType resourceType, DelegateExecution execution) { + protected List<OrchestrationFlow> filterOrchFlows(ServiceInstancesRequest sIRequest, List<OrchestrationFlow> orchFlows, WorkflowType resourceType, DelegateExecution execution) { List<OrchestrationFlow> 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<String> fabricCustomizations = traverseCatalogDbForConfiguration((String)execution.getVariable("vnfId"), (String)execution.getVariable("vfModuleId")); + List<String> fabricCustomizations = traverseCatalogDbForConfiguration(vnfCustomizationUUID, vfModuleCustomizationUUID); if (fabricCustomizations.isEmpty()) { result = orchFlows.stream().filter(item -> !item.getFlowName().contains(FABRIC_CONFIGURATION)).collect(Collectors.toList()); } |