From caca7facdd3d494d0b13cba1b5a00d0ff3853fb6 Mon Sep 17 00:00:00 2001 From: deepikasatheesh Date: Tue, 19 Jan 2021 08:56:49 +0000 Subject: Fixed issue in AN NSSMF activation flow for SDNR interactions Issue-ID: SO-3393 Signed-off-by: deepikasatheesh Change-Id: I49071edf9400b25f61e6f598b43c567d3a968c4a --- .../scripts/DoActivateAccessNSSI.groovy | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap') diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateAccessNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateAccessNSSI.groovy index 5f61c17589..897cdfcd7b 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateAccessNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateAccessNSSI.groovy @@ -81,7 +81,17 @@ class DoActivateAccessNSSI extends AbstractServiceTaskProcessor { private static final String VENDOR_ONAP = "ONAP_internal" - def orchStatusMap = [activateInstance:"activated",deactivateInstance:"deactivated"] + enum orchStatusMap { + activateInstance("activated"), + deactivateInstance("deactivated") + + private String value; + + private orchStatusMap(String value) { + this.value = value; + } + } + @Override public void preProcessRequest(DelegateExecution execution) { @@ -143,7 +153,7 @@ class DoActivateAccessNSSI extends AbstractServiceTaskProcessor { ServiceInstance sliceProfileInstance = execution.getVariable(KEY_SLICE_PROFILE) String orchStatus = sliceProfileInstance.getOrchestrationStatus() String operationType = execution.getVariable("operationType") - if(orchStatusMap.get(operationType).equalsIgnoreCase(orchStatus)) { + if(orchStatusMap.valueOf(operationType).toString().equalsIgnoreCase(orchStatus)) { execution.setVariable("shouldChangeSPStatus", false) }else { execution.setVariable("shouldChangeSPStatus", true) @@ -166,7 +176,7 @@ class DoActivateAccessNSSI extends AbstractServiceTaskProcessor { String orchStatus = sliceProfileInstance.getOrchestrationStatus() String operationType = execution.getVariable("operationType") - if(orchStatusMap.get(operationType).equalsIgnoreCase(orchStatus)) { + if(orchStatusMap.valueOf(operationType).toString().equalsIgnoreCase(orchStatus)) { execution.setVariable("shouldChangeAN_NF_SPStatus", false) }else { execution.setVariable("shouldChangeAN_NF_SPStatus", true) @@ -266,7 +276,7 @@ class DoActivateAccessNSSI extends AbstractServiceTaskProcessor { String orchStatus = sliceProfileInstance.getOrchestrationStatus() String operationType = execution.getVariable("operationType") - if(orchStatusMap.get(operationType).equalsIgnoreCase(orchStatus)) { + if(orchStatusMap.valueOf(operationType).toString().equalsIgnoreCase(orchStatus)) { execution.setVariable("shouldChangeTN_FH_SPStatus", false) }else { execution.setVariable("shouldChangeTN_FH_SPStatus", true) @@ -305,7 +315,7 @@ class DoActivateAccessNSSI extends AbstractServiceTaskProcessor { String orchStatus = sliceProfileInstance.getOrchestrationStatus() String operationType = execution.getVariable("operationType") - if(orchStatusMap.get(operationType).equalsIgnoreCase(orchStatus)) { + if(orchStatusMap.valueOf(operationType).toString().equalsIgnoreCase(orchStatus)) { execution.setVariable("shouldChangeTN_MH_SPStatus", false) }else { execution.setVariable("shouldChangeTN_MH_SPStatus", true) @@ -575,6 +585,7 @@ class DoActivateAccessNSSI extends AbstractServiceTaskProcessor { serviceInfo.setServiceUuid(tnNssi.getModelVersionId()) serviceInfo.setGlobalSubscriberId(globalSubscriberId) serviceInfo.setSubscriptionServiceType(subscriptionServiceType) + serviceInfo.setNssiId(nssiId) JsonObject json = new JsonObject() Gson jsonConverter = new Gson() -- cgit 1.2.3-korg