Implement RAN NSSMF Allocate workflow 68/112468/2
authorReshmasree <reshmasree.chamarthi2@wipro.com>
Thu, 10 Sep 2020 10:02:47 +0000 (03:02 -0700)
committerReshmasree <reshmasree.chamarthi2@wipro.com>
Wed, 16 Sep 2020 12:31:33 +0000 (05:31 -0700)
Issue-ID: SO-3227
Signed-off-by: Reshmasree <reshmasree.chamarthi2@wipro.com>
Change-Id: I4354d68b307bd008b242deb57a87f5de2bb66487

bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy [new file with mode: 0644]
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy [new file with mode: 0644]
bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateAccessNSSI.bpmn [new file with mode: 0644]

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
new file mode 100644 (file)
index 0000000..d59f865
--- /dev/null
@@ -0,0 +1,448 @@
+/*
+ * ============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 com.google.gson.JsonArray
+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 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
+import org.onap.so.beans.nsmf.AllocateTnNssi
+import org.onap.so.beans.nsmf.DeAllocateNssi
+import org.onap.so.beans.nsmf.EsrInfo
+import org.onap.so.beans.nsmf.ServiceInfo
+import org.onap.so.bpmn.core.UrnPropertiesReader
+import org.onap.aai.domain.yang.ServiceInstance
+import org.onap.aai.domain.yang.SliceProfile
+import org.onap.aai.domain.yang.SliceProfiles
+import org.onap.aai.domain.yang.Relationship
+
+class AnNssmfUtils {
+
+       private static final Logger logger = LoggerFactory.getLogger(AnNssmfUtils.class)
+       ObjectMapper objectMapper = new ObjectMapper();
+       ExceptionUtil exceptionUtil = new ExceptionUtil()
+       JsonUtils jsonUtil = new JsonUtils()
+       public String buildSelectRANNSSIRequest(String requestId, String messageType, String UUID,String invariantUUID,
+               String name, Map<String, Object> profileInfo, List<String> nsstInfoList, JsonArray capabilitiesList, Boolean preferReuse){
+
+       def transactionId = requestId
+       logger.debug( "transactionId is: " + transactionId)
+       String correlator = requestId
+       String callbackUrl = UrnPropertiesReader.getVariable("mso.adapters.oof.callback.endpoint") + "/" + messageType + "/" + correlator
+       ObjectMapper objectMapper = new ObjectMapper();
+       String profileJson = objectMapper.writeValueAsString(profileInfo);
+       String nsstInfoListString = objectMapper.writeValueAsString(nsstInfoList);
+       //Prepare requestInfo object
+       JsonObject requestInfo = new JsonObject()
+       requestInfo.addProperty("transactionId", transactionId)
+       requestInfo.addProperty("requestId", requestId)
+       requestInfo.addProperty("callbackUrl", callbackUrl)
+       requestInfo.addProperty("sourceId","SO" )
+       requestInfo.addProperty("timeout", 600)
+       requestInfo.addProperty("numSolutions", 1)
+
+       //Prepare serviceInfo object
+       JsonObject ranNsstInfo = new JsonObject()
+       ranNsstInfo.addProperty("UUID", UUID)
+       ranNsstInfo.addProperty("invariantUUID", invariantUUID)
+       ranNsstInfo.addProperty("name", name)
+
+       JsonObject json = new JsonObject()
+       json.add("requestInfo", requestInfo)
+       json.add("NSTInfo", ranNsstInfo)
+       json.addProperty("serviceProfile", profileJson)
+       json.addProperty("NSSTInfo", nsstInfoListString)
+       json.add("subnetCapabilities", capabilitiesList)
+       json.addProperty("preferReuse", preferReuse)
+
+       return json.toString()
+}
+
+public String buildCreateTNNSSMFSubnetCapabilityRequest() {
+       EsrInfo esrInfo = new EsrInfo()
+       esrInfo.setNetworkType("TN")
+       esrInfo.setVendor("ONAP")
+
+       JsonArray subnetTypes = new JsonArray()
+       subnetTypes.add("TN_FH")
+       subnetTypes.add("TN_MH")
+       JsonObject response = new JsonObject()
+       response.add("subnetCapabilityQuery", subnetTypes)
+       response.addProperty("esrInfo", objectMapper.writeValueAsString(esrInfo))
+       return response.toString()
+}
+
+public String buildCreateANNFNSSMFSubnetCapabilityRequest() {
+       EsrInfo esrInfo = new EsrInfo()
+       esrInfo.setNetworkType("AN")
+       esrInfo.setVendor("ONAP")
+
+       JsonArray subnetTypes = new JsonArray()
+       subnetTypes.add("AN_NF")
+       JsonObject response = new JsonObject()
+       response.add("subnetCapabilityQuery", subnetTypes)
+       response.addProperty("esrInfo", objectMapper.writeValueAsString(esrInfo))
+       return response.toString()
+}
+public void createDomainWiseSliceProfiles(List<String> ranConstituentSliceProfiles, DelegateExecution execution) {
+       
+       for(String profile : ranConstituentSliceProfiles) {
+               String domainType = jsonUtil.getJsonValue(profile, "domainType")
+               switch(domainType) {
+                       case "AN_NF":
+                               execution.setVariable("ranNfSliceProfile", profile)
+                               break
+                       case "TN_FH":
+                               execution.setVariable("tnFhSliceProfile", profile)
+                               break
+                       case "TN_MH":
+                               execution.setVariable("tnMhSliceProfile", profile)
+                               break
+                       default:
+                               logger.debug("No expected match found for current domainType")
+                               logger.error("No expected match found for current domainType "+ domainType)
+                               exceptionUtil.buildAndThrowWorkflowException(execution, 1000,"No expected match found for current domainType "+ domainType)
+               }
+               
+       }
+}
+
+public void createSliceProfilesInAai(DelegateExecution execution) {
+       
+       org.onap.aai.domain.yang.ServiceInstance ANNF_sliceProfileInstance = new ServiceInstance();
+       org.onap.aai.domain.yang.ServiceInstance TNFH_sliceProfileInstance = new ServiceInstance();
+       org.onap.aai.domain.yang.ServiceInstance TNMH_sliceProfileInstance = new ServiceInstance();
+       //generate slice profile ids and slice profile instance ids
+       String ANNF_sliceProfileInstanceId = UUID.randomUUID().toString()
+       String ANNF_sliceProfileId = UUID.randomUUID().toString()
+       String TNFH_sliceProfileInstanceId = UUID.randomUUID().toString()
+       String TNFH_sliceProfileId = UUID.randomUUID().toString()
+       String TNMH_sliceProfileInstanceId = UUID.randomUUID().toString()
+       String TNMH_sliceProfileId = UUID.randomUUID().toString()
+       execution.setVariable("ANNF_sliceProfileInstanceId",ANNF_sliceProfileInstanceId)
+       execution.setVariable("ANNF_sliceProfileId",ANNF_sliceProfileId)
+       execution.setVariable("TNFH_sliceProfileInstanceId",TNFH_sliceProfileInstanceId)
+       execution.setVariable("TNFH_sliceProfileId",TNFH_sliceProfileId)
+       execution.setVariable("TNMH_sliceProfileInstanceId",TNMH_sliceProfileInstanceId)
+       execution.setVariable("TNMH_sliceProfileId",TNMH_sliceProfileId)
+       //slice profiles assignment
+       org.onap.aai.domain.yang.SliceProfiles ANNF_SliceProfiles = new SliceProfiles()
+       org.onap.aai.domain.yang.SliceProfiles TNFH_SliceProfiles = new SliceProfiles()
+       org.onap.aai.domain.yang.SliceProfiles TNMH_SliceProfiles = new SliceProfiles()
+       org.onap.aai.domain.yang.SliceProfile ANNF_SliceProfile = new SliceProfile()
+       org.onap.aai.domain.yang.SliceProfile TNFH_SliceProfile = new SliceProfile()
+       org.onap.aai.domain.yang.SliceProfile TNMH_SliceProfile = new SliceProfile()
+       ANNF_SliceProfile = createSliceProfile("AN-NF", execution)
+       TNFH_SliceProfile = createSliceProfile("TN-FH",execution)
+       TNMH_SliceProfile = createSliceProfile("TN-MH",execution)
+       
+       ANNF_SliceProfiles.getSliceProfile().add(ANNF_SliceProfile)
+       TNFH_SliceProfiles.getSliceProfile().add(TNFH_SliceProfile)
+       TNMH_SliceProfiles.getSliceProfile().add(TNMH_SliceProfile)
+       
+       logger.debug("sliceProfiles : 1. "+ANNF_SliceProfiles.toString()+"\n 2. "+TNFH_SliceProfiles.toString()+"\n 3. "+TNMH_SliceProfiles.toString())
+       //ANNF slice profile instance creation
+       ANNF_sliceProfileInstance.setServiceInstanceId(ANNF_sliceProfileInstanceId)
+       String sliceInstanceName = "sliceprofile_"+ANNF_sliceProfileId
+       ANNF_sliceProfileInstance.setServiceInstanceName(sliceInstanceName)
+       String serviceType = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "sST")
+       ANNF_sliceProfileInstance.setServiceType(serviceType)
+       String serviceStatus = "deactivated"
+       ANNF_sliceProfileInstance.setOrchestrationStatus(serviceStatus)
+       String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "plmnIdList")
+       ANNF_sliceProfileInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
+       String serviceRole = "slice-profile-instance"
+       ANNF_sliceProfileInstance.setServiceRole(serviceRole)
+       List<String> snssaiList = objectMapper.readValue(execution.getVariable("snssaiList"), List.class)
+       String snssai = snssaiList.get(0)
+       ANNF_sliceProfileInstance.setEnvironmentContext(snssai)
+       ANNF_sliceProfileInstance.setWorkloadContext("AN-NF")    
+       ANNF_sliceProfileInstance.setSliceProfiles(ANNF_SliceProfiles)
+       logger.debug("completed ANNF sliceprofileinstance build "+ ANNF_sliceProfileInstance.toString())
+       //TNFH slice profile instance creation
+       TNFH_sliceProfileInstance.setServiceInstanceId(TNFH_sliceProfileInstanceId)
+       sliceInstanceName = "sliceprofile_"+TNFH_sliceProfileId
+       TNFH_sliceProfileInstance.setServiceInstanceName(sliceInstanceName)
+       serviceType = jsonUtil.getJsonValue(execution.getVariable("tnFhSliceProfile"), "sST")
+       TNFH_sliceProfileInstance.setServiceType(serviceType)
+       TNFH_sliceProfileInstance.setOrchestrationStatus(serviceStatus)
+       serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("tnFhSliceProfile"), "plmnIdList")
+       TNFH_sliceProfileInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
+       TNFH_sliceProfileInstance.setServiceRole(serviceRole)
+       TNFH_sliceProfileInstance.setEnvironmentContext(snssai)
+       TNFH_sliceProfileInstance.setWorkloadContext("TN-FH")
+       TNFH_sliceProfileInstance.setSliceProfiles(TNFH_SliceProfiles)
+       logger.debug("completed TNFH sliceprofileinstance build "+TNFH_sliceProfileInstance)
+       //TNMH slice profile instance creation
+       TNMH_sliceProfileInstance.setServiceInstanceId(TNMH_sliceProfileInstanceId)
+       sliceInstanceName = "sliceprofile_"+TNMH_sliceProfileId
+       TNMH_sliceProfileInstance.setServiceInstanceName(sliceInstanceName)
+       serviceType = jsonUtil.getJsonValue(execution.getVariable("tnMhSliceProfile"), "sST")
+       TNMH_sliceProfileInstance.setServiceType(serviceType)
+       TNMH_sliceProfileInstance.setOrchestrationStatus(serviceStatus)
+       serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("tnMhSliceProfile"), "plmnIdList")
+       TNMH_sliceProfileInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
+       TNMH_sliceProfileInstance.setServiceRole(serviceRole)
+       TNMH_sliceProfileInstance.setEnvironmentContext(snssai)
+       TNMH_sliceProfileInstance.setWorkloadContext("TN-MH")
+       TNMH_sliceProfileInstance.setSliceProfiles(TNMH_SliceProfiles)
+       logger.debug("completed TNMH sliceprofileinstance build "+TNMH_sliceProfileInstance)
+       String msg = ""
+       try {
+
+               AAIResourcesClient client = new AAIResourcesClient()
+               AAIResourceUri sliceProfileUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, execution.getVariable("globalSubscriberId"), execution.getVariable("subscriptionServiceType"), ANNF_sliceProfileInstanceId)
+               client.create(sliceProfileUri, ANNF_sliceProfileInstance)
+
+               AAIResourceUri sliceProfileUri1 = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, execution.getVariable("globalSubscriberId"), execution.getVariable("subscriptionServiceType"), TNFH_sliceProfileInstanceId)
+               client.create(sliceProfileUri1, TNFH_sliceProfileInstance)
+
+               AAIResourceUri sliceProfileUri2 = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, execution.getVariable("globalSubscriberId"), execution.getVariable("subscriptionServiceType"), TNMH_sliceProfileInstanceId)
+               client.create(sliceProfileUri2, TNMH_sliceProfileInstance)
+
+       } catch (BpmnError e) {
+               throw e
+       } catch (Exception ex) {
+               msg = "Exception in AnNssmfUtils.createSliceProfilesInAai " + ex.getMessage()
+               logger.info(msg)
+               exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+       }
+
+}
+private SliceProfile createSliceProfile(String domainType, DelegateExecution execution) {
+
+       SliceProfile result = new SliceProfile()
+       Map<String,Object> profile
+       switch(domainType) {
+               case "AN-NF":
+                       profile = objectMapper.readValue(execution.getVariable("ranNfSliceProfile"), Map.class)//pending fields - maxBandwidth, sST, pLMNIdList, cSReliabilityMeanTime, 
+                                                                                                                                                                                                       //msgSizeByte, maxNumberofPDUSessions,overallUserDensity,transferIntervalTarget
+                       result.setJitter(profile.get("jitter"))
+                       result.setLatency(profile.get("latency"))
+                       result.setResourceSharingLevel(profile.get("resourceSharingLevel"))
+                       result.setSNssai(profile.get("sNSSAI"))
+                       result.setUeMobilityLevel(profile.get("uEMobilityLevel"))
+                       result.setMaxNumberOfUEs(profile.get("maxNumberofUEs"))
+                       result.setActivityFactor(profile.get("activityFactor"))
+                       result.setCoverageAreaTAList(profile.get("coverageAreaTAList"))
+                       result.setCsAvailability(profile.get("cSAvailabilityTarget"))
+                       result.setExpDataRateDL(profile.get("expDataRateDL"))
+                       result.setExpDataRateUL(profile.get("expDataRateUL"))
+                       result.setSurvivalTime(profile.get("survivalTime"))
+                       result.setAreaTrafficCapDL(profile.get("areaTrafficCapDL"))
+                       result.setAreaTrafficCapUL(profile.get("areaTrafficCapUL"))
+                       result.setExpDataRate(profile.get("expDataRate"))
+                       result.setProfileId(execution.getVariable("ANNF_sliceProfileId"))
+                       break
+               case "TN-FH":
+                       profile = objectMapper.readValue(execution.getVariable("tnFhSliceProfile"), Map.class) //pending fields - maxBandwidth, sST, pLMNIdList
+                       result.setJitter(profile.get("jitter"))
+                       result.setLatency(profile.get("latency"))
+                       result.setResourceSharingLevel(profile.get("resourceSharingLevel"))
+                       result.setSNssai(profile.get("sNSSAI"))
+                       result.setProfileId(execution.getVariable("TNFH_sliceProfileId"))
+                       break
+               case "TN-MH":
+                       profile = objectMapper.readValue(execution.getVariable("tnMhSliceProfile"), Map.class)//pending fields - maxBandwidth, sST, pLMNIdList
+                       result.setJitter(profile.get("jitter"))
+                       result.setLatency(profile.get("latency"))
+                       result.setResourceSharingLevel(profile.get("resourceSharingLevel"))
+                       result.setSNssai(profile.get("sNSSAI"))
+                       result.setProfileId(execution.getVariable("TNMH_sliceProfileId"))
+                       break
+               default:
+                       logger.debug("No expected match found for current domainType")
+                       logger.error("No expected match found for current domainType "+ domainType)
+                       exceptionUtil.buildAndThrowWorkflowException(execution, 1000,"No expected match found for current domainType "+ domainType)
+       }
+       return result
+}
+
+ /**
+     * create relationship in AAI
+     */
+    public createRelationShipInAAI = { DelegateExecution execution, final Relationship relationship, String instanceId ->
+        logger.debug("createRelationShipInAAI Start")
+        String msg
+               AAIResourcesClient client = new AAIResourcesClient()
+        try {
+            AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
+                    execution.getVariable("globalSubscriberId"),
+                    execution.getVariable("subscriptionServiceType"),
+                    instanceId).relationshipAPI()
+            client.create(uri, relationship)
+
+        } catch (BpmnError e) {
+            throw e
+        } catch (Exception ex) {
+            msg = "Exception in CreateCommunicationService.createRelationShipInAAI. " + ex.getMessage()
+            logger.info(msg)
+            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+        }
+        logger.debug("createRelationShipInAAI Exit")
+
+    }
+       
+       public void processRanNfModifyRsp(DelegateExecution execution) {
+               String status = execution.getVariable("ranNfStatus")
+               if(status.equals("success")) {
+                       logger.debug("completed Ran NF NSSI modification ... proceeding with the flow")
+               }
+               else {
+                       logger.error("failed to modify ran Nf nssi")
+                       exceptionUtil.buildAndThrowWorkflowException(execution, 1000, "modify ran nf nssi not successfull")
+               }
+       }
+       
+       public String buildCreateNSSMFRequest(DelegateExecution execution, String domainType, String action) {
+               EsrInfo esrInfo = new EsrInfo()
+               esrInfo.setNetworkType("TN")
+               esrInfo.setVendor("ONAP")
+               String esrInfoString = objectMapper.writeValueAsString(esrInfo)
+               JsonObject response = new JsonObject()
+               JsonObject allocateTnNssi = new JsonObject()
+               JsonObject serviceInfo = new JsonObject()
+               JsonArray transportSliceNetworksList  = new JsonArray()
+               JsonArray connectionLinksList = new JsonArray()
+               JsonObject connectionLinks = new JsonObject()
+               if(action.equals("allocate")){
+                       Map<String, String> endpoints
+                       if(domainType.equals("TN_FH")) {
+                               serviceInfo.addProperty("serviceInvariantUuid", execution.getVariable("TNFH_modelInvariantUuid"))
+                               serviceInfo.addProperty("serviceUuid", execution.getVariable("TNFH_modelUuid"))
+                               allocateTnNssi.addProperty("nsstId", execution.getVariable("TNFH_modelUuid"))
+                               allocateTnNssi.addProperty("nssiName", execution.getVariable("TNFH_modelName"))
+                               Map<String,Object> sliceProfile = objectMapper.readValue(execution.getVariable("tnFhSliceProfile"), Map.class)
+                               sliceProfile.put("sliceProfileId", execution.getVariable("TNFH_sliceProfileInstanceId"))
+                               String sliceProfileString = objectMapper.writeValueAsString(sliceProfile)
+                               allocateTnNssi.addProperty("sliceProfile", sliceProfileString)
+                               endpoints.put("transportEndpointA", execution.getVariable("tranportEp_ID_RU"))
+                               endpoints.put("transportEndpointB", execution.getVariable("tranportEp_ID_DUIN"))
+                               String endpointsString = objectMapper.writeValueAsString(endpoints)
+                               connectionLinksList.add(endpointsString)
+                       }else if(domainType.equals("TN_MH")) {
+                               serviceInfo.addProperty("serviceInvariantUuid", execution.getVariable("TNMH_modelInvariantUuid"))
+                               serviceInfo.addProperty("serviceUuid", execution.getVariable("TNMH_modelUuid"))
+                               allocateTnNssi.addProperty("nsstId", execution.getVariable("TNMH_modelUuid"))
+                               allocateTnNssi.addProperty("nssiName", execution.getVariable("TNMH_modelName"))
+                               Map<String,Object> sliceProfile = objectMapper.readValue(execution.getVariable("tnMhSliceProfile"), Map.class)
+                               sliceProfile.put("sliceProfileId", execution.getVariable("TNMH_sliceProfileInstanceId"))
+                               String sliceProfileString = objectMapper.writeValueAsString(sliceProfile)
+                               allocateTnNssi.addProperty("sliceProfile", sliceProfileString)
+                               endpoints.put("transportEndpointA", execution.getVariable("tranportEp_ID_DUEG"))
+                               endpoints.put("transportEndpointB", execution.getVariable("tranportEp_ID_CUIN"))
+                               String endpointsString = objectMapper.writeValueAsString(endpoints)
+                               connectionLinksList.add(endpointsString)
+                       }
+                       
+                       //Connection links
+                       connectionLinks.add("connectionLinks", connectionLinksList)
+                       transportSliceNetworksList.add(connectionLinks)
+                       allocateTnNssi.add("transportSliceNetworks", transportSliceNetworksList)
+                       allocateTnNssi.addProperty("nssiId", null)
+                       serviceInfo.addProperty("nssiId", null)
+               }else if(action.equals("modify-allocate")) {
+                       if(domainType.equals("TN_FH")) {
+                               serviceInfo.addProperty("serviceInvariantUuid", null)
+                               serviceInfo.addProperty("serviceUuid", null)
+                               allocateTnNssi.addProperty("nsstId", null)
+                               allocateTnNssi.addProperty("nssiName", execution.getVariable("TNFH_nssiName"))
+                               allocateTnNssi.addProperty("sliceProfileId", execution.getVariable("TNFH_sliceProfileInstanceId"))
+                               allocateTnNssi.addProperty("nssiId", execution.getVariable("TNFH_NSSI"))
+                               serviceInfo.addProperty("nssiId", execution.getVariable("TNFH_NSSI"))
+                       }else if(domainType.equals("TN_MH")) {
+                               serviceInfo.addProperty("serviceInvariantUuid", null)
+                               serviceInfo.addProperty("serviceUuid", null)
+                               allocateTnNssi.addProperty("nsstId", null)
+                               allocateTnNssi.addProperty("nssiName", execution.getVariable("TNMH_nssiName"))
+                               allocateTnNssi.addProperty("sliceProfileId", execution.getVariable("TNMH_sliceProfileInstanceId"))
+                               allocateTnNssi.addProperty("nssiId", execution.getVariable("TNMH_NSSI"))
+                               serviceInfo.addProperty("nssiId", execution.getVariable("TNMH_NSSI"))
+                       }
+               }
+               String nsiInfo = jsonUtil.getJsonValue(execution.getVariable("sliceParams"), "nsiInfo")
+               allocateTnNssi.addProperty("nsiInfo", nsiInfo)
+               allocateTnNssi.addProperty("scriptName", "TN1")
+               serviceInfo.addProperty("nsiId", execution.getVariable("nsiId"))
+               serviceInfo.addProperty("globalSubscriberId", execution.getVariable("globalSubscriberId"))
+               serviceInfo.addProperty("subscriptionServiceType", execution.getVariable("subscriptionServiceType"))
+               response.addProperty("esrInfo", esrInfoString)
+               response.add("serviceInfo", serviceInfo)
+               response.add("allocateTnNssi", allocateTnNssi)
+               return response.toString()
+       }
+       
+       public String buildDeallocateNssiRequest(DelegateExecution execution,String domainType) {
+               String globalSubscriberId = execution.getVariable("globalSubscriberId")
+               String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
+          
+               JsonObject deAllocateNssi = new JsonObject()
+               deAllocateNssi.addProperty("snssaiList", execution.getVariable("snssaiList"))
+               deAllocateNssi.addProperty("nsiId", execution.getVariable("nsiId"))
+               deAllocateNssi.addProperty("modifyAction", true)
+               deAllocateNssi.addProperty("terminateNssiOption", 0)
+               deAllocateNssi.addProperty("scriptName", "TN1")
+               
+               if(domainType.equals("TN_FH")) {
+                       deAllocateNssi.addProperty("nssiId", execution.getVariable("TNFH_NSSI"))
+                       deAllocateNssi.addProperty("sliceProfileId", execution.getVariable("TNFH_sliceProfileInstanceId"))
+               }else if(domainType.equals("TN_MH")) {
+                       deAllocateNssi.addProperty("nssiId", execution.getVariable("TNMH_NSSI"))
+                       deAllocateNssi.addProperty("sliceProfileId", execution.getVariable("TNMH_sliceProfileInstanceId"))
+               }
+               
+               EsrInfo esrInfo = new EsrInfo()
+               esrInfo.setVendor("ONAP")
+               esrInfo.setNetworkType("TN")
+          
+               JsonObject serviceInfo = new JsonObject()
+               serviceInfo.addProperty("serviceInvariantUuid", null)
+               serviceInfo.addProperty("serviceUuid", null)
+               serviceInfo.addProperty("globalSubscriberId", globalSubscriberId)
+               serviceInfo.addProperty("subscriptionServiceType", subscriptionServiceType)
+          
+               JsonObject json = new JsonObject()
+               json.add("deAllocateNssi", deAllocateNssi)
+               json.addProperty("esrInfo", objectMapper.writeValueAsString(esrInfo))
+               json.add("serviceInfo", serviceInfo)
+               return json.toString()
+          
+       }
+}
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..3df0d3d
--- /dev/null
@@ -0,0 +1,1041 @@
+/*
+ * ============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.aai.domain.yang.Relationship
+import org.onap.aaiclient.client.aai.AAIResourcesClient
+import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri
+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.ServiceInstance
+import org.onap.so.bpmn.core.domain.ServiceProxy
+import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory
+import org.onap.aaiclient.client.aai.AAINamespaceConstants
+import org.onap.aaiclient.client.aai.AAIObjectType
+import org.onap.aai.domain.yang.NetworkPolicy
+import org.onap.aai.domain.yang.NetworkRoute
+
+class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
+
+       String Prefix="AASS_"
+       ExceptionUtil exceptionUtil = new ExceptionUtil()
+       RequestDBUtil requestDBUtil = new RequestDBUtil()
+       JsonUtils jsonUtil = new JsonUtils()
+       OofUtils oofUtils = new OofUtils()
+       AnNssmfUtils anNssmfUtils = new AnNssmfUtils()
+       ObjectMapper objectMapper = new ObjectMapper();
+       private NssmfAdapterUtils nssmfAdapterUtils = new NssmfAdapterUtils(httpClientFactory, jsonUtil)
+
+       private static final Logger logger = LoggerFactory.getLogger(DoAllocateAccessNSSI.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")
+                                       +" modelInvariantUuid - "+execution.getVariable("modelInvariantUuid")+
+                                       " modelUuid - "+execution.getVariable("modelUuid")+
+                                       " globalSubscriberId - "+execution.getVariable("globalSubscriberId")+
+                                       " dummyServiceId - "+ execution.getVariable("dummyServiceId")+
+                                       " 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 sliceProfile = jsonUtil.getJsonValue(sliceParams, "sliceProfile")
+                       if (isBlank(sliceProfile)) {
+                               msg = "Input sliceProfile is null"
+                               logger.debug(msg)
+                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                       } else {
+                               execution.setVariable("sliceProfile", sliceProfile)
+                       }
+                       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"))
+
+                       if (isBlank(sliceProfileId) || (snssaiList.empty) || (plmnIdList.empty)
+                       || (coverageAreaTAList.empty)) {
+
+                               msg = "Mandatory slice profile fields are empty"
+                               logger.debug(msg)
+                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                       } else {
+                               execution.setVariable("sliceProfileId", sliceProfileId)
+                               execution.setVariable("snssaiList", snssaiList)
+                               execution.setVariable("plmnIdList", plmnIdList)
+                               execution.setVariable("coverageAreaTAList", coverageAreaTAList)
+                       }
+                       String nsiName = jsonUtil.getJsonValue(sliceParams, "nsiInfo.nsiName")
+                       String scriptName = jsonUtil.getJsonValue(sliceParams, "scriptName")
+                       execution.setVariable("nsiName", nsiName)
+                       execution.setVariable("scriptName", scriptName)
+                       //generate RAN,RAN NF NSSIs - will be re assigned if oof returns existing NSSI
+                       String RANServiceInstanceId = UUID.randomUUID().toString()
+                       String RANNFServiceInstanceId = UUID.randomUUID().toString()
+                       logger.debug("RAN serviceInstance Id "+RANServiceInstanceId)
+                       logger.debug("RAN NF serviceInstance Id "+RANNFServiceInstanceId)                       
+                       execution.setVariable("RANServiceInstanceId", RANServiceInstanceId)
+                       execution.setVariable("RANNFServiceInstanceId", RANNFServiceInstanceId)
+                       execution.setVariable("ranNssiPreferReuse", true)
+                       execution.setVariable("ranNfNssiPreferReuse", true)
+                       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))
+                       }
+                       
+               } catch(BpmnError e) {
+                       throw e
+               } catch(Exception ex) {
+                       msg = "Exception in DoAllocateAccessNSSI.preProcessRequest " + ex.getMessage()
+                       logger.debug(msg)
+                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+               }
+               logger.debug(Prefix + "preProcessRequest Exit")
+       }
+
+       /*
+        * Prepare request params for decomposing RAN NSST
+        */
+
+       def prepareDecomposeService = { DelegateExecution execution ->
+               logger.debug(Prefix+"prepareDecomposeService method start")
+               String RANServiceInstanceId = execution.getVariable("RANServiceInstanceId")
+               String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
+               String modelUuid = execution.getVariable("modelUuid")
+               String serviceModelInfo = """{
+            "modelInvariantUuid":"${modelInvariantUuid}",
+            "modelUuid":"${modelUuid}",
+            "modelVersion":""
+             }"""
+               execution.setVariable("serviceModelInfo", serviceModelInfo)
+               execution.setVariable("serviceInstanceId", RANServiceInstanceId)
+               logger.debug("serviceModelInfo : "+serviceModelInfo)
+               logger.debug("Finish RAN NSST prepareDecomposeService")
+       }
+
+       /* process the decompose service(RAN NSST) response
+        * 
+        */
+       def processDecomposition = { DelegateExecution execution ->
+               logger.debug(Prefix+"processDecomposition method start")
+               ServiceDecomposition ranNsstServiceDecomposition = execution.getVariable("ranNsstServiceDecomposition")
+               logger.debug("ranNsstServiceDecomposition : "+ranNsstServiceDecomposition.toString())
+               //RAN NSST decomposition
+               String ranModelVersion = ranNsstServiceDecomposition.getModelInfo().getModelVersion()
+               String ranModelName = ranNsstServiceDecomposition.getModelInfo().getModelName()
+               List<ServiceProxy> serviceProxyList = ranNsstServiceDecomposition.getServiceProxy()
+               List<String> nsstInfoList = new ArrayList<>()
+               for(ServiceProxy serviceProxy : serviceProxyList)
+               {
+                       String nsstModelUuid = serviceProxy.getModelInfo().getModelUuid()
+                       String nsstModelInvariantUuid = serviceProxy.getModelInfo().getModelInvariantUuid()
+                       String name = serviceProxy.getModelInfo().getModelName()
+                       String nsstServiceModelInfo = """{
+            "UUID":"${nsstModelUuid}",
+            "invariantUUID":"${nsstModelInvariantUuid}",
+            "name":"${name}"
+             }"""
+                       nsstInfoList.add(nsstServiceModelInfo)
+               }
+               int currentIndex=0
+               int maxIndex=nsstInfoList.size()
+               if(maxIndex < 1)
+               {
+                       String msg = "Exception in RAN NSST processDecomposition. There is no NSST associated with RAN NSST "
+                       logger.info(msg)
+                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+               }
+               execution.setVariable("ranNsstInfoList",nsstInfoList)
+               execution.setVariable("ranModelVersion", ranModelVersion)
+               execution.setVariable("ranModelName", ranModelName)
+               execution.setVariable("currentIndex",currentIndex)
+               execution.setVariable("maxIndex",maxIndex)
+               logger.debug(Prefix+"processDecomposition maxIndex value - "+maxIndex)
+       }
+
+       /*
+        * 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<String, Object> profileInfo = objectMapper.readValue(execution.getVariable("sliceProfile"), Map.class)
+               String modelUuid = execution.getVariable("modelUuid")
+               String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
+               String modelName = execution.getVariable("ranModelName")
+               String timeout = UrnPropertiesReader.getVariable("mso.adapters.oof.timeout", execution);
+               List<String> nsstInfoList =  objectMapper.readValue(execution.getVariable("nsstInfoList"), List.class)
+               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<String> solution = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(oofResponse, "solutions"))
+                       boolean existingNSI = jsonUtil.getJsonValue(solution.get(0), "existingNSI")
+                       if(existingNSI) {
+                               def sharedNSISolution = jsonUtil.getJsonValue(solution.get(0), "sharedNSISolution")
+                               execution.setVariable("sharedRanNSSISolution", sharedNSISolution)
+                               logger.debug("sharedRanNSSISolution from OOF "+sharedNSISolution)
+                               String RANServiceInstanceId = jsonUtil.getJsonValue(solution.get(0), "sharedNSISolution.NSIId")
+                               execution.setVariable("RANServiceInstanceId", RANServiceInstanceId)
+                               ServiceInstance serviceInstance = new ServiceInstance();
+                               serviceInstance.setInstanceId(RANServiceInstanceId);
+                               ServiceDecomposition serviceDecomposition = execution.getVariable("ranNsstServiceDecomposition")
+                               serviceDecomposition.setServiceInstance(serviceInstance);
+                               execution.setVariable("ranNsstServiceDecomposition", serviceDecomposition)
+                               execution.setVariable("isRspRanNssi", true)
+                       }else {
+                               def sliceProfiles = jsonUtil.getJsonValue(solution.get(0), "newNSISolution.sliceProfiles")
+                               execution.setVariable("RanConstituentSliceProfiles", sliceProfiles)
+                               logger.debug("RanConstituentSliceProfiles list from OOF "+sliceProfiles)
+                       }
+               }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 prepareModifyAccessNssiInputs = { DelegateExecution execution ->
+               logger.debug(Prefix+"prepareModifyAccessNssiInputs method start")
+               String jobId = UUID.randomUUID().toString()
+               execution.setVariable("modifyRanNssiJobId", jobId)              
+               String snssaiList = execution.getVariable("snssaiList")
+               String sliceParams = execution.getVariable("sliceParams")
+               String sliceProfileId = execution.getVariable("sliceProfileId")
+               String nsiInfo = jsonUtil.getJsonValue(sliceParams, "nsiInfo")
+               String scriptName = execution.getVariable("scriptName")
+               
+               JsonObject modifySliceParams = new JsonObject()
+               modifySliceParams.addProperty("modifyAction", "allocate")
+               modifySliceParams.addProperty("snssaiList", snssaiList)
+               modifySliceParams.addProperty("sliceProfileId", sliceProfileId)
+               modifySliceParams.addProperty("nsiInfo", nsiInfo)
+               modifySliceParams.addProperty("scriptName", scriptName)
+               
+               execution.setVariable("modifySliceParams", modifySliceParams.toString())
+               //create operation status in request db
+               String serviceId = execution.getVariable("RANServiceInstanceId")
+               String nsiId = execution.getVariable("nsiId")
+               logger.debug("Generated new job for Service Instance serviceId:" + serviceId + "jobId:" + jobId)
+
+               ResourceOperationStatus initStatus = new ResourceOperationStatus()
+               initStatus.setServiceId(serviceId)
+               initStatus.setOperationId(jobId)
+               initStatus.setResourceTemplateUUID(nsiId)
+               initStatus.setOperType("Modify")
+               requestDBUtil.prepareInitResourceOperationStatus(execution, initStatus)
+       }
+       
+       def createModifyNssiQueryJobStatus = { DelegateExecution execution ->
+               logger.debug(Prefix+"createModifyNssiQueryJobStatus method start")
+               EsrInfo esrInfo = new EsrInfo()
+               esrInfo.setNetworkType("AN")
+               esrInfo.setVendor("ONAP")
+               String esrInfoString = objectMapper.writeValueAsString(esrInfo)
+               execution.setVariable("esrInfo", esrInfoString)
+               JsonObject serviceInfo = new JsonObject()
+               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("PLMNIdList", objectMapper.writeValueAsString(execution.getVariable("plmnIdList")))
+               serviceInfo.addProperty("globalSubscriberId", execution.getVariable("globalSubscriberId"))
+               serviceInfo.addProperty("subscriptionServiceType", execution.getVariable("subscriptionServiceType"))
+               serviceInfo.addProperty("serviceInvariantUuid", execution.getVariable("modelInvariantUuid"))
+               serviceInfo.addProperty("serviceUuid", execution.getVariable("modelUuid"))
+               execution.setVariable("serviceInfo", serviceInfo.toString())
+               execution.setVariable("responseId", "")
+       }
+       def prepareNsstDecomposeService = { DelegateExecution execution ->
+               logger.debug(Prefix+"prepareNsstDecomposeService method start")
+               List<String> nsstInfoList = objectMapper.readValue(execution.getVariable("ranNsstInfoList"), List.class)
+               int currentIndex = execution.getVariable("currentIndex")
+               int maxIndex = execution.getVariable("maxIndex")
+               logger.debug(Prefix+"prepareNsstDecomposeService : currentIndex value - "+currentIndex+" maxIndex : "+maxIndex)
+               if(currentIndex<maxIndex) {
+                       String nsstInfo = nsstInfoList.get(currentIndex)
+                       String modelInvariantUuid = jsonUtil.getJsonValue(nsstInfo, "invariantUUID")
+                       String modelUuid = jsonUtil.getJsonValue(nsstInfo, "UUID")
+                       
+                       String serviceModelInfo = """{
+            "modelInvariantUuid":"${modelInvariantUuid}",
+            "modelUuid":"${modelUuid}",
+            "modelVersion":""
+             }"""
+                       execution.setVariable("serviceModelInfo", serviceModelInfo)
+                       execution.setVariable("serviceInstanceId", "")
+                       logger.debug("serviceModelInfo : "+serviceModelInfo)
+                       currentIndex++
+                       execution.setVariable("currentIndex", currentIndex)
+               }else {
+                       logger.error("nsstList decomposition error ")
+                       exceptionUtil.buildAndThrowWorkflowException(execution, 1000, "nsstList decomposition error ")
+               }
+               
+       }
+       def processNsstDecomposition = { DelegateExecution execution ->
+               logger.debug(Prefix+"processNsstDecomposition method start")
+               ServiceDecomposition decomposedNsst = execution.getVariable("nsstServiceDecomposition")
+               logger.debug("decomposedNsst : "+decomposedNsst.toString())
+               
+               String nsstType = decomposedNsst.getServiceRole() //domainType
+               String modelVersion = decomposedNsst.getModelInfo().getModelVersion()
+               String modelName = decomposedNsst.getModelInfo().getModelName()
+               String modelUuid = decomposedNsst.getModelInfo().getModelUuid()
+               String modelInvariantUuid = decomposedNsst.getModelInfo().getModelInvariantUuid()
+               
+               switch(nsstType) {
+                       case "AN_NF":
+                               execution.setVariable("ANNF_modelInvariantUuid", modelInvariantUuid)
+                               execution.setVariable("ANNF_modelUuid", modelUuid)
+                               execution.setVariable("ANNF_modelVersion", modelVersion)
+                               execution.setVariable("ANNF_modelName", modelName)
+                               execution.setVariable("ANNF_ServiceDecomposition", decomposedNsst)
+                               break
+                       case "TN_FH":
+                               execution.setVariable("TNFH_modelInvariantUuid", modelInvariantUuid)
+                               execution.setVariable("TNFH_modelUuid", modelUuid)
+                               execution.setVariable("TNFH_modelVersion", modelVersion)
+                               execution.setVariable("TNFH_modelName", modelName)
+                               execution.setVariable("TNFH_ServiceDecomposition", decomposedNsst)
+                               break
+                       case "TN_MH":
+                               execution.setVariable("TNMH_modelInvariantUuid", modelInvariantUuid)
+                               execution.setVariable("TNMH_modelUuid", modelUuid)
+                               execution.setVariable("TNMH_modelVersion", modelVersion)
+                               execution.setVariable("TNMH_modelName", modelName)
+                               execution.setVariable("TNMH_ServiceDecomposition", decomposedNsst)
+                               break
+                       default:
+                               logger.debug("No expected match found for current nsstType")
+                               logger.error("No expected match found for current nsstType "+ nsstType)
+                               exceptionUtil.buildAndThrowWorkflowException(execution, 1000,"No expected match found for current nsstType "+ nsstType)
+               }
+               boolean isAllNsstsDecomposed = false
+               int currentIndex = execution.getVariable("currentIndex")
+               int maxIndex = execution.getVariable("maxIndex")
+               if(currentIndex == maxIndex) {
+                       isAllNsstsDecomposed = true
+               }
+               execution.setVariable("isAllNsstsDecomposed", isAllNsstsDecomposed)
+       }
+       /*
+        * prepare OOF request for NF RAN NSSI selection
+        */
+       def prepareOofRequestForRanNfNSS = { DelegateExecution execution ->
+               logger.debug(Prefix+"prepareOofRequestForRanNfNSS method start")
+               String urlString = UrnPropertiesReader.getVariable("mso.oof.endpoint", execution)
+               logger.debug( "get NSSI option OOF Url: " + urlString)
+
+               //build oof request body
+               boolean ranNfNssiPreferReuse = execution.getVariable("ranNfNssiPreferReuse");
+               String requestId = execution.getVariable("msoRequestId")
+               String messageType = "NSSISelectionResponse"
+               List<String> ranConstituentSliceProfiles = jsonUtil.StringArrayToList(execution.getVariable("RanConstituentSliceProfiles"))
+               anNssmfUtils.createDomainWiseSliceProfiles(ranConstituentSliceProfiles, execution)
+               Map<String, Object> profileInfo = objectMapper.readValue(execution.getVariable("ranNfSliceProfile"), Map.class)
+               String modelUuid = execution.getVariable("ANNF_modelUuid")
+               String modelInvariantUuid = execution.getVariable("ANNF_modelInvariantUuid")
+               String modelName = execution.getVariable("ANNF_modelName")
+               String timeout = UrnPropertiesReader.getVariable("mso.adapters.oof.timeout", execution);
+
+               execution.setVariable("nssiSelection_Url", "/api/oof/selection/nssi/v1")
+               execution.setVariable("nssiSelection_messageType",messageType)
+               execution.setVariable("nssiSelection_correlator",requestId)
+               execution.setVariable("nssiSelection_timeout",timeout)
+
+               String oofRequest = oofUtils.buildSelectNSSIRequest(requestId, messageType, modelUuid, modelInvariantUuid, modelName, profileInfo)
+
+               execution.setVariable("nssiSelection_oofRequest",oofRequest)
+       }
+       /*
+        * process OOF response for RAN NF NSSI selection
+        */
+       def processOofResponseForRanNfNSS = { DelegateExecution execution ->
+               logger.debug(Prefix+"processOofResponseForRanNfNSS method start")
+               String oofResponse = execution.getVariable("nfNssiSelection_asyncCallbackResponse")
+               String requestStatus = jsonUtil.getJsonValue(oofResponse, "requestStatus")
+               if(requestStatus.equals("completed")) {
+                       List<String> solution = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(oofResponse, "solutions"))             
+                       if(solution.size()>=1) {
+                               String ranNfNssiId = jsonUtil.getJsonValue(solution.get(0), "NSSIId")
+                               String invariantUuid = jsonUtil.getJsonValue(solution.get(0), "invariantUUID")
+                               String uuid = jsonUtil.getJsonValue(solution.get(0), "UUID")
+                               String nssiName = jsonUtil.getJsonValue(solution.get(0), "NSSIName")
+                               execution.setVariable("RANNFServiceInstanceId", ranNfNssiId)
+                               execution.setVariable("RANNFInvariantUUID", invariantUuid)
+                               execution.setVariable("RANNFUUID", uuid)
+                               execution.setVariable("RANNFNssiName", nssiName)
+                               logger.debug("RANNFServiceInstanceId from OOF "+ranNfNssiId)
+                               
+                               ServiceInstance serviceInstance = new ServiceInstance();
+                               serviceInstance.setInstanceId(ranNfNssiId);
+                               ServiceDecomposition serviceDecomposition = execution.getVariable("ANNF_ServiceDecomposition")
+                               serviceDecomposition.setServiceInstance(serviceInstance);
+                               execution.setVariable("ANNF_ServiceDecomposition", serviceDecomposition)
+                               execution.setVariable("isRspRanNfNssi", true)
+                       }else {
+                               logger.debug("No solutions returned from OOF .. Create new RAN NF NSSI")
+                       }
+               }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 createSliceProfilesInAai = { DelegateExecution execution ->
+               logger.debug(Prefix+"createSliceProfilesInAai method start")
+               anNssmfUtils.createSliceProfilesInAai(execution)
+       }
+
+       def processRanNfModifyRsp = { DelegateExecution execution ->
+               logger.debug(Prefix+"processRanNfModifyRsp method start")
+               anNssmfUtils.processRanNfModifyRsp(execution)
+               //create RAN NSSI 
+               org.onap.aai.domain.yang.ServiceInstance ANServiceInstance = new ServiceInstance();
+               //AN instance creation
+               ANServiceInstance.setServiceInstanceId(execution.getVariable("RANServiceInstanceId"))
+               String sliceInstanceName = execution.getVariable("servicename")
+               ANServiceInstance.setServiceInstanceName(sliceInstanceName)
+               String serviceType = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "sST")
+               ANServiceInstance.setServiceType(serviceType)
+               String serviceStatus = "deactivated"
+               ANServiceInstance.setOrchestrationStatus(serviceStatus)
+               String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "plmnIdList")
+               ANServiceInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
+               String serviceRole = "nssi"
+               ANServiceInstance.setServiceRole(serviceRole)
+               List<String> snssaiList = objectMapper.readValue(execution.getVariable("snssaiList"), List.class)
+               String snssai = snssaiList.get(0)
+               ANServiceInstance.setEnvironmentContext(snssai)
+               ANServiceInstance.setWorkloadContext("AN")
+               
+               logger.debug("completed AN service instance build "+ ANServiceInstance.toString())
+               String msg = ""
+               try {
+       
+                       AAIResourcesClient client = new AAIResourcesClient()
+                       AAIResourceUri nssiServiceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, execution.getVariable("globalSubscriberId"), execution.getVariable("subscriptionServiceType"), execution.getVariable("RANServiceInstanceId"))
+                       client.create(nssiServiceUri, ANServiceInstance)
+       
+               } catch (BpmnError e) {
+                       throw e
+               } catch (Exception ex) {
+                       msg = "Exception in AnNssmfUtils.createSliceProfilesInAai " + ex.getMessage()
+                       logger.info(msg)
+                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+               }
+               //end point update
+               createEndPointsInAai(execution)
+       }
+       
+       def createSdnrRequest = { DelegateExecution execution ->
+               logger.debug(Prefix+"createSdnrRequest method start")
+               String callbackUrl = UrnPropertiesReader.getVariable("mso.workflow.message.endpoint") + "/AsyncSdnrResponse/"+execution.getVariable("msoRequestId")
+               String sdnrRequest = buildSdnrAllocateRequest(execution, "allocate", "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)
+       }
+
+       def updateAaiWithRANInstances = { DelegateExecution execution ->
+               logger.debug(Prefix+"updateAaiWithRANInstances method start")
+               //create RAN NSSI 
+               org.onap.aai.domain.yang.ServiceInstance ANServiceInstance = new ServiceInstance();
+               org.onap.aai.domain.yang.ServiceInstance ANNFServiceInstance = new ServiceInstance();
+               //AN instance creation
+               ANServiceInstance.setServiceInstanceId(execution.getVariable("RANServiceInstanceId"))
+               String sliceInstanceName = execution.getVariable("servicename")
+               ANServiceInstance.setServiceInstanceName(sliceInstanceName)
+               String serviceType = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "sST")
+               ANServiceInstance.setServiceType(serviceType)
+               String serviceStatus = "deactivated"
+               ANServiceInstance.setOrchestrationStatus(serviceStatus)
+               String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "plmnIdList")
+               ANServiceInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
+               String serviceRole = "nssi"
+               ANServiceInstance.setServiceRole(serviceRole)
+               List<String> snssaiList = objectMapper.readValue(execution.getVariable("snssaiList"), List.class)
+               String snssai = snssaiList.get(0)
+               ANServiceInstance.setEnvironmentContext(snssai)
+               ANServiceInstance.setWorkloadContext("AN")
+               
+               logger.debug("completed AN service instance build "+ ANServiceInstance.toString())
+               //create RAN NF NSSI
+               ANNFServiceInstance.setServiceInstanceId(execution.getVariable("RANNFServiceInstanceId"))
+               sliceInstanceName = execution.getVariable("ANNF_modelName")
+               ANNFServiceInstance.setServiceInstanceName(sliceInstanceName)
+               ANNFServiceInstance.setServiceType(serviceType)
+               ANNFServiceInstance.setOrchestrationStatus(serviceStatus)
+               serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "plmnIdList")
+               ANNFServiceInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
+               ANNFServiceInstance.setServiceRole(serviceRole)
+               snssaiList = objectMapper.readValue(execution.getVariable("snssaiList"), List.class)
+               snssai = snssaiList.get(0)
+               ANNFServiceInstance.setEnvironmentContext(snssai)
+               ANNFServiceInstance.setWorkloadContext("AN-NF")
+               logger.debug("completed AN service instance build "+ ANNFServiceInstance.toString())
+               
+               String msg = ""
+               try {
+       
+                       AAIResourcesClient client = new AAIResourcesClient()
+                       AAIResourceUri nssiServiceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, execution.getVariable("globalSubscriberId"), execution.getVariable("subscriptionServiceType"), execution.getVariable("RANServiceInstanceId"))
+                       client.create(nssiServiceUri, ANServiceInstance)
+       
+                       AAIResourceUri nssiServiceUri1 = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, execution.getVariable("globalSubscriberId"), execution.getVariable("subscriptionServiceType"), execution.getVariable("RANNFServiceInstanceId"))
+                       client.create(nssiServiceUri1, ANNFServiceInstance)
+       
+               } catch (BpmnError e) {
+                       throw e
+               } catch (Exception ex) {
+                       msg = "Exception in AnNssmfUtils.createSliceProfilesInAai " + ex.getMessage()
+                       logger.info(msg)
+                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+               }
+               //end point update
+               createEndPointsInAai(execution)
+       }
+       def prepareTnFhRequest = { DelegateExecution execution ->
+               logger.debug(Prefix+"prepareTnFhRequest method start")
+
+               String nssmfRequest = anNssmfUtils.buildCreateNSSMFRequest(execution, "TN_FH", "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", "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("nssiId", null)
+               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"))
+               if(domainType.equals("TN_FH")) {
+                       serviceInfo.addProperty("nssiName", execution.getVariable("TNFH_modelName"))
+                       serviceInfo.addProperty("serviceInvariantUuid", execution.getVariable("TNFH_modelInvariantUuid"))
+                       serviceInfo.addProperty("serviceUuid", execution.getVariable("TNFH_modelUuid"))
+               }else if(domainType.equals("TN_MH")) {
+                       serviceInfo.addProperty("nssiName", execution.getVariable("TNMH_modelName"))
+                       serviceInfo.addProperty("serviceInvariantUuid", execution.getVariable("TNMH_modelInvariantUuid"))
+                       serviceInfo.addProperty("serviceUuid", execution.getVariable("TNMH_modelUuid"))
+               }
+               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")) {
+                       execution.setVariable("TNFH_NSSI", nssi)
+                       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")) {
+                       execution.setVariable("TNMH_NSSI", nssi)
+                       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 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, "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 updateAairelationships = { DelegateExecution execution ->
+               logger.debug(Prefix + "updateAairelationships Start")
+               String msg = ""
+               try {
+                       def ANNF_serviceInstanceId = execution.getVariable("RANNFServiceInstanceId")
+                       def TNFH_serviceInstanceId = execution.getVariable("TNFH_NSSI")
+                       def TNMH_serviceInstanceId = execution.getVariable("TNMH_NSSI")
+                       def AN_profileInstanceId = execution.getVariable("sliceProfileId")
+                       def AN_NSSI = execution.getVariable("RANServiceInstanceId")
+                       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/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${ANNF_profileInstanceId}"
+                       String TNFH_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${TNFH_profileInstanceId}"
+                       String TNMH_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${TNMH_profileInstanceId}"
+                       
+                       String ANNF_NSSI_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${ANNF_serviceInstanceId}"
+                       String TNFH_NSSI_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${TNFH_serviceInstanceId}"
+                       String TNMH_NSSI_relatedLink = "aai/v21/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/${subscriptionServiceType}/service-instances/service-instance/${TNMH_serviceInstanceId}"
+                       
+                       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)
+                       
+                       //create AN NSSI and ANNF,TNFH,TNMH relationship in AAI
+                       ANNF_relationship.setRelatedLink(ANNF_NSSI_relatedLink)
+                       TNFH_relationship.setRelatedLink(TNFH_NSSI_relatedLink)
+                       TNMH_relationship.setRelatedLink(TNMH_NSSI_relatedLink)
+                       anNssmfUtils.createRelationShipInAAI(execution, ANNF_relationship,AN_NSSI)
+                       anNssmfUtils.createRelationShipInAAI(execution, TNFH_relationship,AN_NSSI)
+                       anNssmfUtils.createRelationShipInAAI(execution, TNMH_relationship,AN_NSSI)
+
+               } catch (BpmnError e) {
+                       throw e
+               } catch (Exception ex) {
+
+                       msg = "Exception in DoCreateE2EServiceInstance.createCustomRelationship. " + ex.getMessage()
+                       logger.info(msg)
+                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+               }
+       }
+       
+       /**
+        * update operation status in request db
+        *
+        */
+       def prepareOperationStatusUpdate = { DelegateExecution execution ->
+               logger.debug(Prefix + "prepareOperationStatusUpdate Start")
+
+               String serviceId = execution.getVariable("dummyServiceId")
+               String jobId = execution.getVariable("jobId")
+               String nsiId = execution.getVariable("nsiId")
+               String nssiId = execution.getVariable("RANServiceInstanceId")
+               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("Allocate")
+               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("dummyServiceId")
+               String jobId = execution.getVariable("jobId")
+               String nsiId = execution.getVariable("nsiId")
+               String nssiId = execution.getVariable("RANServiceInstanceId")
+               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("Allocate")
+               updateStatus.setProgress(0)
+               updateStatus.setStatus("failed")
+               requestDBUtil.prepareUpdateResourceOperationStatus(execution, updateStatus)
+       }
+       
+       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)
+               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("uLThptPerSlice", sliceProfile.get("expDataRateUL"))
+               sliceProfile.put("dLThptPerSlice", sliceProfile.get("expDataRateDL"))
+               String sliceProfileString = objectMapper.writeValueAsString(sliceProfile)
+               JsonObject response = new JsonObject()
+               JsonObject body = new JsonObject()
+               JsonObject input = new JsonObject()
+               JsonObject commonHeader = new JsonObject()
+               JsonObject payload = new JsonObject()
+               JsonObject payloadInput = new JsonObject()
+               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("RANNSSIId", execution.getVariable("RANServiceInstanceId"))
+               payloadInput.addProperty("NSIID", execution.getVariable("nsiId"))
+               payloadInput.addProperty("RANNFNSSIId", execution.getVariable("RANNFServiceInstanceId"))
+               payloadInput.addProperty("callbackURL", callbackUrl)
+               payloadInput.add("additionalproperties", new JsonObject())
+               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()
+       }
+       
+       private void createEndPointsInAai(DelegateExecution execution) {
+               String type = "endpoint"
+               String function = "transport_EP"
+               int prefixLength = 24
+               String addressFamily = "ipv4"
+               //BH RAN end point update
+               String bh_endpoint = execution.getVariable("bh_endpoint")
+               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 nextHopInfo = jsonUtil.getJsonValue(bh_endpoint, "nextHopInfo")
+               NetworkRoute bh_ep = new NetworkRoute()
+               bh_ep.setRouteId(bh_routeId)
+               bh_ep.setFunction(function)
+               bh_ep.setRole(role)
+               bh_ep.setType(type)
+               bh_ep.setIpAddress(CU_IpAddress)
+               bh_ep.setLogicalInterfaceId(LogicalLinkId)
+               bh_ep.setNextHop(nextHopInfo)
+               bh_ep.setPrefixLength(prefixLength)
+               bh_ep.setAddressFamily(addressFamily)
+               //FH RAN end points update
+               //RU
+               String RU_routeId = UUID.randomUUID().toString()
+               execution.setVariable("tranportEp_ID_RU", RU_routeId)
+               role = "RU"
+               NetworkRoute RU_ep = new NetworkRoute()
+               RU_ep.setRouteId(RU_routeId)
+               RU_ep.setFunction(function)
+               RU_ep.setRole(role)
+               RU_ep.setType(type)
+               RU_ep.setIpAddress("192.168.100.4")
+               RU_ep.setLogicalInterfaceId("1234")
+               RU_ep.setNextHop("Host1")
+               RU_ep.setPrefixLength(prefixLength)
+               RU_ep.setAddressFamily(addressFamily)
+               //DU Ingress
+               String DUIN_routeId = UUID.randomUUID().toString()
+               execution.setVariable("tranportEp_ID_DUIN", DUIN_routeId)
+               role = "DU"
+               NetworkRoute DU_ep = new NetworkRoute()
+               DU_ep.setRouteId(DUIN_routeId)
+               DU_ep.setFunction(function)
+               DU_ep.setRole(role)
+               DU_ep.setType(type)
+               DU_ep.setIpAddress("192.168.100.5")
+               DU_ep.setLogicalInterfaceId("1234")
+               DU_ep.setNextHop("Host2")
+               DU_ep.setPrefixLength(prefixLength)
+               DU_ep.setAddressFamily(addressFamily)
+               //MH RAN end point update
+               //DUEG
+               String DUEG_routeId = UUID.randomUUID().toString()
+               execution.setVariable("tranportEp_ID_DUEG", DUEG_routeId)
+               NetworkRoute DUEG_ep = new NetworkRoute()
+               DU_ep.setRouteId(DUEG_routeId)
+               DU_ep.setNextHop("Host3")
+               //CUIN
+               String CUIN_routeId = UUID.randomUUID().toString()
+               execution.setVariable("tranportEp_ID_CUIN", CUIN_routeId)
+               NetworkRoute CUIN_ep = new NetworkRoute()
+               CUIN_ep.setRouteId(CUIN_routeId)
+               CUIN_ep.setFunction(function)
+               CUIN_ep.setRole(role)
+               CUIN_ep.setType(type)
+               CUIN_ep.setIpAddress("192.168.100.6")
+               CUIN_ep.setLogicalInterfaceId("1234")
+               CUIN_ep.setNextHop("Host4")
+               CUIN_ep.setPrefixLength(prefixLength)
+               CUIN_ep.setAddressFamily(addressFamily)
+               try {
+                       AAIResourcesClient client = new AAIResourcesClient()
+                       logger.debug("creating bh endpoint . ID : "+bh_routeId+" node details : "+bh_ep.toString())
+                       AAIResourceUri networkRouteUri = AAIUriFactory.createResourceUri( new AAIObjectType(AAINamespaceConstants.NETWORK, NetworkRoute.class), bh_routeId)
+                       client.create(networkRouteUri, bh_ep)
+                       logger.debug("creating RU endpoint . ID : "+RU_routeId+" node details : "+RU_ep.toString())
+                       networkRouteUri = AAIUriFactory.createResourceUri( new AAIObjectType(AAINamespaceConstants.NETWORK, NetworkRoute.class), RU_routeId)
+                       client.create(networkRouteUri, RU_ep)
+                       logger.debug("creating DUIN endpoint . ID : "+DUIN_routeId+" node details : "+DU_ep.toString())
+                       networkRouteUri = AAIUriFactory.createResourceUri( new AAIObjectType(AAINamespaceConstants.NETWORK, NetworkRoute.class), DUIN_routeId)
+                       client.create(networkRouteUri, DU_ep)
+                       logger.debug("creating DUEG endpoint . ID : "+DUEG_routeId+" node details : "+DU_ep.toString())
+                       networkRouteUri = AAIUriFactory.createResourceUri( new AAIObjectType(AAINamespaceConstants.NETWORK, NetworkRoute.class), DUEG_routeId)
+                       client.create(networkRouteUri, DU_ep)
+                       logger.debug("creating CUIN endpoint . ID : "+CUIN_routeId+" node details : "+CUIN_ep.toString())
+                       networkRouteUri = AAIUriFactory.createResourceUri( new AAIObjectType(AAINamespaceConstants.NETWORK, NetworkRoute.class), CUIN_routeId)
+                       client.create(networkRouteUri, CUIN_ep)
+                       //relationship b/w bh_ep and RAN NSSI
+                       def AN_NSSI = execution.getVariable("RANServiceInstanceId")
+                       Relationship relationship = new Relationship()
+                       String relatedLink = "aai/v21/network/network-routes/network-route/${bh_routeId}"               
+                       relationship.setRelatedLink(relatedLink)
+                       relationship.setRelatedTo("network-route")
+                       relationship.setRelationshipLabel("org.onap.relationships.inventory.ComposedOf")
+                       anNssmfUtils.createRelationShipInAAI(execution, relationship, AN_NSSI)
+                       def ANNF_serviceInstanceId = execution.getVariable("RANNFServiceInstanceId")
+                       relatedLink = "aai/v21/network/network-routes/network-route/${RU_routeId}"
+                       relationship.setRelatedLink(relatedLink)
+                       anNssmfUtils.createRelationShipInAAI(execution, relationship, ANNF_serviceInstanceId)
+                       relatedLink = "aai/v21/network/network-routes/network-route/${DUIN_routeId}"
+                       relationship.setRelatedLink(relatedLink)
+                       anNssmfUtils.createRelationShipInAAI(execution, relationship, ANNF_serviceInstanceId)
+                       relatedLink = "aai/v21/network/network-routes/network-route/${DUEG_routeId}"
+                       relationship.setRelatedLink(relatedLink)
+                       anNssmfUtils.createRelationShipInAAI(execution, relationship, ANNF_serviceInstanceId)
+                       relatedLink = "aai/v21/network/network-routes/network-route/${CUIN_routeId}"
+                       relationship.setRelatedLink(relatedLink)
+                       anNssmfUtils.createRelationShipInAAI(execution, relationship, ANNF_serviceInstanceId)
+               } catch (BpmnError e) {
+               throw e
+       } catch (Exception ex) {
+               String msg = "Exception in createEndPointsInAai " + ex.getMessage()
+               logger.info(msg)
+               exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+       }
+       }
+}
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateAccessNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateAccessNSSI.bpmn
new file mode 100644 (file)
index 0000000..9c12200
--- /dev/null
@@ -0,0 +1,960 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_05od9yd" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1">
+  <bpmn:process id="DoAllocateAccessNSSI" name="DoAllocateAccessNSSI" isExecutable="true">
+    <bpmn:startEvent id="StartEvent_1" name="Start">
+      <bpmn:outgoing>Flow_163f3sq</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:scriptTask id="Activity_1jj3kh9" name="Preprocess Request" scriptFormat="groovy">
+      <bpmn:incoming>Flow_163f3sq</bpmn:incoming>
+      <bpmn:outgoing>Flow_0tica8m</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.preProcessRequest(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:scriptTask id="Activity_0vhvubq" name="Get Subnet capabilities" scriptFormat="groovy">
+      <bpmn:incoming>Flow_00f37fu</bpmn:incoming>
+      <bpmn:outgoing>Flow_1w8whur</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.getSubnetCapabilities(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:scriptTask id="Activity_11vdo22" name="Prepare Resource Operation Status Update" scriptFormat="groovy">
+      <bpmn:incoming>Flow_0833cha</bpmn:incoming>
+      <bpmn:outgoing>Flow_1xw4abx</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.prepareOperationStatusUpdate(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:serviceTask id="Activity_1nfx154" name="Update Resource Operation Status">
+      <bpmn:extensionElements>
+        <camunda:connector>
+          <camunda:inputOutput>
+            <camunda:inputParameter name="url">${dbAdapterEndpoint}</camunda:inputParameter>
+            <camunda:inputParameter name="headers">
+              <camunda:map>
+                <camunda:entry key="content-type">application/soap+xml</camunda:entry>
+                <camunda:entry key="Authorization">Basic YnBlbDpwYXNzd29yZDEk</camunda:entry>
+              </camunda:map>
+            </camunda:inputParameter>
+            <camunda:inputParameter name="payload">${updateResourceOperationStatus}</camunda:inputParameter>
+            <camunda:inputParameter name="method">POST</camunda:inputParameter>
+            <camunda:outputParameter name="NSSMF_dbResponseCode">${statusCode}</camunda:outputParameter>
+            <camunda:outputParameter name="NSSMF_dbResponse">${response}</camunda:outputParameter>
+          </camunda:inputOutput>
+          <camunda:connectorId>http-connector</camunda:connectorId>
+        </camunda:connector>
+      </bpmn:extensionElements>
+      <bpmn:incoming>Flow_1xw4abx</bpmn:incoming>
+      <bpmn:outgoing>Flow_0ll5x3u</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:endEvent id="Event_0vh1hs2">
+      <bpmn:incoming>Flow_0ll5x3u</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="Flow_0833cha" sourceRef="Event_05jtdqp" targetRef="Activity_11vdo22" />
+    <bpmn:sequenceFlow id="Flow_1xw4abx" sourceRef="Activity_11vdo22" targetRef="Activity_1nfx154" />
+    <bpmn:sequenceFlow id="Flow_0ll5x3u" sourceRef="Activity_1nfx154" targetRef="Event_0vh1hs2" />
+    <bpmn:sequenceFlow id="Flow_1x3y2tg" sourceRef="Event_18r5xkz" targetRef="Activity_03dgcg5" />
+    <bpmn:scriptTask id="Activity_19laorl" name="prepare OOF request for RAN NF NSSI selection" scriptFormat="groovy">
+      <bpmn:incoming>Flow_0rb4j9r</bpmn:incoming>
+      <bpmn:outgoing>Flow_0d0f3ie</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.prepareOofRequestForRanNfNSS(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:scriptTask id="Activity_03dgcg5" name="send allocate FH NSSI request" scriptFormat="groovy">
+      <bpmn:incoming>Flow_1x3y2tg</bpmn:incoming>
+      <bpmn:outgoing>Flow_0qhjtre</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.prepareTnFhRequest(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:scriptTask id="Activity_18y4ijb" name="send allocate MH NSSI request" scriptFormat="groovy">
+      <bpmn:incoming>Flow_0zhr499</bpmn:incoming>
+      <bpmn:outgoing>Flow_04thflx</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.prepareTnMhRequest(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:intermediateCatchEvent id="Event_05jtdqp" name="Start operation status update">
+      <bpmn:outgoing>Flow_0833cha</bpmn:outgoing>
+      <bpmn:linkEventDefinition id="LinkEventDefinition_05sogjc" name="OperationStatusUpdate" />
+    </bpmn:intermediateCatchEvent>
+    <bpmn:intermediateThrowEvent id="Event_0u9308h" name="Go to start  Â operation status update">
+      <bpmn:incoming>Flow_0kcvava</bpmn:incoming>
+      <bpmn:linkEventDefinition id="LinkEventDefinition_1o9trjv" name="OperationStatusUpdate" />
+    </bpmn:intermediateThrowEvent>
+    <bpmn:intermediateCatchEvent id="Event_18r5xkz" name="start TN allocate">
+      <bpmn:outgoing>Flow_1x3y2tg</bpmn:outgoing>
+      <bpmn:linkEventDefinition id="LinkEventDefinition_15hz0uh" name="startTnAllocate" />
+    </bpmn:intermediateCatchEvent>
+    <bpmn:sequenceFlow id="Flow_0zhr499" sourceRef="Activity_0qn2fvh" targetRef="Activity_18y4ijb" />
+    <bpmn:scriptTask id="Activity_0qn2fvh" name="process Job status response" scriptFormat="groovy">
+      <bpmn:incoming>Flow_16z59pu</bpmn:incoming>
+      <bpmn:outgoing>Flow_0zhr499</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.processFhAllocateNssiJobStatusRsp(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:scriptTask id="Activity_12szahe" name="Process OOF response" scriptFormat="groovy">
+      <bpmn:incoming>Flow_1b14415</bpmn:incoming>
+      <bpmn:outgoing>Flow_1h7iq8l</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.processOofResponseForRanNSS(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:scriptTask id="Activity_0vwhzem" name="prepare OOF request for RAN NSSI selection" scriptFormat="groovy">
+      <bpmn:incoming>Flow_1w8whur</bpmn:incoming>
+      <bpmn:outgoing>Flow_0tkzfhb</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.prepareOofRequestForRanNSS(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="Flow_163f3sq" sourceRef="StartEvent_1" targetRef="Activity_1jj3kh9" />
+    <bpmn:exclusiveGateway id="Gateway_1aesepd" name="Is Response NSSI?" default="Flow_0k39zt8">
+      <bpmn:incoming>Flow_09tjspa</bpmn:incoming>
+      <bpmn:outgoing>Flow_1ipsxgh</bpmn:outgoing>
+      <bpmn:outgoing>Flow_0k39zt8</bpmn:outgoing>
+    </bpmn:exclusiveGateway>
+    <bpmn:intermediateThrowEvent id="Event_142r2sx" name="Go to start  Â operation status update">
+      <bpmn:incoming>Flow_0k8yakp</bpmn:incoming>
+      <bpmn:linkEventDefinition id="LinkEventDefinition_08wuatj" name="OperationStatusUpdate" />
+    </bpmn:intermediateThrowEvent>
+    <bpmn:intermediateThrowEvent id="Event_15zn4zi" name="Goto start TN allocate">
+      <bpmn:incoming>Flow_1exjm0h</bpmn:incoming>
+      <bpmn:linkEventDefinition id="LinkEventDefinition_13crcza" name="startTnAllocate" />
+    </bpmn:intermediateThrowEvent>
+    <bpmn:scriptTask id="Activity_1pxd5wf" name="Process OOF response" scriptFormat="groovy">
+      <bpmn:incoming>Flow_1nkqrpd</bpmn:incoming>
+      <bpmn:outgoing>Flow_1f9rw3m</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.processOofResponseForRanNfNSS(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:exclusiveGateway id="Gateway_0en9ki5" name="Is Response NSSI?" default="Flow_178fenq">
+      <bpmn:incoming>Flow_1ryi6ym</bpmn:incoming>
+      <bpmn:outgoing>Flow_178fenq</bpmn:outgoing>
+      <bpmn:outgoing>Flow_0kn30g3</bpmn:outgoing>
+    </bpmn:exclusiveGateway>
+    <bpmn:scriptTask id="Activity_0a95zgv" name="prepare SDNR request" scriptFormat="groovy">
+      <bpmn:incoming>Flow_178fenq</bpmn:incoming>
+      <bpmn:outgoing>Flow_1pbiznt</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.createSdnrRequest(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:scriptTask id="Activity_118je0o" name="process SDNR response" scriptFormat="groovy">
+      <bpmn:incoming>Flow_05yqmnj</bpmn:incoming>
+      <bpmn:outgoing>Flow_0ikdlkf</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.processSdnrResponse(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="Flow_1ipsxgh" name="yes" sourceRef="Gateway_1aesepd" targetRef="Activity_0xawnmh">
+      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{(execution.getVariable("isRspRanNssi" )  == true)}</bpmn:conditionExpression>
+    </bpmn:sequenceFlow>
+    <bpmn:sequenceFlow id="Flow_178fenq" name="No" sourceRef="Gateway_0en9ki5" targetRef="Activity_0a95zgv" />
+    <bpmn:sequenceFlow id="Flow_1w8whur" sourceRef="Activity_0vhvubq" targetRef="Activity_0vwhzem" />
+    <bpmn:sequenceFlow id="Flow_0tkzfhb" sourceRef="Activity_0vwhzem" targetRef="Activity_1u28lyv" />
+    <bpmn:sequenceFlow id="Flow_1h7iq8l" sourceRef="Activity_12szahe" targetRef="Event_0s8t1ji" />
+    <bpmn:intermediateThrowEvent id="Event_0s8t1ji" name="Go to start NSSI allocate">
+      <bpmn:incoming>Flow_1h7iq8l</bpmn:incoming>
+      <bpmn:linkEventDefinition id="LinkEventDefinition_0yzxmpv" name="NSSIAllocate" />
+    </bpmn:intermediateThrowEvent>
+    <bpmn:intermediateCatchEvent id="Event_1glt41l" name="start NSSI allocate">
+      <bpmn:outgoing>Flow_09tjspa</bpmn:outgoing>
+      <bpmn:linkEventDefinition id="LinkEventDefinition_05u2hpg" name="NSSIAllocate" />
+    </bpmn:intermediateCatchEvent>
+    <bpmn:sequenceFlow id="Flow_09tjspa" sourceRef="Event_1glt41l" targetRef="Gateway_1aesepd" />
+    <bpmn:sequenceFlow id="Flow_0k39zt8" name="No" sourceRef="Gateway_1aesepd" targetRef="Activity_0fdm3in" />
+    <bpmn:scriptTask id="Activity_0p02joo" name="Prepare&#10;Decompose&#10;Service&#10;" scriptFormat="groovy">
+      <bpmn:incoming>Flow_0tica8m</bpmn:incoming>
+      <bpmn:outgoing>Flow_0mcd9bo</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.prepareDecomposeService(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="Flow_0tica8m" sourceRef="Activity_1jj3kh9" targetRef="Activity_0p02joo" />
+    <bpmn:callActivity id="Activity_1u28lyv" name="Call DoCreateSubnetOption" calledElement="DoHandleOofRequest">
+      <bpmn:extensionElements>
+        <camunda:in source="nssiSelection_Url" target="apiPath" />
+        <camunda:in source="nssiSelection_correlator" target="correlator" />
+        <camunda:in source="nssiSelection_messageType" target="messageType" />
+        <camunda:in source="nssiSelection_timeout" target="timeout" />
+        <camunda:in source="nssiSelection_oofRequest" target="oofRequest" />
+        <camunda:out source="WorkflowException" target="WorkflowException" />
+        <camunda:out source="asyncCallbackResponse" target="nssiSelection_asyncCallbackResponse" />
+      </bpmn:extensionElements>
+      <bpmn:incoming>Flow_0tkzfhb</bpmn:incoming>
+      <bpmn:outgoing>Flow_1b14415</bpmn:outgoing>
+    </bpmn:callActivity>
+    <bpmn:sequenceFlow id="Flow_1b14415" sourceRef="Activity_1u28lyv" targetRef="Activity_12szahe" />
+    <bpmn:callActivity id="Activity_1ux83hz" name="Query Job status" calledElement="QueryJobStatus ">
+      <bpmn:extensionElements>
+        <camunda:in source="esrInfo" target="esrInfo" />
+        <camunda:in source="serviceInfo" target="serviceInfo" />
+        <camunda:in source="TNFH_jobId" target="jobId" />
+        <camunda:out source="jobResponse" target="TNFH_jobResponse" />
+        <camunda:in source="responseId" target="responseId" />
+        <camunda:in source="job_timeout" target="timeout" />
+      </bpmn:extensionElements>
+      <bpmn:incoming>Flow_1p48xbl</bpmn:incoming>
+      <bpmn:outgoing>Flow_16z59pu</bpmn:outgoing>
+    </bpmn:callActivity>
+    <bpmn:sequenceFlow id="Flow_16z59pu" sourceRef="Activity_1ux83hz" targetRef="Activity_0qn2fvh" />
+    <bpmn:callActivity id="Activity_0c0cq9d" name="Query Job status" calledElement="QueryJobStatus ">
+      <bpmn:extensionElements>
+        <camunda:in source="esrInfo" target="esrInfo" />
+        <camunda:in source="serviceInfo" target="serviceInfo" />
+        <camunda:in source="TNMH_jobId" target="jobId" />
+        <camunda:out source="jobResponse" target="TNMH_jobResponse" />
+        <camunda:in source="responseId" target="responseId" />
+        <camunda:in source="job_timeout" target="timeout" />
+      </bpmn:extensionElements>
+      <bpmn:incoming>Flow_0fdetmo</bpmn:incoming>
+      <bpmn:outgoing>Flow_1v3wpa2</bpmn:outgoing>
+    </bpmn:callActivity>
+    <bpmn:callActivity id="Activity_0y9xgkl" name="Call DoCreateSubnetOption" calledElement="DoHandleOofRequest">
+      <bpmn:extensionElements>
+        <camunda:in source="nssiSelection_Url" target="apiPath" />
+        <camunda:in source="nssiSelection_correlator" target="correlator" />
+        <camunda:in source="nssiSelection_messageType" target="messageType" />
+        <camunda:in source="nssiSelection_timeout" target="timeout" />
+        <camunda:in source="nssiSelection_oofRequest" target="oofRequest" />
+        <camunda:out source="WorkflowException" target="WorkflowException" />
+        <camunda:out source="asyncCallbackResponse" target="nfNssiSelection_asyncCallbackResponse" />
+      </bpmn:extensionElements>
+      <bpmn:incoming>Flow_0d0f3ie</bpmn:incoming>
+      <bpmn:outgoing>Flow_1nkqrpd</bpmn:outgoing>
+    </bpmn:callActivity>
+    <bpmn:sequenceFlow id="Flow_1nkqrpd" sourceRef="Activity_0y9xgkl" targetRef="Activity_1pxd5wf" />
+    <bpmn:sequenceFlow id="Flow_0kn30g3" name="yes" sourceRef="Gateway_0en9ki5" targetRef="Activity_08i0hzk">
+      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{(execution.getVariable("isRspRanNfNssi" )  == true)}</bpmn:conditionExpression>
+    </bpmn:sequenceFlow>
+    <bpmn:callActivity id="Activity_0vbzhej" name="call sdnr for RAN NF NSSI creation" calledElement="DoHandleSdnrDmaapRequest">
+      <bpmn:extensionElements>
+        <camunda:in source="createNSSI_sdnrRequest" target="sdnrRequest" />
+        <camunda:out source="asyncCallbackResponse" target="SDNR_asyncCallbackResponse" />
+        <camunda:out source="WorkflowException" target="WorkflowException" />
+        <camunda:in source="createNSSI_correlator" target="correlator" />
+        <camunda:in source="createNSSI_messageType" target="messageType" />
+        <camunda:in source="createNSSI_timeout" target="timeout" />
+      </bpmn:extensionElements>
+      <bpmn:incoming>Flow_1pbiznt</bpmn:incoming>
+      <bpmn:outgoing>Flow_05yqmnj</bpmn:outgoing>
+    </bpmn:callActivity>
+    <bpmn:sequenceFlow id="Flow_1pbiznt" sourceRef="Activity_0a95zgv" targetRef="Activity_0vbzhej" />
+    <bpmn:sequenceFlow id="Flow_05yqmnj" sourceRef="Activity_0vbzhej" targetRef="Activity_118je0o" />
+    <bpmn:sequenceFlow id="Flow_0qhjtre" sourceRef="Activity_03dgcg5" targetRef="Activity_12vtq69" />
+    <bpmn:sequenceFlow id="Flow_04thflx" sourceRef="Activity_18y4ijb" targetRef="Activity_0qpy2sg" />
+    <bpmn:scriptTask id="Activity_0zn4e4n" name="process Job status response" scriptFormat="groovy">
+      <bpmn:incoming>Flow_1v3wpa2</bpmn:incoming>
+      <bpmn:outgoing>Flow_0bd6dhi</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.processMhAllocateNssiJobStatusRsp(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="Flow_1v3wpa2" sourceRef="Activity_0c0cq9d" targetRef="Activity_0zn4e4n" />
+    <bpmn:scriptTask id="Activity_1ll0nr1" name="Process Decomposition" scriptFormat="groovy">
+      <bpmn:incoming>Flow_1i10qog</bpmn:incoming>
+      <bpmn:outgoing>Flow_00f37fu</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.processDecomposition(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="Flow_00f37fu" sourceRef="Activity_1ll0nr1" targetRef="Activity_0vhvubq" />
+    <bpmn:callActivity id="Activity_06hcbu6" name="Call Decompose Service" calledElement="DecomposeService">
+      <bpmn:extensionElements>
+        <camunda:in source="msoRequestId" target="msoRequestId" />
+        <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
+        <camunda:in source="serviceModelInfo" target="serviceModelInfo" />
+        <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
+        <camunda:out source="serviceDecomposition" target="ranNsstServiceDecomposition" />
+        <camunda:out source="WorkflowException" target="WorkflowException" />
+      </bpmn:extensionElements>
+      <bpmn:incoming>Flow_0mcd9bo</bpmn:incoming>
+      <bpmn:outgoing>Flow_1i10qog</bpmn:outgoing>
+    </bpmn:callActivity>
+    <bpmn:sequenceFlow id="Flow_0mcd9bo" sourceRef="Activity_0p02joo" targetRef="Activity_06hcbu6" />
+    <bpmn:sequenceFlow id="Flow_1i10qog" sourceRef="Activity_06hcbu6" targetRef="Activity_1ll0nr1" />
+    <bpmn:scriptTask id="Activity_1aweui4" name="post process RAN NF NSSI modify" scriptFormat="groovy">
+      <bpmn:incoming>Flow_1k3vqxg</bpmn:incoming>
+      <bpmn:outgoing>Flow_0n1mh5c</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.processRanNfModifyRsp(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:serviceTask id="Activity_1bjike9" name="Update Resource Operation Status">
+      <bpmn:extensionElements>
+        <camunda:connector>
+          <camunda:inputOutput>
+            <camunda:inputParameter name="url">${dbAdapterEndpoint}</camunda:inputParameter>
+            <camunda:inputParameter name="headers">
+              <camunda:map>
+                <camunda:entry key="content-type">application/soap+xml</camunda:entry>
+                <camunda:entry key="Authorization">Basic YnBlbDpwYXNzd29yZDEk</camunda:entry>
+              </camunda:map>
+            </camunda:inputParameter>
+            <camunda:inputParameter name="payload">${initResourceOperationStatus}</camunda:inputParameter>
+            <camunda:inputParameter name="method">POST</camunda:inputParameter>
+            <camunda:outputParameter name="NSSMF_dbResponseCode">${statusCode}</camunda:outputParameter>
+            <camunda:outputParameter name="NSSMF_dbResponse">${response}</camunda:outputParameter>
+          </camunda:inputOutput>
+          <camunda:connectorId>http-connector</camunda:connectorId>
+        </camunda:connector>
+      </bpmn:extensionElements>
+      <bpmn:incoming>Flow_1k0z6lp</bpmn:incoming>
+      <bpmn:outgoing>Flow_10j50jb</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="Flow_1k0z6lp" sourceRef="Activity_0xawnmh" targetRef="Activity_1bjike9" />
+    <bpmn:scriptTask id="Activity_0xawnmh" name="prepare Modify Access NSSI inputs" scriptFormat="groovy">
+      <bpmn:incoming>Flow_1ipsxgh</bpmn:incoming>
+      <bpmn:outgoing>Flow_1k0z6lp</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.prepareModifyAccessNssiInputs(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:callActivity id="Activity_0ffp1no" name="Query Job status" calledElement="QueryJobStatus ">
+      <bpmn:extensionElements>
+        <camunda:in source="esrInfo" target="esrInfo" />
+        <camunda:in source="serviceInfo" target="serviceInfo" />
+        <camunda:in source="modifyRanNssiJobId" target="jobId" />
+        <camunda:out source="jobResponse" target="jobResponse" />
+        <camunda:in source="responseId" target="responseId" />
+        <camunda:in source="job_timeout" target="timeout" />
+      </bpmn:extensionElements>
+      <bpmn:incoming>Flow_0ile39j</bpmn:incoming>
+      <bpmn:outgoing>Flow_0mmpy7h</bpmn:outgoing>
+    </bpmn:callActivity>
+    <bpmn:scriptTask id="Activity_0yfrqtb" name="process Job status response" scriptFormat="groovy">
+      <bpmn:incoming>Flow_0mmpy7h</bpmn:incoming>
+      <bpmn:outgoing>Flow_0k8yakp</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.processModifyJobStatusRsp(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="Flow_0mmpy7h" sourceRef="Activity_0ffp1no" targetRef="Activity_0yfrqtb" />
+    <bpmn:sequenceFlow id="Flow_0k8yakp" sourceRef="Activity_0yfrqtb" targetRef="Event_142r2sx" />
+    <bpmn:sequenceFlow id="Flow_0ile39j" sourceRef="Activity_1k94obj" targetRef="Activity_0ffp1no" />
+    <bpmn:scriptTask id="Activity_1k94obj" name="prepare query job status" scriptFormat="groovy">
+      <bpmn:incoming>Flow_05s0wso</bpmn:incoming>
+      <bpmn:outgoing>Flow_0ile39j</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.createModifyNssiQueryJobStatus(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:callActivity id="Activity_16w4zg9" name="Call ANModifyNSSI" calledElement="DoModifyAccessNSSI">
+      <bpmn:extensionElements>
+        <camunda:in source="msoRequestId" target="msoRequestId" />
+        <camunda:in source="globalSubscriberId" target="globalSubscriberId" />
+        <camunda:in source="RANServiceInstanceId" target="serviceInstanceID" />
+        <camunda:in source="nsiId" target="nsiId" />
+        <camunda:in source="networkType" target="networkType" />
+        <camunda:in source="subscriptionServiceType" target="subscriptionServiceType" />
+        <camunda:in source="modifyRanNssiJobId" target="jobId" />
+        <camunda:in source="modifySliceParams" target="sliceParams" />
+        <camunda:out source="WorkflowException" target="WorkflowException" />
+        <camunda:in source="servicename" target="servicename" />
+      </bpmn:extensionElements>
+      <bpmn:incoming>Flow_10j50jb</bpmn:incoming>
+      <bpmn:outgoing>Flow_05s0wso</bpmn:outgoing>
+    </bpmn:callActivity>
+    <bpmn:sequenceFlow id="Flow_10j50jb" sourceRef="Activity_1bjike9" targetRef="Activity_16w4zg9" />
+    <bpmn:sequenceFlow id="Flow_05s0wso" sourceRef="Activity_16w4zg9" targetRef="Activity_1k94obj" />
+    <bpmn:scriptTask id="Activity_0fdm3in" name="Prepare&#10;Decompose&#10;Service&#10;" scriptFormat="groovy">
+      <bpmn:incoming>Flow_0k39zt8</bpmn:incoming>
+      <bpmn:incoming>Flow_083bb3k</bpmn:incoming>
+      <bpmn:outgoing>Flow_0reg6l5</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.prepareNsstDecomposeService(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:callActivity id="Activity_0a7a04p" name="Call Decompose Service" calledElement="DecomposeService">
+      <bpmn:extensionElements>
+        <camunda:in source="msoRequestId" target="msoRequestId" />
+        <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
+        <camunda:in source="serviceModelInfo" target="serviceModelInfo" />
+        <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
+        <camunda:out source="serviceDecomposition" target="nsstServiceDecomposition" />
+        <camunda:out source="WorkflowException" target="WorkflowException" />
+      </bpmn:extensionElements>
+      <bpmn:incoming>Flow_0reg6l5</bpmn:incoming>
+      <bpmn:outgoing>Flow_0jdjta3</bpmn:outgoing>
+    </bpmn:callActivity>
+    <bpmn:exclusiveGateway id="Gateway_1cmraqs" name="Is all nsst decomposed?" default="Flow_083bb3k">
+      <bpmn:incoming>Flow_0y78v1q</bpmn:incoming>
+      <bpmn:outgoing>Flow_0rb4j9r</bpmn:outgoing>
+      <bpmn:outgoing>Flow_083bb3k</bpmn:outgoing>
+    </bpmn:exclusiveGateway>
+    <bpmn:scriptTask id="Activity_1nmk2rt" name="Process Decomposition" scriptFormat="groovy">
+      <bpmn:incoming>Flow_0jdjta3</bpmn:incoming>
+      <bpmn:outgoing>Flow_0y78v1q</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.processNsstDecomposition(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="Flow_0reg6l5" sourceRef="Activity_0fdm3in" targetRef="Activity_0a7a04p" />
+    <bpmn:sequenceFlow id="Flow_0jdjta3" sourceRef="Activity_0a7a04p" targetRef="Activity_1nmk2rt" />
+    <bpmn:sequenceFlow id="Flow_0y78v1q" sourceRef="Activity_1nmk2rt" targetRef="Gateway_1cmraqs" />
+    <bpmn:sequenceFlow id="Flow_0rb4j9r" name="yes" sourceRef="Gateway_1cmraqs" targetRef="Activity_19laorl">
+      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{(execution.getVariable("isAllNsstsDecomposed" )  == true)}</bpmn:conditionExpression>
+    </bpmn:sequenceFlow>
+    <bpmn:sequenceFlow id="Flow_0d0f3ie" sourceRef="Activity_19laorl" targetRef="Activity_0y9xgkl" />
+    <bpmn:scriptTask id="Activity_027ic3j" name="create slice profiles in AAI" scriptFormat="groovy">
+      <bpmn:incoming>Flow_1f9rw3m</bpmn:incoming>
+      <bpmn:outgoing>Flow_1ryi6ym</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.createSliceProfilesInAai(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="Flow_1f9rw3m" sourceRef="Activity_1pxd5wf" targetRef="Activity_027ic3j" />
+    <bpmn:sequenceFlow id="Flow_1ryi6ym" sourceRef="Activity_027ic3j" targetRef="Gateway_0en9ki5" />
+    <bpmn:scriptTask id="Activity_12vtq69" name="prepare query job status" scriptFormat="groovy">
+      <bpmn:incoming>Flow_0qhjtre</bpmn:incoming>
+      <bpmn:outgoing>Flow_1p48xbl</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.createFhAllocateNssiJobQuery(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="Flow_1p48xbl" sourceRef="Activity_12vtq69" targetRef="Activity_1ux83hz" />
+    <bpmn:scriptTask id="Activity_0qpy2sg" name="prepare query job status" scriptFormat="groovy">
+      <bpmn:incoming>Flow_04thflx</bpmn:incoming>
+      <bpmn:outgoing>Flow_0fdetmo</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.createMhAllocateNssiJobQuery(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="Flow_0fdetmo" sourceRef="Activity_0qpy2sg" targetRef="Activity_0c0cq9d" />
+    <bpmn:scriptTask id="Activity_0pa8al6" name="create RAN NSSI and RAN NF NSSI in AAI" scriptFormat="groovy">
+      <bpmn:incoming>Flow_0ikdlkf</bpmn:incoming>
+      <bpmn:outgoing>Flow_1exjm0h</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.updateAaiWithRANInstances(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="Flow_0ikdlkf" sourceRef="Activity_118je0o" targetRef="Activity_0pa8al6" />
+    <bpmn:sequenceFlow id="Flow_1exjm0h" sourceRef="Activity_0pa8al6" targetRef="Event_15zn4zi" />
+    <bpmn:sequenceFlow id="Flow_0bd6dhi" sourceRef="Activity_0zn4e4n" targetRef="Activity_0vf28ld" />
+    <bpmn:sequenceFlow id="Flow_0kcvava" sourceRef="Activity_0vf28ld" targetRef="Event_0u9308h" />
+    <bpmn:scriptTask id="Activity_0vf28ld" name="update AAI relationships">
+      <bpmn:incoming>Flow_0bd6dhi</bpmn:incoming>
+      <bpmn:outgoing>Flow_0kcvava</bpmn:outgoing>
+      <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.updateAairelationships(execution)</bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:subProcess id="Activity_0bcs8g1" name="Sub-process for FalloutHandler and Rollback" triggeredByEvent="true">
+      <bpmn:startEvent id="Event_077lf7i">
+        <bpmn:outgoing>Flow_18rrdsq</bpmn:outgoing>
+        <bpmn:errorEventDefinition id="ErrorEventDefinition_1chyysm" />
+      </bpmn:startEvent>
+      <bpmn:endEvent id="Event_1p00v8c">
+        <bpmn:incoming>Flow_0c9dr7z</bpmn:incoming>
+      </bpmn:endEvent>
+      <bpmn:scriptTask id="Activity_084fqbd" name="Handle Unexpected Error" scriptFormat="groovy">
+        <bpmn:incoming>Flow_0umohws</bpmn:incoming>
+        <bpmn:outgoing>Flow_0c9dr7z</bpmn:outgoing>
+        <bpmn:script>import org.onap.so.bpmn.common.scripts.*
+ExceptionUtil ex = new ExceptionUtil()
+ex.processJavaException(execution)</bpmn:script>
+      </bpmn:scriptTask>
+      <bpmn:sequenceFlow id="Flow_0c9dr7z" sourceRef="Activity_084fqbd" targetRef="Event_1p00v8c" />
+      <bpmn:scriptTask id="Activity_1adxijg" name="Prepare Resource Operation Status Update" scriptFormat="groovy">
+        <bpmn:incoming>Flow_18rrdsq</bpmn:incoming>
+        <bpmn:outgoing>Flow_11qgtdm</bpmn:outgoing>
+        <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def nss = new DoAllocateAccessNSSI()
+nss.prepareFailedOperationStatusUpdate(execution)</bpmn:script>
+      </bpmn:scriptTask>
+      <bpmn:serviceTask id="Activity_0p0mwue" name="Update Resource Operation Status">
+        <bpmn:extensionElements>
+          <camunda:connector>
+            <camunda:inputOutput>
+              <camunda:inputParameter name="url">${dbAdapterEndpoint}</camunda:inputParameter>
+              <camunda:inputParameter name="headers">
+                <camunda:map>
+                  <camunda:entry key="content-type">application/soap+xml</camunda:entry>
+                  <camunda:entry key="Authorization">Basic YnBlbDpwYXNzd29yZDEk</camunda:entry>
+                </camunda:map>
+              </camunda:inputParameter>
+              <camunda:inputParameter name="payload">${updateResourceOperationStatus}</camunda:inputParameter>
+              <camunda:inputParameter name="method">POST</camunda:inputParameter>
+              <camunda:outputParameter name="NSSMF_dbResponseCode">${statusCode}</camunda:outputParameter>
+              <camunda:outputParameter name="NSSMF_dbResponse">${response}</camunda:outputParameter>
+            </camunda:inputOutput>
+            <camunda:connectorId>http-connector</camunda:connectorId>
+          </camunda:connector>
+        </bpmn:extensionElements>
+        <bpmn:incoming>Flow_11qgtdm</bpmn:incoming>
+        <bpmn:outgoing>Flow_0umohws</bpmn:outgoing>
+      </bpmn:serviceTask>
+      <bpmn:sequenceFlow id="Flow_18rrdsq" sourceRef="Event_077lf7i" targetRef="Activity_1adxijg" />
+      <bpmn:sequenceFlow id="Flow_11qgtdm" sourceRef="Activity_1adxijg" targetRef="Activity_0p0mwue" />
+      <bpmn:sequenceFlow id="Flow_0umohws" sourceRef="Activity_0p0mwue" targetRef="Activity_084fqbd" />
+    </bpmn:subProcess>
+    <bpmn:intermediateThrowEvent id="Event_1cqde7p" name="Goto start TN allocate">
+      <bpmn:incoming>Flow_0n1mh5c</bpmn:incoming>
+      <bpmn:linkEventDefinition id="LinkEventDefinition_0da795k" name="startTnAllocate" />
+    </bpmn:intermediateThrowEvent>
+    <bpmn:sequenceFlow id="Flow_0n1mh5c" sourceRef="Activity_1aweui4" targetRef="Event_1cqde7p" />
+    <bpmn:callActivity id="Activity_08i0hzk" name="DoModifyRanNfNssi" calledElement="DoModifyRanNfNssi">
+      <bpmn:extensionElements>
+        <camunda:in source="msoRequestId" target="msoRequestId" />
+        <camunda:in source="globalSubscriberId" target="globalSubscriberId" />
+        <camunda:in source="ANNF_NSSI" target="serviceInstanceID" />
+        <camunda:in source="subscriptionServiceType" target="subscriptionServiceType" />
+        <camunda:in source="ANNF_sliceProfileInstanceId" target="sliceProfileId" />
+        <camunda:in source="snssaiList" target="snssaiList" />
+        <camunda:out source="ranNfStatus" target="ranNfStatus" />
+        <camunda:in source="modifyAction" target="modifyAction" />
+        <camunda:in source="ranNfSliceProfile" target="additionalProperties" />
+      </bpmn:extensionElements>
+      <bpmn:incoming>Flow_0kn30g3</bpmn:incoming>
+      <bpmn:outgoing>Flow_1k3vqxg</bpmn:outgoing>
+    </bpmn:callActivity>
+    <bpmn:sequenceFlow id="Flow_1k3vqxg" sourceRef="Activity_08i0hzk" targetRef="Activity_1aweui4" />
+    <bpmn:sequenceFlow id="Flow_083bb3k" sourceRef="Gateway_1cmraqs" targetRef="Activity_0fdm3in" />
+  </bpmn:process>
+  <bpmn:message id="Message_1r7nv8u" name="WorkflowMessage" />
+  <bpmn:error id="Error_047rteq" name="MSO Workflow Exception" errorCode="MSOWorkflowException" />
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoAllocateAccessNSSI">
+      <bpmndi:BPMNEdge id="Flow_0kcvava_di" bpmnElement="Flow_0kcvava">
+        <di:waypoint x="1800" y="820" />
+        <di:waypoint x="1882" y="820" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0bd6dhi_di" bpmnElement="Flow_0bd6dhi">
+        <di:waypoint x="1620" y="820" />
+        <di:waypoint x="1700" y="820" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1exjm0h_di" bpmnElement="Flow_1exjm0h">
+        <di:waypoint x="1850" y="680" />
+        <di:waypoint x="1882" y="680" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0ikdlkf_di" bpmnElement="Flow_0ikdlkf">
+        <di:waypoint x="1720" y="680" />
+        <di:waypoint x="1750" y="680" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0fdetmo_di" bpmnElement="Flow_0fdetmo">
+        <di:waypoint x="1260" y="820" />
+        <di:waypoint x="1340" y="820" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1p48xbl_di" bpmnElement="Flow_1p48xbl">
+        <di:waypoint x="580" y="820" />
+        <di:waypoint x="640" y="820" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1ryi6ym_di" bpmnElement="Flow_1ryi6ym">
+        <di:waypoint x="1330" y="531" />
+        <di:waypoint x="1355" y="531" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1f9rw3m_di" bpmnElement="Flow_1f9rw3m">
+        <di:waypoint x="1210" y="531" />
+        <di:waypoint x="1230" y="531" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0d0f3ie_di" bpmnElement="Flow_0d0f3ie">
+        <di:waypoint x="950" y="530" />
+        <di:waypoint x="980" y="530" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0rb4j9r_di" bpmnElement="Flow_0rb4j9r">
+        <di:waypoint x="815" y="529" />
+        <di:waypoint x="833" y="529" />
+        <di:waypoint x="833" y="530" />
+        <di:waypoint x="850" y="530" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="824" y="543" width="17" height="14" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0y78v1q_di" bpmnElement="Flow_0y78v1q">
+        <di:waypoint x="720" y="529" />
+        <di:waypoint x="765" y="529" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0jdjta3_di" bpmnElement="Flow_0jdjta3">
+        <di:waypoint x="600" y="529" />
+        <di:waypoint x="620" y="529" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0reg6l5_di" bpmnElement="Flow_0reg6l5">
+        <di:waypoint x="470" y="529" />
+        <di:waypoint x="485" y="529" />
+        <di:waypoint x="485" y="530" />
+        <di:waypoint x="500" y="530" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_05s0wso_di" bpmnElement="Flow_05s0wso">
+        <di:waypoint x="770" y="380" />
+        <di:waypoint x="810" y="380" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_10j50jb_di" bpmnElement="Flow_10j50jb">
+        <di:waypoint x="630" y="380" />
+        <di:waypoint x="670" y="380" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0ile39j_di" bpmnElement="Flow_0ile39j">
+        <di:waypoint x="910" y="380" />
+        <di:waypoint x="950" y="380" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0k8yakp_di" bpmnElement="Flow_0k8yakp">
+        <di:waypoint x="1190" y="380" />
+        <di:waypoint x="1242" y="380" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0mmpy7h_di" bpmnElement="Flow_0mmpy7h">
+        <di:waypoint x="1050" y="380" />
+        <di:waypoint x="1090" y="380" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1k0z6lp_di" bpmnElement="Flow_1k0z6lp">
+        <di:waypoint x="490" y="380" />
+        <di:waypoint x="530" y="380" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1i10qog_di" bpmnElement="Flow_1i10qog">
+        <di:waypoint x="630" y="120" />
+        <di:waypoint x="690" y="120" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0mcd9bo_di" bpmnElement="Flow_0mcd9bo">
+        <di:waypoint x="480" y="120" />
+        <di:waypoint x="530" y="120" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_00f37fu_di" bpmnElement="Flow_00f37fu">
+        <di:waypoint x="790" y="120" />
+        <di:waypoint x="830" y="120" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1v3wpa2_di" bpmnElement="Flow_1v3wpa2">
+        <di:waypoint x="1440" y="820" />
+        <di:waypoint x="1520" y="820" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_04thflx_di" bpmnElement="Flow_04thflx">
+        <di:waypoint x="1100" y="820" />
+        <di:waypoint x="1160" y="820" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0qhjtre_di" bpmnElement="Flow_0qhjtre">
+        <di:waypoint x="410" y="820" />
+        <di:waypoint x="480" y="820" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_05yqmnj_di" bpmnElement="Flow_05yqmnj">
+        <di:waypoint x="1580" y="680" />
+        <di:waypoint x="1620" y="680" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1pbiznt_di" bpmnElement="Flow_1pbiznt">
+        <di:waypoint x="1430" y="680" />
+        <di:waypoint x="1480" y="680" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0kn30g3_di" bpmnElement="Flow_0kn30g3">
+        <di:waypoint x="1403" y="529" />
+        <di:waypoint x="1460" y="529" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1413" y="513" width="17" height="14" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1nkqrpd_di" bpmnElement="Flow_1nkqrpd">
+        <di:waypoint x="1080" y="531" />
+        <di:waypoint x="1110" y="531" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_16z59pu_di" bpmnElement="Flow_16z59pu">
+        <di:waypoint x="740" y="820" />
+        <di:waypoint x="810" y="820" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1b14415_di" bpmnElement="Flow_1b14415">
+        <di:waypoint x="1200" y="120" />
+        <di:waypoint x="1240" y="120" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0tica8m_di" bpmnElement="Flow_0tica8m">
+        <di:waypoint x="340" y="120" />
+        <di:waypoint x="380" y="120" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0k39zt8_di" bpmnElement="Flow_0k39zt8">
+        <di:waypoint x="270" y="405" />
+        <di:waypoint x="270" y="529" />
+        <di:waypoint x="370" y="529" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="249" y="421" width="15" height="14" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_09tjspa_di" bpmnElement="Flow_09tjspa">
+        <di:waypoint x="198" y="380" />
+        <di:waypoint x="245" y="380" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1h7iq8l_di" bpmnElement="Flow_1h7iq8l">
+        <di:waypoint x="1340" y="120" />
+        <di:waypoint x="1372" y="120" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0tkzfhb_di" bpmnElement="Flow_0tkzfhb">
+        <di:waypoint x="1060" y="120" />
+        <di:waypoint x="1100" y="120" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1w8whur_di" bpmnElement="Flow_1w8whur">
+        <di:waypoint x="930" y="120" />
+        <di:waypoint x="960" y="120" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_178fenq_di" bpmnElement="Flow_178fenq">
+        <di:waypoint x="1380" y="556" />
+        <di:waypoint x="1380" y="640" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1386" y="574" width="15" height="14" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1ipsxgh_di" bpmnElement="Flow_1ipsxgh">
+        <di:waypoint x="295" y="380" />
+        <di:waypoint x="390" y="380" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="319" y="363" width="17" height="14" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_163f3sq_di" bpmnElement="Flow_163f3sq">
+        <di:waypoint x="198" y="120" />
+        <di:waypoint x="240" y="120" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0zhr499_di" bpmnElement="Flow_0zhr499">
+        <di:waypoint x="910" y="820" />
+        <di:waypoint x="1000" y="820" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1x3y2tg_di" bpmnElement="Flow_1x3y2tg">
+        <di:waypoint x="228" y="820" />
+        <di:waypoint x="310" y="820" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0ll5x3u_di" bpmnElement="Flow_0ll5x3u">
+        <di:waypoint x="600" y="1010" />
+        <di:waypoint x="692" y="1010" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1xw4abx_di" bpmnElement="Flow_1xw4abx">
+        <di:waypoint x="420" y="1010" />
+        <di:waypoint x="500" y="1010" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0833cha_di" bpmnElement="Flow_0833cha">
+        <di:waypoint x="228" y="1010" />
+        <di:waypoint x="320" y="1010" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0n1mh5c_di" bpmnElement="Flow_0n1mh5c">
+        <di:waypoint x="1690" y="529" />
+        <di:waypoint x="1742" y="529" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1k3vqxg_di" bpmnElement="Flow_1k3vqxg">
+        <di:waypoint x="1560" y="529" />
+        <di:waypoint x="1590" y="529" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_083bb3k_di" bpmnElement="Flow_083bb3k">
+        <di:waypoint x="790" y="554" />
+        <di:waypoint x="790" y="730" />
+        <di:waypoint x="420" y="730" />
+        <di:waypoint x="420" y="569" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
+        <dc:Bounds x="162" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="167" y="152" width="25" height="14" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_01iduqx_di" bpmnElement="Activity_1jj3kh9">
+        <dc:Bounds x="240" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_1gdi5bo_di" bpmnElement="Activity_0vhvubq">
+        <dc:Bounds x="830" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_11vdo22_di" bpmnElement="Activity_11vdo22">
+        <dc:Bounds x="320" y="970" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_1nfx154_di" bpmnElement="Activity_1nfx154">
+        <dc:Bounds x="500" y="970" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Event_0vh1hs2_di" bpmnElement="Event_0vh1hs2">
+        <dc:Bounds x="692" y="992" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0icw8wt_di" bpmnElement="Activity_19laorl">
+        <dc:Bounds x="850" y="490" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_10z6k5t_di" bpmnElement="Activity_03dgcg5">
+        <dc:Bounds x="310" y="780" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_1dracjc_di" bpmnElement="Activity_18y4ijb">
+        <dc:Bounds x="1000" y="780" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Event_0g0i472_di" bpmnElement="Event_05jtdqp">
+        <dc:Bounds x="192" y="992" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="174" y="1035" width="73" height="27" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Event_1ea1h0i_di" bpmnElement="Event_0u9308h">
+        <dc:Bounds x="1882" y="802" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1860" y="850" width="79" height="40" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Event_1fj3anx_di" bpmnElement="Event_18r5xkz">
+        <dc:Bounds x="192" y="802" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="170" y="845" width="81" height="14" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0nm8unl_di" bpmnElement="Activity_0qn2fvh">
+        <dc:Bounds x="810" y="780" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_12szahe_di" bpmnElement="Activity_12szahe">
+        <dc:Bounds x="1240" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_1oepxwk_di" bpmnElement="Activity_0vwhzem">
+        <dc:Bounds x="960" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Gateway_1aesepd_di" bpmnElement="Gateway_1aesepd" isMarkerVisible="true">
+        <dc:Bounds x="245" y="355" width="50" height="50" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="239" y="326" width="62" height="27" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Event_142r2sx_di" bpmnElement="Event_142r2sx">
+        <dc:Bounds x="1242" y="362" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1220" y="397" width="79" height="40" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Event_15zn4zi_di" bpmnElement="Event_15zn4zi">
+        <dc:Bounds x="1882" y="662" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1868" y="705" width="67" height="27" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_1pxd5wf_di" bpmnElement="Activity_1pxd5wf">
+        <dc:Bounds x="1110" y="491" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Gateway_0en9ki5_di" bpmnElement="Gateway_0en9ki5" isMarkerVisible="true">
+        <dc:Bounds x="1355" y="506" width="50" height="50" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1349" y="476" width="62" height="27" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0a95zgv_di" bpmnElement="Activity_0a95zgv">
+        <dc:Bounds x="1330" y="640" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_118je0o_di" bpmnElement="Activity_118je0o">
+        <dc:Bounds x="1620" y="640" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Event_0qwruv5_di" bpmnElement="Event_0s8t1ji">
+        <dc:Bounds x="1372" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1351" y="145" width="81" height="27" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Event_1vfrb2l_di" bpmnElement="Event_1glt41l">
+        <dc:Bounds x="162" y="362" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="155" y="405" width="51" height="27" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0p02joo_di" bpmnElement="Activity_0p02joo">
+        <dc:Bounds x="380" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_1u28lyv_di" bpmnElement="Activity_1u28lyv">
+        <dc:Bounds x="1100" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_1ux83hz_di" bpmnElement="Activity_1ux83hz">
+        <dc:Bounds x="640" y="780" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0c0cq9d_di" bpmnElement="Activity_0c0cq9d">
+        <dc:Bounds x="1340" y="780" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0y9xgkl_di" bpmnElement="Activity_0y9xgkl">
+        <dc:Bounds x="980" y="491" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0vbzhej_di" bpmnElement="Activity_0vbzhej">
+        <dc:Bounds x="1480" y="640" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0zn4e4n_di" bpmnElement="Activity_0zn4e4n">
+        <dc:Bounds x="1520" y="780" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_1ll0nr1_di" bpmnElement="Activity_1ll0nr1">
+        <dc:Bounds x="690" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_06hcbu6_di" bpmnElement="Activity_06hcbu6">
+        <dc:Bounds x="530" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_1xke4xc_di" bpmnElement="Activity_1aweui4">
+        <dc:Bounds x="1590" y="489" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_1bjike9_di" bpmnElement="Activity_1bjike9">
+        <dc:Bounds x="530" y="340" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_02rsimm_di" bpmnElement="Activity_0xawnmh">
+        <dc:Bounds x="390" y="340" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0ffp1no_di" bpmnElement="Activity_0ffp1no">
+        <dc:Bounds x="950" y="340" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0yfrqtb_di" bpmnElement="Activity_0yfrqtb">
+        <dc:Bounds x="1090" y="340" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_1wagv3s_di" bpmnElement="Activity_1k94obj">
+        <dc:Bounds x="810" y="340" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_16w4zg9_di" bpmnElement="Activity_16w4zg9">
+        <dc:Bounds x="670" y="340" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0fdm3in_di" bpmnElement="Activity_0fdm3in">
+        <dc:Bounds x="370" y="489" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0a7a04p_di" bpmnElement="Activity_0a7a04p">
+        <dc:Bounds x="500" y="489" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Gateway_1cmraqs_di" bpmnElement="Gateway_1cmraqs" isMarkerVisible="true">
+        <dc:Bounds x="765" y="504" width="50" height="50" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="755" y="467" width="70" height="27" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_1nmk2rt_di" bpmnElement="Activity_1nmk2rt">
+        <dc:Bounds x="620" y="489" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_027ic3j_di" bpmnElement="Activity_027ic3j">
+        <dc:Bounds x="1230" y="491" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_12vtq69_di" bpmnElement="Activity_12vtq69">
+        <dc:Bounds x="480" y="780" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0qpy2sg_di" bpmnElement="Activity_0qpy2sg">
+        <dc:Bounds x="1160" y="780" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0pa8al6_di" bpmnElement="Activity_0pa8al6">
+        <dc:Bounds x="1750" y="640" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_1riw9uv_di" bpmnElement="Activity_0vf28ld">
+        <dc:Bounds x="1700" y="780" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Event_1cqde7p_di" bpmnElement="Event_1cqde7p">
+        <dc:Bounds x="1742" y="511" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1728" y="554" width="67" height="27" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_08i0hzk_di" bpmnElement="Activity_08i0hzk">
+        <dc:Bounds x="1460" y="489" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0bcs8g1_di" bpmnElement="Activity_0bcs8g1" isExpanded="true">
+        <dc:Bounds x="410" y="1160" width="781" height="196" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="Flow_0umohws_di" bpmnElement="Flow_0umohws">
+        <di:waypoint x="800" y="1264" />
+        <di:waypoint x="870" y="1264" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_11qgtdm_di" bpmnElement="Flow_11qgtdm">
+        <di:waypoint x="640" y="1264" />
+        <di:waypoint x="700" y="1264" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_18rrdsq_di" bpmnElement="Flow_18rrdsq">
+        <di:waypoint x="476" y="1264" />
+        <di:waypoint x="540" y="1264" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0c9dr7z_di" bpmnElement="Flow_0c9dr7z">
+        <di:waypoint x="970" y="1264" />
+        <di:waypoint x="1078" y="1264" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="Event_077lf7i_di" bpmnElement="Event_077lf7i">
+        <dc:Bounds x="440" y="1246" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Event_1p00v8c_di" bpmnElement="Event_1p00v8c">
+        <dc:Bounds x="1078" y="1246" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_084fqbd_di" bpmnElement="Activity_084fqbd">
+        <dc:Bounds x="870" y="1224" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_1adxijg_di" bpmnElement="Activity_1adxijg">
+        <dc:Bounds x="540" y="1224" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="Activity_0p0mwue_di" bpmnElement="Activity_0p0mwue">
+        <dc:Bounds x="700" y="1224" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>