From 481350fb01fdc5375dc10479990e07bd7921a241 Mon Sep 17 00:00:00 2001 From: pwielebs Date: Fri, 20 Dec 2019 10:57:48 +0100 Subject: Add pnfs resources handling in service macro create Issue-ID: SO-2568 Signed-off-by: Piotr Wielebski Change-Id: If6c6ad5469c9637af119c811e6f87ea00a282f18 --- .../workflow/tasks/WorkflowAction.java | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'bpmn/so-bpmn-tasks/src/main') 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 68f33c18a8..99ba35232c 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 @@ -75,17 +75,7 @@ import org.onap.so.db.catalog.beans.VfModuleCustomization; import org.onap.so.db.catalog.beans.macro.NorthBoundRequest; import org.onap.so.db.catalog.beans.macro.OrchestrationFlow; import org.onap.so.db.catalog.client.CatalogDbClient; -import org.onap.so.serviceinstancebeans.CloudConfiguration; -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.RequestDetails; -import org.onap.so.serviceinstancebeans.RequestInfo; -import org.onap.so.serviceinstancebeans.Service; -import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; -import org.onap.so.serviceinstancebeans.VfModules; -import org.onap.so.serviceinstancebeans.Vnfs; +import org.onap.so.serviceinstancebeans.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -730,6 +720,8 @@ public class WorkflowAction { workflowResourceIds.setServiceInstanceId(serviceInstanceId); if (resource == WorkflowType.VNF) { workflowResourceIds.setVnfId(resourceId); + } else if (resource == WorkflowType.PNF) { + workflowResourceIds.setPnfId(resourceId); } else if (resource == WorkflowType.VFMODULE) { workflowResourceIds.setVfModuleId(resourceId); } else if (resource == WorkflowType.VOLUMEGROUP) { @@ -1173,6 +1165,13 @@ public class WorkflowAction { } } } + if (validate.getResources().getPnfs() != null) { + for (Pnfs pnf : validate.getResources().getPnfs()) { + resourceCounter.add(new Resource(WorkflowType.PNF, + pnf.getModelInfo().getModelCustomizationId(), false)); + foundRelated = true; + } + } if (validate.getResources().getNetworks() != null) { for (Networks network : validate.getResources().getNetworks()) { resourceCounter.add(new Resource(WorkflowType.NETWORK, -- cgit 1.2.3-korg