From 3c9bc7d08acb18d76af794bfe936fed7c917b284 Mon Sep 17 00:00:00 2001 From: Jozsef Csongvai Date: Tue, 24 Nov 2020 14:44:01 -0500 Subject: Add VNF-Macro-Create and VNF-Macro-Delete These macros enable creation and deletion of a vnf with vfmodules for an existing service instance using building blocks. Also: - No longer force alaCarte=true for these use cases - Fix broken vfModule sorting logic for baseFirst/baseLast - Minor refactoring replacing String literals with constants Issue-ID: SO-3635 Signed-off-by: Jozsef Csongvai Change-Id: I16975f3561f2d978dede20679927ac3531def900 --- .../so/bpmn/servicedecomposition/tasks/BBInputSetup.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'bpmn/MSOCommonBPMN/src') diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java index 5cbadd6b75..83d1f5249f 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java @@ -1054,8 +1054,18 @@ public class BBInputSetup implements JavaDelegate { if (requestDetails.getOwningEntity() != null) owningEntity = mapperLayer.mapRequestOwningEntity(requestDetails.getOwningEntity()); - Service service = - bbInputSetupUtils.getCatalogServiceByModelUUID(requestDetails.getModelInfo().getModelVersionId()); + String modelVersionId = requestDetails.getModelInfo().getModelVersionId(); + + if (ModelType.vnf == requestDetails.getModelInfo().getModelType()) { + for (RelatedInstanceList relatedInstanceList : requestDetails.getRelatedInstanceList()) { + if (ModelType.service == relatedInstanceList.getRelatedInstance().getModelInfo().getModelType()) { + modelVersionId = relatedInstanceList.getRelatedInstance().getModelInfo().getModelVersionId(); + break; + } + } + } + + Service service = bbInputSetupUtils.getCatalogServiceByModelUUID(modelVersionId); if (service == null) { service = bbInputSetupUtils.getCatalogServiceByModelVersionAndModelInvariantUUID( requestDetails.getModelInfo().getModelVersion(), -- cgit 1.2.3-korg