From e7dc04d315cacbe219c9044dbfd4b3ccd078621f Mon Sep 17 00:00:00 2001 From: deepikasatheesh Date: Thu, 10 Jun 2021 19:42:00 +0000 Subject: Fix issues in shared NSI flow in NSMF Issue-ID: SO-3629 Signed-off-by: deepikasatheesh Change-Id: Ib67ffb8f0143549177e7b2776b219fab4d7f00eb --- .../onap/so/bpmn/infrastructure/scripts/AAISliceUtil.groovy | 2 +- .../bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy | 3 ++- .../infrastructure/scripts/DoCreateSliceServiceOption.groovy | 12 ++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'bpmn/so-bpmn-infrastructure-common') diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AAISliceUtil.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AAISliceUtil.groovy index b2415e296f..1b09c49124 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AAISliceUtil.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AAISliceUtil.groovy @@ -136,7 +136,7 @@ class AAISliceUtil { exceptionUtil.buildAndThrowWorkflowException(execution, 2500, errorMsg) } AAIResultWrapper wrapper = getAAIClient().get(uri, NotFoundException.class) - LOGGER.trace(" *****${PREFIX} Exit queryAAI *****") + LOGGER.trace(" ***** Exit queryAAI *****") return wrapper } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy index a3e245ffea..e4281045bd 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy @@ -428,7 +428,8 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ serviceInfo.serviceInvariantUuid = sliceTaskInfo.NSSTInfo.invariantUUID serviceInfo.serviceUuid = sliceTaskInfo.NSSTInfo.UUID serviceInfo.sST = sliceTaskInfo.sliceProfile.sST ?: sliceParams.serviceProfile.get("sST") - serviceInfo.nssiName = allocateAnNssi.nssiName + serviceInfo.nssiName = sliceTaskInfo.suggestNssiId ? sliceTaskInfo.NSSTInfo.name : allocateAnNssi.nssiName + serviceInfo.nssiId = sliceTaskInfo.suggestNssiId nbiRequest.setServiceInfo(serviceInfo) nbiRequest.setEsrInfo(esrInfo) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy index 91a69b3123..ac959543a2 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy @@ -374,14 +374,15 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ if (solution != null) { if (execution.getVariable("queryNsiFirst")) { if (solution.get("existingNSI")) { + processSharedNSI(solution, sliceTaskParams, execution) execution.setVariable("needQuerySliceProfile", true) } else { - processNewNSI(solution, sliceTaskParams) + processNewSliceProfiles(solution, sliceTaskParams) execution.setVariable("needQuerySliceProfile", false) } execution.setVariable("queryNsiFirst", false) } else { - processSharedNSI(solution, sliceTaskParams, execution) + processNewSliceProfiles(solution, sliceTaskParams) execution.setVariable("needQuerySliceProfile", false) } } @@ -400,18 +401,17 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ List nssiId = aaiSliceUtil.getNSSIIdList(execution,nsiId) List nssiInstances = aaiSliceUtil.getNSSIListFromAAI(execution, nssiId) - List sliceProfiles = sharedNSISolution.get("sliceProfiles") as List - handleSliceProfiles(sliceProfiles, sliceParams) Map nssiSolution = new HashMap<>() for(ServiceInstance instance: nssiInstances){ nssiSolution.put("NSSIId", instance.getServiceInstanceId()) nssiSolution.put("NSSIName", instance.getServiceInstanceName()) - processNssiResult(sliceParams, instance.getEnvironmentContext(), nssiSolution) + SubnetType subnetType = instance.getWorkloadContext() as SubnetType + processNssiResult(sliceParams, subnetType, nssiSolution) } } - private void processNewNSI(Map solution, SliceTaskParamsAdapter sliceParams) { + private void processNewSliceProfiles(Map solution, SliceTaskParamsAdapter sliceParams) { Map newNSISolution = solution.get("newNSISolution") as Map List sliceProfiles = newNSISolution.get("sliceProfiles") as List handleSliceProfiles(sliceProfiles, sliceParams) -- cgit 1.2.3-korg