+ 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")
+ String sliceProfileId = jsonUtil.getJsonValue(sliceProfile, "sliceProfileId")
+ String nsiInfo = jsonUtil.getJsonValue(additionalPropJsonStr, "nsiInfo")
+ String scriptName = jsonUtil.getJsonValue(additionalPropJsonStr, "scriptName")
+ String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
+ String modelUuid = execution.getVariable("modelUuid")
+ String serviceInstanceID = execution.getVariable("TnServiceInstanceId")
+ String servicename = execution.getVariable("servicename")
+ String transportSliceNetworks = jsonUtil.getJsonValue(additionalPropJsonStr, "transportSliceNetworks")
+
+ JsonObject modifySliceParams = new JsonObject()
+ modifySliceParams.addProperty("nsiInfo", nsiInfo)
+ modifySliceParams.addProperty("serviceInstanceID", serviceInstanceID)
+ modifySliceParams.addProperty("servicename", servicename)
+ modifySliceParams.addProperty("sliceProfile", sliceProfile)
+ modifySliceParams.addProperty("sliceProfileId", sliceProfileId)
+ modifySliceParams.addProperty("modelInvariantUuid", modelInvariantUuid)
+ modifySliceParams.addProperty("modelUuid", modelUuid)
+ modifySliceParams.addProperty("scriptName", scriptName)
+ modifySliceParams.addProperty("snssaiList", snssaiList)
+ modifySliceParams.addProperty("transportSliceNetworks", transportSliceNetworks)
+
+ execution.setVariable("modifySliceParams", modifySliceParams.toString())
+
+ logger.debug(Prefix + "prepareModifyTnNssiInputs method finished")
+ }
+
+ def createModifyNssiQueryJobStatus = { DelegateExecution execution ->
+ logger.debug(Prefix + "createModifyNssiQueryJobStatus method start")
+ JsonObject esrInfo = new JsonObject()
+ esrInfo.addProperty("networkType", "tn")
+ esrInfo.addProperty("vendor", "ONAP_internal")
+
+ execution.setVariable("esrInfo", esrInfo.toString())
+
+ JsonObject serviceInfo = new JsonObject()
+ serviceInfo.addProperty("nssiId", execution.getVariable("TnServiceInstanceId") as String)
+ serviceInfo.addProperty("nsiId", execution.getVariable("nsiId") as String)
+ serviceInfo.addProperty("nssiName", execution.getVariable("servicename") as String)
+ serviceInfo.addProperty("sST", execution.getVariable("sst") as String)
+ serviceInfo.addProperty("PLMNIdList", objectMapper.writeValueAsString(execution.getVariable("pLMNIdList")))
+ serviceInfo.addProperty("globalSubscriberId", execution.getVariable("globalSubscriberId") as String)
+ serviceInfo.addProperty("subscriptionServiceType", execution.getVariable("subscriptionServiceType") as String)
+ serviceInfo.addProperty("serviceInvariantUuid", execution.getVariable("modelInvariantUuid") as String)
+ serviceInfo.addProperty("serviceUuid", execution.getVariable("modelUuid") as String)
+ execution.setVariable("serviceInfo", serviceInfo.toString())
+ execution.setVariable("responseId", "")
+ }
+
+ def processModifyJobStatusRsp = { DelegateExecution execution ->
+ logger.debug(Prefix + "processJobStatusRsp method start")
+ String jobResponse = execution.getVariable("jobResponse")
+ logger.debug("Job status response " + jobResponse)
+ String status = jsonUtil.getJsonValue(jobResponse, "status")
+ String nssi = jsonUtil.getJsonValue(jobResponse, "nssiId")
+ if (status.equalsIgnoreCase("finished")) {
+ logger.debug("Job successfully completed ... proceeding with flow for nssi : " + nssi)
+ }
+ else {
+ String statusDescription = jsonUtil.getJsonValue(jobResponse, "statusDescription")
+ logger.error("received failed status from job status query for nssi : " + nssi + " with status description : " + statusDescription)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "received failed status from job status query for nssi : " + nssi + " with status description : " + statusDescription)
+ }
+ }
+