From: deepikasatheesh Date: Thu, 28 Apr 2022 03:32:54 +0000 (+0000) Subject: Fix bugs found in TN Slicing integration involving OOF X-Git-Tag: 1.11.0~25^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=so.git;a=commitdiff_plain;h=08e64b98fc5f2067e596c2c407370612c716f253 Fix bugs found in TN Slicing integration involving OOF Issue-ID: SO-3931 Signed-off-by: deepikasatheesh Change-Id: I6fe2f53bb8f2761df40802e95255f617089069b5 --- diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy index 71dd9b1426..eb7e89ce54 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy @@ -327,7 +327,7 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe result.setExpDataRateDL(profile.get("expDataRateDL")) result.setExpDataRateUL(profile.get("expDataRateUL")) result.setSurvivalTime(profile.get("survivalTime")) - result.setMaxNumberOfPDUSession(profile.get("maxNumberOfPDUSession")) + result.setMaxNumberOfPDUSession(profile.get("maxNumberofPDUSession")) result.setAreaTrafficCapDL(profile.get("areaTrafficCapDL")) result.setAreaTrafficCapUL(profile.get("areaTrafficCapUL")) result.setOverallUserDensity(profile.get("overallUserDensity")) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy index a11270465a..54fa2abdd1 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy @@ -575,7 +575,11 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { ANServiceInstance.setServiceRole(serviceRole) List snssaiList = execution.getVariable("snssaiList") String snssai = snssaiList.get(0) - //ANServiceInstance.setEnvironmentContext(snssai) + //ANServiceInstance.setEnvironmentContext(snssai) + String modelInvariantUuid = execution.getVariable("modelInvariantUuid") + String modelUuid = execution.getVariable("modelUuid") as String + ANServiceInstance.setModelInvariantId(modelInvariantUuid) + ANServiceInstance.setModelVersionId(modelUuid) ANServiceInstance.setEnvironmentContext(execution.getVariable("networkType")) //Network Type ANServiceInstance.setWorkloadContext("AN") //domain Type diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy index a784cbee6e..6981d94324 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy @@ -110,6 +110,7 @@ class DoAllocateNSSI extends AbstractServiceTaskProcessor { execution.setVariable("nssiAllocateStatus", jobStatusResponse) if (jobStatusResponse.getResponseDescriptor().getProgress() == 100) { + nssiAllocateResult.setNssiId(jobStatusResponse.getResponseDescriptor().getNssiId()) execution.setVariable("jobFinished", true) } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy index dd168519e5..d2ba28256f 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy @@ -146,6 +146,11 @@ class DoCreateTnNssiInstance extends AbstractServiceTaskProcessor { ss.setWorkloadContext(domainTypeStr) } + String resourceSharingLevel = jsonUtil.getJsonValue(sliceProfileStr, "resourceSharingLevel") + if (isNotBlank(resourceSharingLevel)) { + ss.setServiceFunction(resourceSharingLevel) + } + AAIResourcesClient client = getAAIClient() AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business() diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeAllocateAccessNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeAllocateAccessNSSI.groovy index 6fd8080ef0..74a2d980f7 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeAllocateAccessNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeAllocateAccessNSSI.groovy @@ -40,6 +40,7 @@ import org.onap.so.beans.nsmf.DeAllocateNssi import org.onap.so.beans.nsmf.EsrInfo import org.onap.so.beans.nsmf.NetworkType import org.onap.so.beans.nsmf.ServiceInfo +import org.onap.so.beans.nsmf.oof.SubnetType import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor import org.onap.so.bpmn.common.scripts.ExceptionUtil import org.onap.so.bpmn.common.scripts.NssmfAdapterUtils @@ -333,9 +334,9 @@ class DoDeAllocateAccessNSSI extends AbstractServiceTaskProcessor { logger.debug("Generated new job for Service Instance serviceId:" + serviceId + " operationId:" + modificationJobId) ResourceOperationStatus initStatus = new ResourceOperationStatus() - initStatus.setServiceId(serviceId) + initStatus.setServiceId(nsiId) initStatus.setOperationId(modificationJobId) - initStatus.setResourceTemplateUUID(nsiId) + initStatus.setResourceTemplateUUID(serviceId) initStatus.setOperType("Modify-Deallocate") requestDBUtil.prepareInitResourceOperationStatus(execution, initStatus) @@ -347,13 +348,18 @@ class DoDeAllocateAccessNSSI extends AbstractServiceTaskProcessor { String responseId = "1" String globalSubscriberId = execution.getVariable("globalSubscriberId") String subscriptionServiceType = execution.getVariable("subscriptionServiceType") + String anNssiId = execution.getVariable("anNssiId") JsonObject esrInfo = new JsonObject() esrInfo.addProperty("networkType", networkType) esrInfo.addProperty("vendor", "ONAP_internal") JsonObject serviceInfo = new JsonObject() - serviceInfo.addProperty("nsiId", execution.getVariable("nsiId")) + if (networkType.equals(SubnetType.AN.getSubnetType())) { + serviceInfo.addProperty("nsiId", execution.getVariable("nsiId")) + } else { + serviceInfo.addProperty("nsiId", anNssiId) + } serviceInfo.addProperty("nssiId", instanceId) serviceInfo.addProperty("globalSubscriberId", globalSubscriberId) serviceInfo.addProperty("subscriptionServiceType", subscriptionServiceType) @@ -526,7 +532,7 @@ class DoDeAllocateAccessNSSI extends AbstractServiceTaskProcessor { Map relatedSPs = execution.getVariable("relatedSPs") DeAllocateNssi deallocateNssi = new DeAllocateNssi() - deallocateNssi.setNsiId(execution.getVariable("nsiId")) + deallocateNssi.setNsiId(anNssiId) ServiceInstance tnNssi = relatedNssis.get(serviceFunction) String nssiId = tnNssi.getServiceInstanceId() diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy index b1436d5d06..9debd4011b 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy @@ -283,8 +283,6 @@ class TnAllocateNssi extends AbstractServiceTaskProcessor { void prepareModifyTnNssiInputs(DelegateExecution execution) { logger.debug(Prefix + "prepareModifyTnNssiInputs method start") - String jobId = UUID.randomUUID().toString() - execution.setVariable("modifyTnNssiJobId", jobId) String additionalPropJsonStr = execution.getVariable("sliceParams") String sliceProfile = execution.getVariable("sliceProfile") String snssaiList = jsonUtil.getJsonValue(sliceProfile, "snssaiList") diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn index 694be22517..fb03f6fa45 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn @@ -261,7 +261,7 @@ css.prepareModifyTnNssiInputs(execution) - + diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateAccessNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateAccessNSSI.bpmn index 15aa7e1eb5..513f715cde 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateAccessNSSI.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateAccessNSSI.bpmn @@ -639,7 +639,7 @@ deallocator.deleteANNSSI(execution) - + diff --git a/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java b/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java index 7cc940ddde..2b315611ad 100644 --- a/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java +++ b/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java @@ -176,6 +176,7 @@ public class SliceProfileAdapter implements Serializable { BeanUtils.copyProperties(this, tnSliceProfile); tnSliceProfile.setSNSSAIList(Arrays.asList(this.sNSSAIList.split("\\|"))); tnSliceProfile.setPLMNIdList(Arrays.asList(this.pLMNIdList.split("\\|"))); + tnSliceProfile.setResourceSharingLevel(ResourceSharingLevel.fromString(this.resourceSharingLevel)); return tnSliceProfile; } }