From 10eef7b0bd5362eeda3a27275a476f0c462d30a6 Mon Sep 17 00:00:00 2001 From: deepikasatheesh Date: Fri, 30 Jul 2021 17:06:18 +0000 Subject: [PATCH] Fix issues in AN NSSMF for allocate &modify flow Issue-ID: SO-3624 Signed-off-by: deepikasatheesh Change-Id: I3e11f1748706913621f54e8cd725ca00c71ba682 --- .../so/bpmn/infrastructure/scripts/AllocateSliceSubnet.groovy | 2 +- .../so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy | 10 ++++++---- .../so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy | 4 ++-- .../so/bpmn/infrastructure/scripts/ModifySliceSubnet.groovy | 3 ++- .../src/main/resources/process/AllocateSliceSubnet.bpmn | 6 +++--- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AllocateSliceSubnet.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AllocateSliceSubnet.groovy index 78cafa7be5..1e65c1a9dd 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AllocateSliceSubnet.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AllocateSliceSubnet.groovy @@ -114,7 +114,7 @@ class AllocateSliceSubnet extends AbstractServiceTaskProcessor { exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) } else { - execution.setVariable("networkType", networkType.toUpperCase()) + execution.setVariable("networkType", networkType.toLowerCase()) } //requestParameters, subscriptionServiceType is 5G 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 index f3fca050a2..a4d503a86c 100644 --- 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 @@ -565,7 +565,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { List snssaiList = execution.getVariable("snssaiList") String snssai = snssaiList.get(0) //ANServiceInstance.setEnvironmentContext(snssai) - ANServiceInstance.setEnvironmentContext("an") //Network Type + ANServiceInstance.setEnvironmentContext(execution.getVariable("networkType")) //Network Type ANServiceInstance.setWorkloadContext("AN") //domain Type logger.debug("completed AN service instance build "+ ANServiceInstance.toString()) @@ -631,7 +631,8 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { ANServiceInstance.setServiceRole(serviceRole) List snssaiList = execution.getVariable("snssaiList") String snssai = snssaiList.get(0) - ANServiceInstance.setEnvironmentContext(snssai) + //ANServiceInstance.setEnvironmentContext(snssai) + ANServiceInstance.setEnvironmentContext(execution.getVariable("networkType")) String modelInvariantUuid = execution.getVariable("modelInvariantUuid") String modelUuid = execution.getVariable("modelUuid") ANServiceInstance.setModelInvariantId(modelInvariantUuid) @@ -651,7 +652,8 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { ANNFServiceInstance.setServiceRole(serviceRole) snssaiList = execution.getVariable("snssaiList") snssai = snssaiList.get(0) - ANNFServiceInstance.setEnvironmentContext(snssai) + //ANNFServiceInstance.setEnvironmentContext(snssai) + ANNFServiceInstance.setEnvironmentContext(execution.getVariable("networkType")) ANNFServiceInstance.setModelInvariantId(execution.getVariable("ANNF_modelInvariantUuid")) ANNFServiceInstance.setModelVersionId(execution.getVariable("ANNF_modelUuid")) ANNFServiceInstance.setWorkloadContext("AN_NF") @@ -923,7 +925,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { JsonObject commonHeader = new JsonObject() JsonObject payload = new JsonObject() JsonObject payloadInput = new JsonObject() - commonHeader.addProperty("timeStamp",new Date(System.currentTimeMillis()).format("yyyy-MM-dd'T'HH:mm:ss.sss'Z'", TimeZone.getDefault())) + commonHeader.addProperty("timestamp",new Date(System.currentTimeMillis()).format("yyyy-MM-dd'T'HH:mm:ss.sss'Z'", TimeZone.getDefault())) commonHeader.addProperty("api-ver", "1.0") commonHeader.addProperty("originator-id", "testing") commonHeader.addProperty("request-id", requestId) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy index 8859af25f6..f6be861bde 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy @@ -388,12 +388,12 @@ class DoModifyAccessNSSI extends AbstractServiceTaskProcessor { Optional resource = wrapper01.asBean(org.onap.aai.domain.yang.LogicalLink.class) if (resource.isPresent()) { org.onap.aai.domain.yang.LogicalLink logicalLinkInstance = resource.get() - if(domainType.equalsIgnoreCase("TN-FH")) + if(domainType.equalsIgnoreCase("TN_FH")) { execution.setVariable("tranportEp_ID_RU",logicalLinkInstance.getLinkName()) execution.setVariable("tranportEp_ID_DUIN",logicalLinkInstance.getLinkName2()) } - else if(domainType.equalsIgnoreCase("TN-MH")) + else if(domainType.equalsIgnoreCase("TN_MH")) { execution.setVariable("tranportEp_ID_DUEG",logicalLinkInstance.getLinkName()) execution.setVariable("tranportEp_ID_CUIN",logicalLinkInstance.getLinkName2()) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ModifySliceSubnet.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ModifySliceSubnet.groovy index 7e505d1912..146ceddab4 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ModifySliceSubnet.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ModifySliceSubnet.groovy @@ -142,7 +142,8 @@ class ModifySliceSubnet extends AbstractServiceTaskProcessor { ResourceOperationStatus initStatus = new ResourceOperationStatus() initStatus.setServiceId(nsiId) initStatus.setOperationId(jobId) - initStatus.setResourceTemplateUUID(modelUuid) + //initStatus.setResourceTemplateUUID(modelUuid) + initStatus.setResourceInstanceID(nssiId) initStatus.setOperType("Modify") requestDBUtil.prepareInitResourceOperationStatus(execution, initStatus) diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/AllocateSliceSubnet.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/AllocateSliceSubnet.bpmn index 4012467df9..bfc8ccacb2 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/AllocateSliceSubnet.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/AllocateSliceSubnet.bpmn @@ -55,13 +55,13 @@ nss.sendSyncResponse(execution) - #{execution.getVariable("networkType") == "CN"} + #{execution.getVariable("networkType") == "cn"} - #{execution.getVariable("networkType") == "TN"} + #{execution.getVariable("networkType") == "tn"} - #{execution.getVariable("networkType") == "AN"} + #{execution.getVariable("networkType") == "an"} -- 2.16.6