summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordeepikasatheesh <deepika.s84@wipro.com>2022-04-28 03:32:54 +0000
committerdeepikasatheesh <deepika.s84@wipro.com>2022-05-26 07:54:33 +0000
commit08e64b98fc5f2067e596c2c407370612c716f253 (patch)
treec8be41645975a81b2f5a00fd402ce8ac4b3daae9
parent131fd74f717f76bc23af1ef935f6e96654f703d6 (diff)
Fix bugs found in TN Slicing integration involving OOF
Issue-ID: SO-3931 Signed-off-by: deepikasatheesh <deepika.s84@wipro.com> Change-Id: I6fe2f53bb8f2761df40802e95255f617089069b5
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy1
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy5
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeAllocateAccessNSSI.groovy14
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn2
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateAccessNSSI.bpmn2
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java1
9 files changed, 25 insertions, 10 deletions
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<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
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<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()
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)</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" />
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)</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" />
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;
}
}