From 66aa13b41e7b24895d8a601a011c40d7a83fce46 Mon Sep 17 00:00:00 2001 From: Reshmasree Date: Thu, 10 Sep 2020 03:47:24 -0700 Subject: Imlpement RAN NSSMF Modify Workflow Issue-ID: SO-3228 Signed-off-by: Reshmasree Change-Id: I49b99cfb0afbdd34a83ef81dac6a62301e79e4fd --- .../scripts/DoModifyAccessNSSI.groovy | 656 +++++++++++++++ .../scripts/DoModifyRanNfNssi.groovy | 193 +++++ .../resources/subprocess/DoModifyAccessNSSI.bpmn | 886 +++++++++++++++++++++ .../resources/subprocess/DoModifyRanNfNssi.bpmn | 91 +++ 4 files changed, 1826 insertions(+) create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyRanNfNssi.groovy create mode 100644 bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyAccessNSSI.bpmn create mode 100644 bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyRanNfNssi.bpmn (limited to 'bpmn') diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy new file mode 100644 index 0000000000..2e7e728b44 --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy @@ -0,0 +1,656 @@ +/* + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + # Copyright (c) 2020, Wipro Limited. + # + # Licensed under the Apache License, Version 2.0 (the "License") + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.scripts + +import org.camunda.bpm.engine.delegate.BpmnError +import org.camunda.bpm.engine.delegate.DelegateExecution +import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor +import org.onap.so.bpmn.common.scripts.ExceptionUtil +import org.onap.so.bpmn.common.scripts.NssmfAdapterUtils +import org.onap.so.bpmn.common.scripts.OofUtils +import org.onap.so.bpmn.common.scripts.RequestDBUtil +import org.onap.so.bpmn.core.json.JsonUtils +import org.onap.so.db.request.beans.ResourceOperationStatus +import org.slf4j.Logger +import org.slf4j.LoggerFactory +import java.sql.Timestamp +import java.util.List +import static org.apache.commons.lang3.StringUtils.isBlank +import com.google.gson.JsonObject +import com.fasterxml.jackson.databind.ObjectMapper +import com.google.gson.JsonArray +import org.onap.so.beans.nsmf.AllocateTnNssi +import org.onap.so.beans.nsmf.EsrInfo +import org.onap.so.bpmn.core.UrnPropertiesReader +import org.onap.so.bpmn.core.domain.ServiceDecomposition +import org.onap.so.bpmn.core.domain.ServiceProxy + +import org.onap.aai.domain.yang.Relationship +import org.onap.aai.domain.yang.ServiceInstance +import org.onap.aai.domain.yang.SliceProfile +import org.onap.aaiclient.client.aai.AAIObjectType +import org.onap.aaiclient.client.aai.AAIResourcesClient +import org.onap.aaiclient.client.aai.entities.AAIResultWrapper +import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri +import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory +import javax.ws.rs.NotFoundException + +class DoModifyAccessNSSI extends AbstractServiceTaskProcessor { + + String Prefix="MASS_" + ExceptionUtil exceptionUtil = new ExceptionUtil() + RequestDBUtil requestDBUtil = new RequestDBUtil() + JsonUtils jsonUtil = new JsonUtils() + OofUtils oofUtils = new OofUtils() + ObjectMapper objectMapper = new ObjectMapper(); + AnNssmfUtils anNssmfUtils = new AnNssmfUtils() + private NssmfAdapterUtils nssmfAdapterUtils = new NssmfAdapterUtils(httpClientFactory, jsonUtil) + + private static final Logger logger = LoggerFactory.getLogger(DoModifyAccessNSSI.class) + + @Override + void preProcessRequest(DelegateExecution execution) { + logger.debug(Prefix + "preProcessRequest Start") + execution.setVariable("prefix", Prefix) + execution.setVariable("startTime", System.currentTimeMillis()) + def msg + try { + + logger.debug("input variables : msoRequestId - "+execution.getVariable("msoRequestId")+ + " globalSubscriberId - "+execution.getVariable("globalSubscriberId")+ + " serviceInstanceID - "+execution.getVariable("serviceInstanceID")+ + " nsiId - "+execution.getVariable("nsiId")+ + " networkType - "+execution.getVariable("networkType")+ + " subscriptionServiceType - "+execution.getVariable("subscriptionServiceType")+ + " jobId - "+execution.getVariable("jobId")+ + " sliceParams - "+execution.getVariable("sliceParams")+ + " servicename - "+ execution.getVariable("servicename")) + + //validate slice subnet inputs + + String sliceParams = execution.getVariable("sliceParams") + String modifyAction = jsonUtil.getJsonValue(sliceParams, "modifyAction") + if (isBlank(modifyAction)) { + msg = "Input modifyAction is null" + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } else { + execution.setVariable("modifyAction", modifyAction) + switch(modifyAction) { + case "allocate": + execution.setVariable("isModifyallocate", true) + break + case "deallocate": + execution.setVariable("isModifydeallocate", true) + break + case "reconfigure": + execution.setVariable("isModifyreconfigure", true) + String resourceConfig = jsonUtil.getJsonValue(sliceParams, "resourceConfig") + execution.setVariable("additionalProperties", resourceConfig) + break + default: + logger.debug("Invalid modify Action") + exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Invalid modify Action : "+modifyAction) + } + } + List snssaiList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceParams, "snssaiList")) + String sliceProfileId = jsonUtil.getJsonValue(sliceParams, "sliceProfileId") + if (isBlank(sliceProfileId) || (snssaiList.empty)) { + msg = "Mandatory fields are empty" + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } else { + execution.setVariable("sliceProfileId", sliceProfileId) + execution.setVariable("snssaiList", snssaiList) + } + String nsiName = jsonUtil.getJsonValue(sliceParams, "nsiInfo.nsiName") + String scriptName = jsonUtil.getJsonValue(sliceParams, "scriptName") + execution.setVariable("nsiName", nsiName) + execution.setVariable("scriptName", scriptName) + execution.setVariable("job_timeout", 10) + execution.setVariable("ranNssiPreferReuse", false) + } catch(BpmnError e) { + throw e + } catch(Exception ex) { + msg = "Exception in DoModifyAccessNSSI.preProcessRequest " + ex.getMessage() + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + logger.debug(Prefix + "preProcessRequest Exit") + } + + def getSliceProfile = { DelegateExecution execution -> + logger.debug(Prefix + "getSliceProfiles Start") + String instanceId = execution.getVariable("sliceProfileId") + ServiceInstance sliceProfileInstance = getServiceInstance(execution, instanceId) + SliceProfile ranSliceProfile = sliceProfileInstance.getSliceProfiles().getSliceProfile().get(0) + logger.debug("RAN slice profile : "+ranSliceProfile.toString()) + execution.setVariable("RANSliceProfile", ranSliceProfile) + execution.setVariable("ranSliceProfileInstance", sliceProfileInstance) + } + + /* + * Function to subnet capabilities from nssmf adapter + */ + def getSubnetCapabilities = { DelegateExecution execution -> + logger.debug(Prefix+"getSubnetCapabilities method start") + + String tnNssmfRequest = anNssmfUtils.buildCreateTNNSSMFSubnetCapabilityRequest() + + String urlString = "/api/rest/provMns/v1/NSS/subnetCapabilityQuery" + + String tnNssmfResponse = nssmfAdapterUtils.sendPostRequestNSSMF(execution, urlString, tnNssmfRequest) + + if (tnNssmfResponse != null) { + String FHCapabilities= jsonUtil.getJsonValue(tnNssmfResponse, "TN_FH") + String MHCapabilities = jsonUtil.getJsonValue(tnNssmfResponse, "TN_MH") + execution.setVariable("FHCapabilities",FHCapabilities) + execution.setVariable("MHCapabilities",MHCapabilities) + + } else { + logger.error("received error message from NSSMF : "+ tnNssmfResponse) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000,"Received a Bad Sync Response from NSSMF.") + } + String anNssmfRequest = anNssmfUtils.buildCreateANNFNSSMFSubnetCapabilityRequest() + + String anNssmfResponse = nssmfAdapterUtils.sendPostRequestNSSMF(execution, urlString, anNssmfRequest) + + if (anNssmfResponse != null) { + String ANNFCapabilities = jsonUtil.getJsonValue(anNssmfResponse, "AN_NF") + execution.setVariable("ANNFCapabilities",ANNFCapabilities) + + } else { + logger.error("received error message from NSSMF : "+ anNssmfResponse) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000,"Received a Bad Sync Response from NSSMF.") + } + } + + + /* + * prepare OOF request for RAN NSSI selection + */ + def prepareOofRequestForRanNSS = { DelegateExecution execution -> + logger.debug(Prefix+"prepareOofRequestForRanNSS method start") + + String urlString = UrnPropertiesReader.getVariable("mso.oof.endpoint", execution) + logger.debug( "get NSSI option OOF Url: " + urlString) + + //build oof request body + boolean ranNssiPreferReuse = execution.getVariable("ranNssiPreferReuse"); + String requestId = execution.getVariable("msoRequestId") + String messageType = "NSISelectionResponse" + Map profileInfo = objectMapper.readValue(execution.getVariable("RANSliceProfile"), Map.class) + ServiceInstance ranSliceProfileInstance = objectMapper.readValue(execution.getVariable("ranSliceProfileInstance"), ServiceInstance.class) + String modelUuid = ranSliceProfileInstance.getModelVersionId() + String modelInvariantUuid = ranSliceProfileInstance.getModelInvariantId() + String modelName = execution.getVariable("servicename") + String timeout = UrnPropertiesReader.getVariable("mso.adapters.oof.timeout", execution); + List nsstInfoList = new ArrayList<>() + JsonArray capabilitiesList = new JsonArray() + String FHCapabilities = execution.getVariable("FHCapabilities") + String MHCapabilities = execution.getVariable("MHCapabilities") + String ANNFCapabilities = execution.getVariable("ANNFCapabilities") + JsonObject FH = new JsonObject() + JsonObject MH = new JsonObject() + JsonObject ANNF = new JsonObject() + FH.addProperty("domainType", "TN_FH") + FH.addProperty("capabilityDetails", FHCapabilities) + MH.addProperty("domainType", "TN_MH") + MH.addProperty("capabilityDetails", MHCapabilities) + ANNF.addProperty("domainType", "AN_NF") + ANNF.addProperty("capabilityDetails", FHCapabilities) + capabilitiesList.add(FH) + capabilitiesList.add(MH) + capabilitiesList.add(ANNF) + + execution.setVariable("nssiSelection_Url", "/api/oof/selection/nsi/v1") + execution.setVariable("nssiSelection_messageType",messageType) + execution.setVariable("nssiSelection_correlator",requestId) + execution.setVariable("nssiSelection_timeout",timeout) + String oofRequest = anNssmfUtils.buildSelectRANNSSIRequest(requestId, messageType, modelUuid,modelInvariantUuid, + modelName, profileInfo, nsstInfoList, capabilitiesList, ranNssiPreferReuse) + + execution.setVariable("nssiSelection_oofRequest",oofRequest) + logger.debug("Sending request to OOF: " + oofRequest) + } + + /* + * process OOF response for RAN NSSI selection + */ + def processOofResponseForRanNSS = { DelegateExecution execution -> + logger.debug(Prefix+"processOofResponseForRanNSS method start") + String oofResponse = execution.getVariable("nssiSelection_asyncCallbackResponse") + String requestStatus = jsonUtil.getJsonValue(oofResponse, "requestStatus") + if(requestStatus.equals("completed")) { + List solution = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(oofResponse, "solutions")) + boolean existingNSI = jsonUtil.getJsonValue(solution.get(0), "existingNSI") + if(!existingNSI) { + def sliceProfiles = jsonUtil.getJsonValue(solution.get(0), "newNSISolution.sliceProfiles") + execution.setVariable("RanConstituentSliceProfiles", sliceProfiles) + List ranConstituentSliceProfiles = jsonUtil.StringArrayToList(sliceProfiles) + anNssmfUtils.createDomainWiseSliceProfiles(ranConstituentSliceProfiles, execution) + logger.debug("RanConstituentSliceProfiles list from OOF "+sliceProfiles) + }else { + String statusMessage = jsonUtil.getJsonValue(oofResponse, "statusMessage") + logger.error("failed to get slice profiles from oof "+ statusMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000,"failed to get slice profiles from oof "+statusMessage) + } + }else { + String statusMessage = jsonUtil.getJsonValue(oofResponse, "statusMessage") + logger.error("received failed status from oof "+ statusMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000,"Received a failed Async Response from OOF : "+statusMessage) + } + + } + def getNssisFromAai = { DelegateExecution execution -> + logger.debug(Prefix+"getNssisFromAai method start") + String instanceId = execution.getVariable("serviceInstanceID") + String role = "nssi" + Map ranConstituentNssis = getRelatedInstancesByRole(execution, role, instanceId) + logger.debug("getNssisFromAai ranConstituentNssis : "+ranConstituentNssis.toString()) + ranConstituentNssis.each { key, val -> + switch(key) { + case "AN-NF": + execution.setVariable("ANNF_NSSI", val.getServiceInstanceId()) + execution.setVariable("ANNF_nssiName", val.getServiceInstanceName()) + break + case "TN-FH": + execution.setVariable("TNFH_NSSI", val.getServiceInstanceId()) + execution.setVariable("TNFH_nssiName", val.getServiceInstanceName()) + break + case "TN-MH": + execution.setVariable("TNMH_NSSI", val.getServiceInstanceId()) + execution.setVariable("TNMH_nssiName", val.getServiceInstanceName()) + break + default: + logger.error("No expected match found for current domainType "+ key) + exceptionUtil.buildAndThrowWorkflowException(execution, 1000,"No expected match found for current domainType "+ key) + } + } + + } + def createSliceProfiles = { DelegateExecution execution -> + logger.debug(Prefix+"createSliceProfiles method start") + anNssmfUtils.createSliceProfilesInAai(execution) + } + def updateRelationshipInAai = { DelegateExecution execution -> + logger.debug(Prefix+"updateRelationshipInAai method start") + String msg = "" + try { + def ANNF_serviceInstanceId = execution.getVariable("ANNF_NSSI") + def TNFH_serviceInstanceId = execution.getVariable("TNFH_NSSI") + def TNMH_serviceInstanceId = execution.getVariable("TNMH_NSSI") + def AN_profileInstanceId = execution.getVariable("sliceProfileId") + def ANNF_profileInstanceId = execution.getVariable("ANNF_sliceProfileInstanceId") + def TNFH_profileInstanceId = execution.getVariable("TNFH_sliceProfileInstanceId") + def TNMH_profileInstanceId = execution.getVariable("TNMH_sliceProfileInstanceId") + String globalSubscriberId = execution.getVariable("globalSubscriberId") + String subscriptionServiceType = execution.getVariable("subscriptionServiceType") + + Relationship ANNF_relationship = new Relationship() + Relationship TNFH_relationship = new Relationship() + Relationship TNMH_relationship = new Relationship() + + String ANNF_relatedLink = "aai/v16/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${ANNF_profileInstanceId}" + String TNFH_relatedLink = "aai/v16/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${TNFH_profileInstanceId}" + String TNMH_relatedLink = "aai/v16/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${TNMH_profileInstanceId}" + + ANNF_relationship.setRelatedLink(ANNF_relatedLink) + ANNF_relationship.setRelatedTo("service-instance") + ANNF_relationship.setRelationshipLabel("org.onap.relationships.inventory.ComposedOf") + TNFH_relationship.setRelatedLink(TNFH_relatedLink) + TNFH_relationship.setRelatedTo("service-instance") + TNFH_relationship.setRelationshipLabel("org.onap.relationships.inventory.ComposedOf") + TNMH_relationship.setRelatedLink(TNMH_relatedLink) + TNMH_relationship.setRelatedTo("service-instance") + TNMH_relationship.setRelationshipLabel("org.onap.relationships.inventory.ComposedOf") + + // create SliceProfile and NSSI relationship in AAI + anNssmfUtils.createRelationShipInAAI(execution, ANNF_relationship,ANNF_serviceInstanceId) + anNssmfUtils.createRelationShipInAAI(execution, TNFH_relationship,TNFH_serviceInstanceId) + anNssmfUtils.createRelationShipInAAI(execution, TNMH_relationship,TNMH_serviceInstanceId) + anNssmfUtils.createRelationShipInAAI(execution, ANNF_relationship,AN_profileInstanceId) + anNssmfUtils.createRelationShipInAAI(execution, TNFH_relationship,AN_profileInstanceId) + anNssmfUtils.createRelationShipInAAI(execution, TNMH_relationship,AN_profileInstanceId) + + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + + msg = "Exception in DoCreateE2EServiceInstance.createCustomRelationship. " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + } + + def processRanNfModifyRsp = { DelegateExecution execution -> + logger.debug(Prefix+"processRanNfModifyRsp method start") + anNssmfUtils.processRanNfModifyRsp(execution) + } + + def prepareTnFhRequest = { DelegateExecution execution -> + logger.debug(Prefix+"prepareTnFhRequest method start") + + String nssmfRequest = anNssmfUtils.buildCreateNSSMFRequest(execution, "TN_FH", "modify-allocate") + String urlString = "/api/rest/provMns/v1/NSS/SliceProfiles" + String nssmfResponse = nssmfAdapterUtils.sendPostRequestNSSMF(execution, urlString, nssmfRequest) + + if (nssmfResponse != null) { + execution.setVariable("nssmfResponse", nssmfResponse) + String jobId = jsonUtil.getJsonValue(nssmfResponse, "jobId") + execution.setVariable("TNFH_jobId",jobId) + } else { + logger.error("received error message from NSSMF : "+ nssmfResponse) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000,"Received a Bad Sync Response from NSSMF.") + } + logger.debug("Exit prepareTnFhRequest") + + } + def prepareTnMhRequest = { DelegateExecution execution -> + logger.debug(Prefix+"prepareTnMhRequest method start") + + String nssmfRequest = anNssmfUtils.buildCreateNSSMFRequest(execution, "TN_MH", "modify-allocate") + String urlString = "/api/rest/provMns/v1/NSS/SliceProfiles" + String nssmfResponse = nssmfAdapterUtils.sendPostRequestNSSMF(execution, urlString, nssmfRequest) + + if (nssmfResponse != null) { + execution.setVariable("nssmfResponse", nssmfResponse) + String jobId = jsonUtil.getJsonValue(nssmfResponse, "jobId") + execution.setVariable("TNMH_jobId",jobId) + } else { + logger.error("received error message from NSSMF : "+ nssmfResponse) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000,"Received a Bad Sync Response from NSSMF.") + } + logger.debug("Exit prepareTnMhRequest") + } + + def createFhAllocateNssiJobQuery = { DelegateExecution execution -> + logger.debug(Prefix+"createModifyNssiQueryJobStatus method start") + createTnAllocateNssiJobQuery(execution, "TN_FH") + } + + def createMhAllocateNssiJobQuery = { DelegateExecution execution -> + logger.debug(Prefix+"createModifyNssiQueryJobStatus method start") + createTnAllocateNssiJobQuery(execution, "TN_MH") + } + + private void createTnAllocateNssiJobQuery(DelegateExecution execution, String domainType) { + EsrInfo esrInfo = new EsrInfo() + esrInfo.setNetworkType("TN") + esrInfo.setVendor("ONAP") + String esrInfoString = objectMapper.writeValueAsString(esrInfo) + execution.setVariable("esrInfo", esrInfoString) + JsonObject serviceInfo = new JsonObject() + + serviceInfo.addProperty("nsiId", execution.getVariable("nsiId")) + String sST = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "sST") + serviceInfo.addProperty("sST", sST) + serviceInfo.addProperty("PLMNIdList", objectMapper.writeValueAsString(execution.getVariable("plmnIdList"))) + serviceInfo.addProperty("globalSubscriberId", execution.getVariable("globalSubscriberId")) + serviceInfo.addProperty("subscriptionServiceType", execution.getVariable("subscriptionServiceType")) + serviceInfo.addProperty("serviceInvariantUuid", null) + serviceInfo.addProperty("serviceUuid", null) + if(domainType.equals("TN_FH")) { + serviceInfo.addProperty("nssiId", execution.getVariable("TNFH_NSSI")) + serviceInfo.addProperty("nssiName", execution.getVariable("TNFH_nssiName")) + }else if(domainType.equals("TN_MH")) { + serviceInfo.addProperty("nssiId", execution.getVariable("TNMH_NSSI")) + serviceInfo.addProperty("nssiName", execution.getVariable("TNMH_nssiName")) + } + execution.setVariable("serviceInfo", serviceInfo.toString()) + execution.setVariable("responseId", "") + } + + def processFhAllocateNssiJobStatusRsp = { DelegateExecution execution -> + logger.debug(Prefix+"processJobStatusRsp method start") + String jobResponse = execution.getVariable("TNFH_jobResponse") + logger.debug("Job status response "+jobResponse) + String status = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.status") + String nssi = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.nssi") + if(status.equalsIgnoreCase("finished")) { + logger.debug("Job successfully completed ... proceeding with flow for nssi : "+nssi) + } + else { + String statusDescription = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.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) + } + } + + def processMhAllocateNssiJobStatusRsp = { DelegateExecution execution -> + logger.debug(Prefix+"processJobStatusRsp method start") + String jobResponse = execution.getVariable("TNMH_jobResponse") + logger.debug("Job status response "+jobResponse) + String status = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.status") + String nssi = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.nssi") + if(status.equalsIgnoreCase("finished")) { + logger.debug("Job successfully completed ... proceeding with flow for nssi : "+nssi) + } + else { + String statusDescription = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.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) + } + } + + def getSliceProfilesFromAai = { DelegateExecution execution -> + logger.debug(Prefix+"getSliceProfilesFromAai method start") + String instanceId = execution.getVariable("sliceProfileId") + String role = "slice-profile-instance" + Map ranConstituentSliceProfiles = getRelatedInstancesByRole(execution, role, instanceId) + logger.debug("getSliceProfilesFromAai ranConstituentSliceProfiles : "+ranConstituentSliceProfiles.toString()) + ranConstituentSliceProfiles.each { key, val -> + switch(key) { + case "AN-NF": + execution.setVariable("ANNF_sliceProfileInstanceId", val.getServiceInstanceId()) + break + case "TN-FH": + execution.setVariable("TNFH_sliceProfileInstanceId", val.getServiceInstanceId()) + break + case "TN-MH": + execution.setVariable("TNMH_sliceProfileInstanceId", val.getServiceInstanceId()) + break + default: + logger.error("No expected match found for current domainType "+ key) + exceptionUtil.buildAndThrowWorkflowException(execution, 1000,"No expected match found for current domainType "+ key) + } + } + } + + def prepareTnFhDeallocateRequest = { DelegateExecution execution -> + logger.debug(Prefix+"prepareTnFhDeallocateRequest method start") + String nssmfRequest = anNssmfUtils.buildDeallocateNssiRequest(execution, "TN_FH") + String nssiId = execution.getVariable("TNFH_NSSI") + execution.setVariable("tnFHNSSIId", nssiId) + String urlString = "/api/rest/provMns/v1/NSS/nssi/" + nssiId + String nssmfResponse = nssmfAdapterUtils.sendPostRequestNSSMF(execution, urlString, nssmfRequest) + if (nssmfResponse != null) { + String jobId = jsonUtil.getJsonValue(nssmfResponse, "jobId") + execution.setVariable("TN_FH_jobId",jobId) + } else { + logger.error("received error message from NSSMF : "+ nssmfResponse) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000,"Received a Bad Sync Response from NSSMF.") + } + } + + def prepareTnMhDeallocateRequest = { DelegateExecution execution -> + logger.debug(Prefix+"prepareTnFhDeallocateRequest method start") + String nssmfRequest = anNssmfUtils.buildDeallocateNssiRequest(execution, "TN_FH") + String nssiId = execution.getVariable("TNFH_NSSI") + execution.setVariable("tnFHNSSIId", nssiId) + String urlString = "/api/rest/provMns/v1/NSS/nssi/" + nssiId + String nssmfResponse = nssmfAdapterUtils.sendPostRequestNSSMF(execution, urlString, nssmfRequest) + if (nssmfResponse != null) { + String jobId = jsonUtil.getJsonValue(nssmfResponse, "jobId") + execution.setVariable("TN_MH_jobId",jobId) + } else { + logger.error("received error message from NSSMF : "+ nssmfResponse) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000,"Received a Bad Sync Response from NSSMF.") + } + } + + def createFhDeAllocateNssiJobQuery = { DelegateExecution execution -> + logger.debug(Prefix+"createModifyNssiQueryJobStatus method start") + createTnAllocateNssiJobQuery(execution, "TN_FH") + } + + def createMhDeAllocateNssiJobQuery = { DelegateExecution execution -> + logger.debug(Prefix+"createModifyNssiQueryJobStatus method start") + createTnAllocateNssiJobQuery(execution, "TN_MH") + } + def deleteFhSliceProfile = { DelegateExecution execution -> + logger.debug(Prefix+"deleteFhSliceProfile method start") + deleteServiceInstanceInAAI(execution,execution.getVariable("TNFH_sliceProfileInstanceId")) + } + def deleteMhSliceProfile = { DelegateExecution execution -> + logger.debug(Prefix+"deleteMhSliceProfile method start") + deleteServiceInstanceInAAI(execution,execution.getVariable("TNMH_sliceProfileInstanceId")) + } + def deleteAnSliceProfile = { DelegateExecution execution -> + logger.debug(Prefix+"deleteAnSliceProfile method start") + deleteServiceInstanceInAAI(execution,execution.getVariable("ANNF_sliceProfileInstanceId")) + } + /** + * update operation status in request db + * + */ + def prepareOperationStatusUpdate = { DelegateExecution execution -> + logger.debug(Prefix + "prepareOperationStatusUpdate Start") + + String serviceId = execution.getVariable("serviceInstanceID") + String jobId = execution.getVariable("jobId") + String nsiId = execution.getVariable("nsiId") + String nssiId = execution.getVariable("serviceInstanceID") + logger.debug("Service Instance serviceId:" + serviceId + " jobId:" + jobId) + + ResourceOperationStatus updateStatus = new ResourceOperationStatus() + updateStatus.setServiceId(serviceId) + updateStatus.setOperationId(jobId) + updateStatus.setResourceTemplateUUID(nsiId) + updateStatus.setResourceInstanceID(nssiId) + updateStatus.setOperType("Modify") + updateStatus.setProgress(100) + updateStatus.setStatus("finished") + requestDBUtil.prepareUpdateResourceOperationStatus(execution, updateStatus) + + logger.debug(Prefix + "prepareOperationStatusUpdate Exit") + } + + def prepareFailedOperationStatusUpdate = { DelegateExecution execution -> + logger.debug(Prefix + "prepareFailedOperationStatusUpdate Start") + + String serviceId = execution.getVariable("serviceInstanceID") + String jobId = execution.getVariable("jobId") + String nsiId = execution.getVariable("nsiId") + String nssiId = execution.getVariable("serviceInstanceID") + logger.debug("Service Instance serviceId:" + serviceId + " jobId:" + jobId) + + ResourceOperationStatus updateStatus = new ResourceOperationStatus() + updateStatus.setServiceId(serviceId) + updateStatus.setOperationId(jobId) + updateStatus.setResourceTemplateUUID(nsiId) + updateStatus.setResourceInstanceID(nssiId) + updateStatus.setOperType("Modify") + updateStatus.setProgress(0) + updateStatus.setStatus("failed") + requestDBUtil.prepareUpdateResourceOperationStatus(execution, updateStatus) + } + + /** + * @param execution + * @param role - nssi/slice profile instance + * @param instanceId - id to which the related list to be found + * @return + */ + private Map getRelatedInstancesByRole(DelegateExecution execution,String role,String instanceId) { + logger.debug("${Prefix} - Fetching related ${role} from AAI") + String globalSubscriberId = execution.getVariable("globalSubscriberId") + String subscriptionServiceType = execution.getVariable("subscriptionServiceType") + + Map relatedInstances = new HashMap<>() + + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, + globalSubscriberId, subscriptionServiceType, instanceId) + if (!client.exists(uri)) { + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Service Instance was not found in aai : ${instanceId}") + } + AAIResultWrapper wrapper = client.get(uri, NotFoundException.class) + Optional si = wrapper.asBean(ServiceInstance.class) + if(si.isPresent()) { + List relationshipList = si.get().getRelationshipList().getRelationship() + for (Relationship relationship : relationshipList) { + String relatedTo = relationship.getRelatedTo() + if (relatedTo.toLowerCase() == "service-instance") { + String relatioshipurl = relationship.getRelatedLink() + String serviceInstanceId = + relatioshipurl.substring(relatioshipurl.lastIndexOf("/") + 1, relatioshipurl.length()) + + AAIResourcesClient client01 = new AAIResourcesClient() + AAIResourceUri uri01 = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, + globalSubscriberId, subscriptionServiceType, serviceInstanceId) + if (!client.exists(uri01)) { + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, + "Service Instance was not found in aai: ${serviceInstanceId} related to ${instanceId}") + } + AAIResultWrapper wrapper01 = client01.get(uri01, NotFoundException.class) + Optional serviceInstance = wrapper01.asBean(ServiceInstance.class) + if (serviceInstance.isPresent()) { + ServiceInstance instance = serviceInstance.get() + if (role.equalsIgnoreCase(instance.getServiceRole())) { + relatedInstances.put(instance.getWorkloadContext(),instance) + } + } + } + } + } + logger.debug("Found ${relatedInstances.size()} ${role} related to ${instanceId} ") + return relatedInstances + } + + private ServiceInstance getServiceInstance(DelegateExecution execution, String instanceId) { + String globalSubscriberId = execution.getVariable("globalSubscriberId") + String subscriptionServiceType = execution.getVariable("subscriptionServiceType") + ServiceInstance serviceInstance = new ServiceInstance() + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, + globalSubscriberId, subscriptionServiceType, instanceId) + if (!client.exists(uri)) { + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Service Instance was not found in aai : ${instanceId}") + } + AAIResultWrapper wrapper = client.get(uri, NotFoundException.class) + Optional si = wrapper.asBean(ServiceInstance.class) + + if(si.isPresent()) { + serviceInstance = si + } + return serviceInstance + } + private void deleteServiceInstanceInAAI(DelegateExecution execution,String instanceId) { + try { + AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, execution.getVariable("globalSubscriberId"), execution.getVariable("serviceType"), instanceId) + getAAIClient().delete(serviceInstanceUri) + logger.debug("${Prefix} Exited deleteServiceInstance") + }catch(Exception e){ + logger.debug("Error occured within deleteServiceInstance method: " + e) + } + } +} \ No newline at end of file diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyRanNfNssi.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyRanNfNssi.groovy new file mode 100644 index 0000000000..6fdfbe3218 --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyRanNfNssi.groovy @@ -0,0 +1,193 @@ +/* + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + # Copyright (c) 2020, Wipro Limited. + # + # Licensed under the Apache License, Version 2.0 (the "License") + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.scripts + +import org.camunda.bpm.engine.delegate.BpmnError +import org.slf4j.Logger +import org.slf4j.LoggerFactory +import org.camunda.bpm.engine.delegate.DelegateExecution +import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor +import org.onap.so.bpmn.common.scripts.ExceptionUtil +import org.onap.so.bpmn.core.json.JsonUtils +import com.fasterxml.jackson.databind.ObjectMapper +import com.google.gson.JsonObject +import java.sql.Timestamp + +import static org.apache.commons.lang3.StringUtils.isBlank +import org.onap.so.bpmn.core.UrnPropertiesReader + +class DoModifyRanNfNssi extends AbstractServiceTaskProcessor { + + String Prefix="MANNFNSS_" + ExceptionUtil exceptionUtil = new ExceptionUtil() + JsonUtils jsonUtil = new JsonUtils() + ObjectMapper objectMapper = new ObjectMapper(); + AnNssmfUtils anNssmfUtils = new AnNssmfUtils() + + private static final Logger logger = LoggerFactory.getLogger(DoModifyRanNfNssi.class) + + @Override + void preProcessRequest(DelegateExecution execution) { + logger.debug(Prefix + "preProcessRequest Start") + execution.setVariable("prefix", Prefix) + execution.setVariable("startTime", System.currentTimeMillis()) + def msg + try { + + logger.debug("input variables : msoRequestId - "+execution.getVariable("msoRequestId")+ + " globalSubscriberId - "+execution.getVariable("globalSubscriberId")+ + " serviceInstanceID - "+execution.getVariable("serviceInstanceID")+ + " subscriptionServiceType - "+execution.getVariable("subscriptionServiceType")+ + " sliceProfileId - "+execution.getVariable("sliceProfileId")+ + " snssaiList - "+execution.getVariable("snssaiList")+ + " modifyAction - "+execution.getVariable("modifyAction")) + + //validate RAN NF slice subnet inputs + + String modifyAction = execution.getVariable("modifyAction") + if (isBlank(modifyAction)) { + msg = "Input modifyAction is null" + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } else { + execution.setVariable("modifyAction", modifyAction) + switch(modifyAction) { + case "allocate": + String sliceProfile = execution.getVariable("additionalProperties") + execution.setVariable("sliceProfile", sliceProfile) + break + case "reconfigure": + String resourceConfig = execution.getVariable("additionalProperties") + execution.setVariable("resourceConfig", resourceConfig) + break + default: + logger.debug("Invalid modify Action") + exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Invalid modify Action : "+modifyAction) + } + } + List snssaiList = objectMapper.readValue(execution.getVariable("snssaiList"), List.class) + String sliceProfileId = execution.getVariable("sliceProfileId") + if (isBlank(sliceProfileId) || (snssaiList.empty)) { + msg = "Mandatory fields are empty" + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } else { + execution.setVariable("sliceProfileId", sliceProfileId) + execution.setVariable("snssaiList", snssaiList) + execution.setVariable("snssai", snssaiList.get(0)) + } + + } catch(BpmnError e) { + throw e + } catch(Exception ex) { + msg = "Exception in DoModifyAccessNssi.preProcessRequest " + ex.getMessage() + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + logger.debug(Prefix + "preProcessRequest Exit") + } + + def createSdnrRequest = { DelegateExecution execution -> + logger.debug(Prefix+"createSdnrRequest method start") + String callbackUrl = UrnPropertiesReader.getVariable("mso.workflow.message.endpoint") + "/AsyncSdnrResponse/"+execution.getVariable("msoRequestId") + String modifyAction = execution.getVariable("modifyAction") + String sdnrRequest = buildSdnrAllocateRequest(execution, modifyAction, "InstantiateRANSlice", callbackUrl) + execution.setVariable("createNSSI_sdnrRequest", sdnrRequest) + execution.setVariable("createNSSI_timeout", "PT10M") + execution.setVariable("createNSSI_correlator", execution.getVariable("msoRequestId")) + execution.setVariable("createNSSI_messageType", "AsyncSdnrResponse"); + } + + def processSdnrResponse = { DelegateExecution execution -> + logger.debug(Prefix+"processSdnrResponse method start") + String SDNRResponse = execution.getVariable("SDNR_asyncCallbackResponse") + String status = jsonUtil.getJsonValue(SDNRResponse, "status") + if(status.equalsIgnoreCase("success")) { + String nfIds = jsonUtil.getJsonValue(SDNRResponse, "nfIds") + execution.setVariable("ranNfIdsJson", nfIds) + }else { + String reason = jsonUtil.getJsonValue(SDNRResponse, "reason") + logger.error("received failed status from SDNR "+ reason) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000,"received failed status from SDNR "+ reason) + } + logger.debug("response from SDNR "+SDNRResponse) + } + + private String buildSdnrAllocateRequest(DelegateExecution execution, String action, String rpcName, String callbackUrl) { + + String requestId = execution.getVariable("msoRequestId") + Date date = new Date().getTime() + Timestamp time = new Timestamp(date) + String sliceProfileString + JsonObject response = new JsonObject() + JsonObject body = new JsonObject() + JsonObject input = new JsonObject() + JsonObject commonHeader = new JsonObject() + JsonObject payload = new JsonObject() + JsonObject payloadInput = new JsonObject() + if(action.equals("allocate")) { + Map sliceProfile = objectMapper.readValue(execution.getVariable("sliceProfile"), Map.class) + sliceProfile.put("sliceProfileId", execution.getVariable("sliceProfileId")) + sliceProfile.put("maxNumberofConns", sliceProfile.get("maxNumberofPDUSessions")) + sliceProfile.put("uLThptPerSlice", sliceProfile.get("expDataRateUL")) + sliceProfile.put("dLThptPerSlice", sliceProfile.get("expDataRateDL")) + sliceProfileString = objectMapper.writeValueAsString(sliceProfile) + action = "modify-"+action + payloadInput.add("additionalproperties", new JsonObject()) + }else if(action.equals("deallocate")) { + action = "modify-"+action + Map sliceProfile = new HashMap<>() + sliceProfile.put("sliceProfileId", execution.getVariable("sliceProfileId")) + sliceProfile.put("sNSSAI", execution.getVariable("snssai")) + sliceProfileString = objectMapper.writeValueAsString(sliceProfile) + payloadInput.add("additionalproperties", new JsonObject()) + }else if(action.equals("reconfigure")) { + Map sliceProfile = new HashMap<>() + sliceProfile.put("sliceProfileId", execution.getVariable("sliceProfileId")) + sliceProfile.put("sNSSAI", execution.getVariable("snssai")) + sliceProfileString = objectMapper.writeValueAsString(sliceProfile) + JsonObject resourceconfig = new JsonObject() + resourceconfig.addProperty("resourceConfig", execution.getVariable("resourceConfig")) + payloadInput.add("additionalproperties", resourceconfig) + } + commonHeader.addProperty("TimeStamp", time.toString()) + commonHeader.addProperty("APIver", "1.0") + commonHeader.addProperty("RequestID", requestId) + commonHeader.addProperty("SubRequestID", "1") + commonHeader.add("RequestTrack", new JsonObject()) + commonHeader.add("Flags", new JsonObject()) + payloadInput.addProperty("sliceProfile", sliceProfileString) + payloadInput.addProperty("RANNFNSSIId", execution.getVariable("serviceInstanceID")) + payloadInput.addProperty("callbackURL", callbackUrl) + payload.add("input", payloadInput) + input.add("CommonHeader", commonHeader) + input.addProperty("Action", action) + input.add("Payload", payload) + body.add("input", input) + response.add("body", body) + response.addProperty("version", "1.0") + response.addProperty("rpc-name", rpcName) + response.addProperty("correlation-id", requestId+"-1") + response.addProperty("type", "request") + return response.toString() + } + +} \ No newline at end of file diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyAccessNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyAccessNSSI.bpmn new file mode 100644 index 0000000000..c62b143932 --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyAccessNSSI.bpmn @@ -0,0 +1,886 @@ + + + + + Flow_1yfvjui + + + Flow_1yfvjui + Flow_09sxq6k + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.preProcessRequest(execution) + + + Flow_0hzibw4 + Flow_0714cfa + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.prepareOofRequestForRanNSS(execution) + + + + + + + + + + + + Flow_0714cfa + Flow_0ei9866 + + + Flow_0ei9866 + Flow_14xj79h + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.processOofResponseForRanNSS(execution) + + + + + + Flow_09sxq6k + Flow_1ycw1zo + Flow_1orjrjp + Flow_1p5ruyv + + + #{(execution.getVariable("isModifyallocate" ) == true)} + + + #{(execution.getVariable("isModifydeallocate" ) == true)} + + + Flow_1ycw1zo + Flow_1ym755g + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.getSliceProfile(execution) + + + + #{(execution.getVariable("isModifyreconfigure" ) == true)} + + + Flow_14xj79h + Flow_1fpw4gf + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.getNssisFromAai(execution) + + + + + Flow_05cl21h + Flow_1jwk3jy + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.updateRelationshipInAai(execution) + + + Flow_1fpw4gf + Flow_05cl21h + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.createSliceProfiles(execution) + + + + Flow_1jwk3jy + + + + Flow_06hymr5 + + + + + + + + + + + + + + + Flow_06hymr5 + Flow_19p3d5t + + + Flow_19p3d5t + Flow_0t8y3x5 + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.processRanNfModifyRsp(execution) + + + + + Flow_0t8y3x5 + Flow_0cd38vb + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.prepareTnFhRequest(execution) + + + Flow_0cd38vb + Flow_1yfkps3 + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.createFhAllocateNssiJobQuery(execution) + + + + + + + + + + + Flow_1yfkps3 + Flow_0tkrh8z + + + Flow_0tkrh8z + Flow_0ygfojp + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.processFhAllocateNssiJobStatusRsp(execution) + + + + + + + Flow_0ygfojp + Flow_1702ljm + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.prepareTnMhRequest(execution) + + + Flow_1702ljm + Flow_1hzswil + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.createMhAllocateNssiJobQuery(execution) + + + + + + + + + + + Flow_1hzswil + Flow_0zh5p33 + + + Flow_0zh5p33 + Flow_0wgumc4 + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.processMhAllocateNssiJobStatusRsp(execution) + + + + + + + + + + + + + + + + + + Flow_09p79e6 + Flow_0ks2ut4 + + + Flow_0ks2ut4 + Flow_1mu3zgb + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.processRanNfModifyRsp(execution) + + + + Flow_1mu3zgb + Flow_01vilkh + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.prepareTnFhDeallocateRequest(execution) + + + Flow_01vilkh + Flow_0r7bejs + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.createFhAllocateNssiJobQuery(execution) + + + + + + + + + + + Flow_0r7bejs + Flow_06lgxk9 + + + Flow_06lgxk9 + Flow_120fe2z + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.processFhAllocateNssiJobStatusRsp(execution) + + + + + + + Flow_1orjrjp + Flow_1atfnov + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.getNssisFromAai(execution) + + + Flow_1489mpe + Flow_1ueq9wo + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.prepareTnMhDeallocateRequest(execution) + + + Flow_1ueq9wo + Flow_05junp8 + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.createMhAllocateNssiJobQuery(execution) + + + + + + + + + + + Flow_05junp8 + Flow_1xchogr + + + Flow_1xchogr + Flow_11aacst + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.processMhAllocateNssiJobStatusRsp(execution) + + + + + + + Flow_120fe2z + + + + + Flow_16lc641 + + + + Flow_11aacst + Flow_05gp3p7 + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.deleteMhSliceProfile(execution) + + + + Flow_16lc641 + Flow_1489mpe + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.deleteFhSliceProfile(execution) + + + + Flow_05gp3p7 + Flow_1nyp1l1 + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.deleteAnSliceProfile(execution) + + + + + Flow_0yj2tlu + + + + Flow_07c6g27 + + + Flow_0dafrg8 + Flow_07c6g27 + import org.onap.so.bpmn.common.scripts.* +ExceptionUtil ex = new ExceptionUtil() +ex.processJavaException(execution) + + + Flow_0yj2tlu + Flow_0jar916 + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.prepareFailedOperationStatusUpdate(execution) + + + + + + ${dbAdapterEndpoint} + + + application/soap+xml + Basic YnBlbDpwYXNzd29yZDEk + + + ${updateResourceOperationStatus} + POST + ${statusCode} + ${response} + + http-connector + + + Flow_0jar916 + Flow_0dafrg8 + + + + + + + + + + + + + + + + + + + Flow_1p5ruyv + Flow_0fkl1gv + + + Flow_0fkl1gv + Flow_17dxvu5 + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.processRanNfModifyRsp(execution) + + + + + Flow_1ym755g + Flow_0hzibw4 + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.getSubnetCapabilities(execution) + + + + + Flow_1atfnov + Flow_09p79e6 + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.getSliceProfilesFromAai(execution) + + + + + Flow_0ei2q6r + + + + Flow_0ei2q6r + Flow_1giua78 + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyAccessNSSI() +nss.prepareOperationStatusUpdate(execution) + + + + + + ${dbAdapterEndpoint} + + + application/soap+xml + Basic YnBlbDpwYXNzd29yZDEk + + + ${updateResourceOperationStatus} + POST + ${statusCode} + ${response} + + http-connector + + + Flow_1giua78 + Flow_1oubjfe + + + Flow_1oubjfe + + + + + Flow_0wgumc4 + + + + + + Flow_1nyp1l1 + + + + + Flow_17dxvu5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyRanNfNssi.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyRanNfNssi.bpmn new file mode 100644 index 0000000000..1af4ff9be1 --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyRanNfNssi.bpmn @@ -0,0 +1,91 @@ + + + + + Flow_0f9s9j7 + + + Flow_0f9s9j7 + Flow_1kdh0gl + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyRanNfNssi() +nss.preProcessRequest(execution) + + + + + Flow_1kdh0gl + Flow_0n0zzp4 + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyRanNfNssi() +nss.createSdnrRequest(execution) + + + + + + + + + + + Flow_0n0zzp4 + Flow_1b0cez1 + + + Flow_1b0cez1 + Flow_1ngijid + import org.onap.so.bpmn.infrastructure.scripts.* +def nss = new DoModifyRanNfNssi() +nss.processSdnrResponse(execution) + + + + + + Flow_1ngijid + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit 1.2.3-korg