import org.onap.aaiclient.client.aai.AAIObjectType
import org.onap.aai.domain.yang.NetworkPolicy
import org.onap.aai.domain.yang.NetworkRoute
+import org.json.JSONArray
class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
" subscriptionServiceType - "+execution.getVariable("subscriptionServiceType")+
" jobId - "+execution.getVariable("jobId")+
" sliceParams - "+execution.getVariable("sliceParams")+
- " servicename - "+ execution.getVariable("servicename"))
+ " servicename - "+ execution.getVariable("servicename")+
+ " sst - "+ execution.getVariable("sst"))
//validate slice subnet inputs
String sliceProfileId = jsonUtil.getJsonValue(sliceProfile, "sliceProfileId")
def snssaiList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "snssaiList"))
def plmnIdList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "plmnIdList"))
- def coverageAreaTAList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "coverageAreaTAList"))
+ String jsonArray = jsonUtil.getJsonValue(sliceProfile, "coverageAreaTAList")
+ List<Integer> list = new ArrayList<>();
+ JSONArray arr = new JSONArray(jsonArray);
+ for (int i = 0; i < arr.length(); i++) {
+ int s = (int) arr.get(i);
+ list.add(s);
+ }
+ def coverageAreaTAList = list;
if (isBlank(sliceProfileId) || (snssaiList.empty) || (plmnIdList.empty)
|| (coverageAreaTAList.empty)) {
execution.setVariable("job_timeout", 10)
//set BH end point
- List<String> BH_endPoints = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceParams, "endPoints"))
- logger.debug("BH end points list : "+BH_endPoints)
- if(BH_endPoints.empty) {
- msg = "End point info is empty"
- logger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
- }else {
- execution.setVariable("bh_endpoint", BH_endPoints.get(0))
- }
-
+ def BH_endPoints = jsonUtil.getJsonValue(sliceParams, "endPoint")
+ logger.debug("BH end points list : "+BH_endPoints)
+ if(isBlank(BH_endPoints)) {
+ msg = "End point info is empty"
+ logger.debug(msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ }else {
+ execution.setVariable("bh_endpoint", BH_endPoints)
+ }
+
} catch(BpmnError e) {
throw e
} catch(Exception ex) {
String requestId = execution.getVariable("msoRequestId")
String messageType = "NSISelectionResponse"
Map<String, Object> profileInfo = objectMapper.readValue(execution.getVariable("sliceProfile"), Map.class)
+ profileInfo.put("sST",execution.getVariable("sst"))
String modelUuid = execution.getVariable("modelUuid")
String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
String modelName = execution.getVariable("ranModelName")
serviceInfo.addProperty("nssiId", execution.getVariable("RANServiceInstanceId"))
serviceInfo.addProperty("nsiId", execution.getVariable("nsiId"))
serviceInfo.addProperty("nssiName", execution.getVariable("servicename"))
- String sST = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "sST")
- serviceInfo.addProperty("sST", sST)
+ serviceInfo.addProperty("sST", execution.getVariable("sst"))
serviceInfo.addProperty("PLMNIdList", objectMapper.writeValueAsString(execution.getVariable("plmnIdList")))
serviceInfo.addProperty("globalSubscriberId", execution.getVariable("globalSubscriberId"))
serviceInfo.addProperty("subscriptionServiceType", execution.getVariable("subscriptionServiceType"))
List<String> ranConstituentSliceProfiles = jsonUtil.StringArrayToList(execution.getVariable("RanConstituentSliceProfiles"))
anNssmfUtils.createDomainWiseSliceProfiles(ranConstituentSliceProfiles, execution)
Map<String, Object> profileInfo = objectMapper.readValue(execution.getVariable("ranNfSliceProfile"), Map.class)
+ profileInfo.put("sST",execution.getVariable("sst"))
String modelUuid = execution.getVariable("ANNF_modelUuid")
String modelInvariantUuid = execution.getVariable("ANNF_modelInvariantUuid")
String modelName = execution.getVariable("ANNF_modelName")
ServiceDecomposition serviceDecomposition = execution.getVariable("ANNF_ServiceDecomposition")
serviceDecomposition.setServiceInstance(serviceInstance);
execution.setVariable("ANNF_ServiceDecomposition", serviceDecomposition)
+ execution.setVariable("modifyAction","allocate")
execution.setVariable("isRspRanNfNssi", true)
}else {
logger.debug("No solutions returned from OOF .. Create new RAN NF NSSI")
String sliceInstanceName = execution.getVariable("servicename")
ANServiceInstance.setServiceInstanceName(sliceInstanceName)
String serviceType = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "sST")
- ANServiceInstance.setServiceType(serviceType)
+ ANServiceInstance.setServiceType(execution.getVariable("sst"))
String serviceStatus = "deactivated"
ANServiceInstance.setOrchestrationStatus(serviceStatus)
String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "plmnIdList")
- ANServiceInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
+ ANServiceInstance.setServiceInstanceLocationId(jsonUtil.StringArrayToList(serviceInstanceLocationid).get(0))
String serviceRole = "nssi"
ANServiceInstance.setServiceRole(serviceRole)
- List<String> snssaiList = objectMapper.readValue(execution.getVariable("snssaiList"), List.class)
+ List<String> snssaiList = execution.getVariable("snssaiList")
String snssai = snssaiList.get(0)
- ANServiceInstance.setEnvironmentContext(snssai)
- ANServiceInstance.setWorkloadContext("AN")
+ //ANServiceInstance.setEnvironmentContext(snssai)
+ ANServiceInstance.setEnvironmentContext("an") //Network Type
+ ANServiceInstance.setWorkloadContext("AN") //domain Type
logger.debug("completed AN service instance build "+ ANServiceInstance.toString())
String msg = ""
String sliceInstanceName = execution.getVariable("servicename")
ANServiceInstance.setServiceInstanceName(sliceInstanceName)
String serviceType = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "sST")
- ANServiceInstance.setServiceType(serviceType)
+ ANServiceInstance.setServiceType(execution.getVariable("sst"))
String serviceStatus = "deactivated"
ANServiceInstance.setOrchestrationStatus(serviceStatus)
String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "plmnIdList")
logger.debug("completed AN service instance build "+ ANServiceInstance.toString())
//create RAN NF NSSI
ANNFServiceInstance.setServiceInstanceId(execution.getVariable("RANNFServiceInstanceId"))
- sliceInstanceName = execution.getVariable("ANNF_modelName")
+ sliceInstanceName = "nssi_"+execution.getVariable("ANNF_modelName")
ANNFServiceInstance.setServiceInstanceName(sliceInstanceName)
- ANNFServiceInstance.setServiceType(serviceType)
+ ANNFServiceInstance.setServiceType(execution.getVariable("sst"))
ANNFServiceInstance.setOrchestrationStatus(serviceStatus)
serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "plmnIdList")
- ANNFServiceInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
+ ANNFServiceInstance.setServiceInstanceLocationId(jsonUtil.StringArrayToList(serviceInstanceLocationid).get(0))
ANNFServiceInstance.setServiceRole(serviceRole)
snssaiList = execution.getVariable("snssaiList")
snssai = snssaiList.get(0)
ANNFServiceInstance.setEnvironmentContext(snssai)
ANNFServiceInstance.setModelInvariantId(execution.getVariable("ANNF_modelInvariantUuid"))
ANNFServiceInstance.setModelVersionId(execution.getVariable("ANNF_modelUuid"))
- ANNFServiceInstance.setWorkloadContext("AN-NF")
+ ANNFServiceInstance.setWorkloadContext("AN_NF")
String serviceFunctionAnnf = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "resourceSharingLevel")
ANNFServiceInstance.setServiceFunction(serviceFunctionAnnf)
logger.debug("completed AN service instance build "+ ANNFServiceInstance.toString())
execution.setVariable("esrInfo", esrInfo.toString())
JsonObject serviceInfo = new JsonObject()
serviceInfo.addProperty("nsiId", execution.getVariable("nsiId"))
- String sST = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "sST")
- serviceInfo.addProperty("sST", sST)
+ serviceInfo.addProperty("sST", execution.getVariable("sst"))
serviceInfo.addProperty("PLMNIdList", objectMapper.writeValueAsString(execution.getVariable("plmnIdList")))
serviceInfo.addProperty("globalSubscriberId", execution.getVariable("globalSubscriberId"))
serviceInfo.addProperty("subscriptionServiceType", execution.getVariable("subscriptionServiceType"))
String requestId = execution.getVariable("msoRequestId")
Map<String,Object> sliceProfile = objectMapper.readValue(execution.getVariable("ranNfSliceProfile"), Map.class)
sliceProfile.put("sliceProfileId", execution.getVariable("ANNF_sliceProfileInstanceId"))
- sliceProfile.put("maxNumberofConns", sliceProfile.get("maxNumberofPDUSessions"))
+ sliceProfile.put("maxNumberofConns", sliceProfile.get("maxNumberofPDUSession"))
sliceProfile.put("uLThptPerSlice", sliceProfile.get("expDataRateUL"))
sliceProfile.put("dLThptPerSlice", sliceProfile.get("expDataRateDL"))
JsonObject commonHeader = new JsonObject()
JsonObject payload = new JsonObject()
JsonObject payloadInput = new JsonObject()
- commonHeader.addProperty("TimeStamp",new Date(System.currentTimeMillis()).format("yyyy-MM-dd'T'HH:mm:ss.sss'Z'", TimeZone.getDefault()))
+ commonHeader.addProperty("timeStamp",new Date(System.currentTimeMillis()).format("yyyy-MM-dd'T'HH:mm:ss.sss'Z'", TimeZone.getDefault()))
commonHeader.addProperty("api-ver", "1.0")
+ commonHeader.addProperty("originator-id", "testing")
commonHeader.addProperty("request-id", requestId)
commonHeader.addProperty("sub-request-id", "1")
- commonHeader.add("request-track", new JsonObject())
commonHeader.add("flags", new JsonObject())
Gson jsonConverter = new Gson()
payloadInput.add("sliceProfile", jsonConverter.toJsonTree(sliceProfile))
payloadInput.addProperty("NSIID", execution.getVariable("nsiId"))
payloadInput.addProperty("RANNFNSSIId", execution.getVariable("RANNFServiceInstanceId"))
payloadInput.addProperty("callbackURL", callbackUrl)
+ payloadInput.addProperty("globalSubscriberId", execution.getVariable("globalSubscriberId"))
+ payloadInput.addProperty("subscriptionServiceType", execution.getVariable("subscriptionServiceType"))
payloadInput.add("additionalproperties", new JsonObject())
payload.add("input", payloadInput)
input.add("common-header", commonHeader)
String bh_routeId = UUID.randomUUID().toString()
execution.setVariable("tranportEp_ID_bh", bh_routeId)
String role = "CU"
- String CU_IpAddress = jsonUtil.getJsonValue(bh_endpoint, "IpAddress")
- String LogicalLinkId = jsonUtil.getJsonValue(bh_endpoint, "LogicalLinkId")
+ String CU_IpAddress = jsonUtil.getJsonValue(bh_endpoint, "ipAddress")
+ String LogicalLinkId = jsonUtil.getJsonValue(bh_endpoint, "logicInterfaceId")
String nextHopInfo = jsonUtil.getJsonValue(bh_endpoint, "nextHopInfo")
NetworkRoute bh_ep = new NetworkRoute()
bh_ep.setRouteId(bh_routeId)