Fix bugs found in TN Slicing integration involving OOF 26/128926/4
authordeepikasatheesh <deepika.s84@wipro.com>
Thu, 28 Apr 2022 03:32:54 +0000 (03:32 +0000)
committerdeepikasatheesh <deepika.s84@wipro.com>
Thu, 26 May 2022 07:54:33 +0000 (07:54 +0000)
Issue-ID: SO-3931

Signed-off-by: deepikasatheesh <deepika.s84@wipro.com>
Change-Id: I6fe2f53bb8f2761df40802e95255f617089069b5

bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeAllocateAccessNSSI.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy
bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn
bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateAccessNSSI.bpmn
common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java

index 71dd9b1..eb7e89c 100644 (file)
@@ -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")) 
index a112704..54fa2ab 100644 (file)
@@ -575,7 +575,11 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                ANServiceInstance.setServiceRole(serviceRole)
                 List<String> 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
                
index a784cbe..6981d94 100644 (file)
@@ -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)
             }
         }
index dd16851..d2ba282 100644 (file)
@@ -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()
index 6fd8080..74a2d98 100644 (file)
@@ -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<String, ServiceInstance> 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()
 
index b1436d5..9debd40 100644 (file)
@@ -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")
index 694be22..fb03f6f 100644 (file)
@@ -261,7 +261,7 @@ css.prepareModifyTnNssiInputs(execution)</bpmn:script>
         <camunda:in source="globalSubscriberId" target="globalSubscriberId" />
         <camunda:in source="subscriptionServiceType" target="subscriptionServiceType" />
         <camunda:in source="transportSliceNetworks" target="transportSliceNetworks" />
-        <camunda:in source="modifyTnNssiJobId" target="jobId" />
+        <camunda:in source="jobId" target="jobId" />
         <camunda:in source="modifySliceParams" target="sliceParams" />
         <camunda:in source="servicename" target="servicename" />
         <camunda:out source="WorkflowException" target="WorkflowException" />
index 15aa7e1..513f715 100644 (file)
@@ -639,7 +639,7 @@ deallocator.deleteANNSSI(execution)</bpmn:script>
     <bpmn:callActivity id="Activity_0umktii" name="Modify RAN NF NSSI" calledElement="DoModifyRanNfNssi">
       <bpmn:extensionElements>
         <camunda:in source="anNfNssiId" target="serviceInstanceID" />
-        <camunda:in source="anNfSliceProfileId" target="SliceProfileId" />
+        <camunda:in source="anNfSliceProfileId" target="sliceProfileId" />
         <camunda:in source="msoRequestId" target="msoRequestId" />
         <camunda:in source="globalSubscriberId" target="globalSubscriberId" />
         <camunda:in source="subscriptionServiceType" target="subscriptionServiceType" />
index 7cc940d..2b31561 100644 (file)
@@ -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;
     }
 }