Fix bugs found in TN Slicing integration involving OOF
[so.git] / bpmn / so-bpmn-infrastructure-common / src / main / groovy / org / onap / so / bpmn / infrastructure / scripts / DoAllocateAccessNSSI.groovy
index 10acd6e..54fa2ab 100644 (file)
@@ -369,7 +369,6 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                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
@@ -576,7 +575,11 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                ANServiceInstance.setServiceRole(serviceRole)
                 List<String> snssaiList = execution.getVariable("snssaiList")
                String snssai = snssaiList.get(0)
-               //ANServiceInstance.setEnvironmentContext(snssai)
+                //ANServiceInstance.setEnvironmentContext(snssai)
+               String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
+               String modelUuid = execution.getVariable("modelUuid") as String
+               ANServiceInstance.setModelInvariantId(modelInvariantUuid)
+               ANServiceInstance.setModelVersionId(modelUuid)
                 ANServiceInstance.setEnvironmentContext(execution.getVariable("networkType")) //Network Type
                ANServiceInstance.setWorkloadContext("AN") //domain Type
                
@@ -639,15 +642,15 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                ANServiceInstance.setServiceType(execution.getVariable("sst") as String)
                ANServiceInstance.setOrchestrationStatus(serviceStatus)
                String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "pLMNIdList") as String
-               ANServiceInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
+                ANServiceInstance.setServiceInstanceLocationId(jsonUtil.StringArrayToList(serviceInstanceLocationid).get(0))           
                ANServiceInstance.setServiceRole(serviceRole)
                List<String> snssaiList = jsonUtil.StringArrayToList(execution.getVariable("snssaiList") as String)
                String snssai = snssaiList.get(0)
-               ANServiceInstance.setEnvironmentContext(snssai)
                String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
                String modelUuid = execution.getVariable("modelUuid") as String
                ANServiceInstance.setModelInvariantId(modelInvariantUuid)
                ANServiceInstance.setModelVersionId(modelUuid)
+                ANServiceInstance.setEnvironmentContext(execution.getVariable("networkType")) //Network Type
                ANServiceInstance.setWorkloadContext("AN")
                String serviceFunctionAn = jsonUtil.getJsonValue(execution.getVariable("sliceProfile") as String, "resourceSharingLevel")
                ANServiceInstance.setServiceFunction(serviceFunctionAn)
@@ -1033,7 +1036,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                RU_ep.setType(type)
                RU_ep.setIpAddress("192.168.100.4")
                RU_ep.setLogicalInterfaceId("1234")
-               RU_ep.setNextHop("Host1")
+               RU_ep.setNextHop("networkId-providerId-10-clientId-0-topologyId-2-nodeId-10.1.1.1-ltpId-512")
                RU_ep.setPrefixLength(prefixLength)
                RU_ep.setAddressFamily(addressFamily)
                //DU Ingress
@@ -1047,7 +1050,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                DU_ep.setType(type)
                DU_ep.setIpAddress("192.168.100.5")
                DU_ep.setLogicalInterfaceId("1234")
-               DU_ep.setNextHop("Host2")
+               DU_ep.setNextHop("networkId-providerId-20-clientId-0-topologyId-2-nodeId-10.2.1.2-ltpId-512")
                DU_ep.setPrefixLength(prefixLength)
                DU_ep.setAddressFamily(addressFamily)
                //MH RAN end point update
@@ -1063,7 +1066,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                 DUEG_ep.setLogicalInterfaceId("1234")
                 DUEG_ep.setPrefixLength(prefixLength)
                 DUEG_ep.setAddressFamily(addressFamily)
-               DUEG_ep.setNextHop("Host3")
+               DUEG_ep.setNextHop("networkId-providerId-10-clientId-0-topologyId-2-nodeId-10.1.1.1-ltpId-512")
                //CUIN
                String CUIN_routeId = UUID.randomUUID().toString()
                execution.setVariable("tranportEp_ID_CUIN", CUIN_routeId)
@@ -1074,7 +1077,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                CUIN_ep.setType(type)
                CUIN_ep.setIpAddress("192.168.100.6")
                CUIN_ep.setLogicalInterfaceId("1234")
-               CUIN_ep.setNextHop("Host4")
+               CUIN_ep.setNextHop("networkId-providerId-20-clientId-0-topologyId-2-nodeId-10.2.1.2-ltpId-512")
                CUIN_ep.setPrefixLength(prefixLength)
                CUIN_ep.setAddressFamily(addressFamily)
                try {