From c8a5fd977678e56e18e0306a5ade89bdfa1e9b9e Mon Sep 17 00:00:00 2001 From: hyu2010 Date: Sat, 2 Jan 2021 17:27:33 -0500 Subject: Fixes for bugs found in Transport Slicing integration This update contains for the fixes for the following JIRA: SO-3444: Transport Slicing Integration: add config flag for enable/disable SDNC CCVPN network configuration Issue-ID: SO-3444 Signed-off-by: hyu2010 Change-Id: I7ccc3735e6a46c0453da0dd7d04086b73cc50eb1 --- .../infrastructure/scripts/DoActivateTnNssi.groovy | 3 + .../scripts/DoCreateTnNssiInstance.groovy | 2 + .../scripts/DoDeallocateTnNssi.groovy | 5 +- .../infrastructure/scripts/TnNssmfUtils.groovy | 14 +++ .../subprocess/DoActivateTransportNSSI.bpmn | 112 +++++++++++++-------- .../subprocess/DoCreateTnNssiInstance.bpmn | 62 +++++++++--- .../subprocess/DoDeallocateTransportNSSI.bpmn | 96 ++++++++++++------ 7 files changed, 205 insertions(+), 89 deletions(-) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy index 37e3df1505..f3f8c8bacf 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy @@ -83,6 +83,7 @@ public class DoActivateTnNssi extends AbstractServiceTaskProcessor { String actionType = operationType.equals("activateInstance") ? "activate" : "deactivate" execution.setVariable("actionType", actionType) + tnNssmfUtils.setEnableSdncConfig(execution) logger.debug("Finish preProcessRequest") } @@ -147,6 +148,8 @@ public class DoActivateTnNssi extends AbstractServiceTaskProcessor { String jobId = execution.getVariable("jobId") String nsiId = execution.getVariable("nsiId") String operType = execution.getVariable("actionType") + operType = operType.toUpperCase() + ResourceOperationStatus roStatus = tnNssmfUtils.buildRoStatus(modelUuid, ssInstanceId, jobId, nsiId, operType, status, progress, statusDescription) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy index 0b028e6c13..04f07b66d4 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy @@ -63,6 +63,8 @@ class DoCreateTnNssiInstance extends AbstractServiceTaskProcessor { }""" execution.setVariable("serviceModelInfo", serviceModelInfo) + tnNssmfUtils.setEnableSdncConfig(execution) + logger.trace("Exit preProcessRequest") } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy index a8622b9253..a715e7799d 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy @@ -80,6 +80,9 @@ class DoDeallocateTnNssi extends AbstractServiceTaskProcessor { "modelVersion":"" }""" execution.setVariable("serviceModelInfo", serviceModelInfo) + + tnNssmfUtils.setEnableSdncConfig(execution) + logger.debug("Finish preProcessRequest") } @@ -155,7 +158,7 @@ class DoDeallocateTnNssi extends AbstractServiceTaskProcessor { String nsiId = execution.getVariable("nsiId") ResourceOperationStatus roStatus = tnNssmfUtils.buildRoStatus(modelUuid, ssInstanceId, - jobId, nsiId, "deallocate", status, progress, statusDescription) + jobId, nsiId, "DEALLOCATE", status, progress, statusDescription) logger.debug("DoDeallocateTnNssi: roStatus={}", roStatus) requestDBUtil.prepareUpdateResourceOperationStatus(execution, roStatus) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy index cfee1aa0cf..009b0a1941 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy @@ -354,4 +354,18 @@ class TnNssmfUtils { return roStatus } + + + void setEnableSdncConfig(DelegateExecution execution) { + String enableSdnc = UrnPropertiesReader.getVariable( + "mso.workflow.TnNssmf.enableSDNCNetworkConfig") + if (isBlank(enableSdnc)) { + logger.debug("mso.workflow.TnNssmf.enableSDNCNetworkConfig is undefined, so use default value (true)") + enableSdnc = "true" + } + + logger.debug("setEnableSdncConfig: enableSdnc=" + enableSdnc) + + execution.setVariable("enableSdnc", enableSdnc) + } } diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn index 4447b32f4a..51448b027c 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn @@ -36,6 +36,7 @@ runScript.prepareUpdateJobStatus(execution,"finished","100","Activate or Deactiv SequenceFlow_1jdb2oq + Flow_0b2uim4 SequenceFlow_0kixzdj import org.onap.so.bpmn.infrastructure.scripts.* def actionType = execution.getVariable("actionType") @@ -45,7 +46,7 @@ runScript.updateAAIOrchStatus(execution) - SequenceFlow_07e12rt + Flow_0046aj5 Flow_0cpctye import org.onap.so.bpmn.infrastructure.scripts.* def runScript = new DoActivateTnNssi() @@ -84,7 +85,7 @@ runScript.validateSDNCResponse(execution, response) def runScript = new DoActivateTnNssi() runScript.preProcessRequest(execution) - + @@ -108,46 +109,69 @@ runScript.preProcessRequest(execution) Flow_1032bi1 + + SequenceFlow_07e12rt + Flow_0046aj5 + Flow_0b2uim4 + + + #{(execution.getVariable("enableSdnc" ) == true)} + + + + + + - + - - - - - + + + + + - - + + - - + + - - + + - - + + - - - + + + + + + + + + + + + + @@ -155,8 +179,35 @@ runScript.preProcessRequest(execution) + + + + + + - + + + + + + + + + + + + + + + + + + + + + + @@ -178,27 +229,6 @@ runScript.preProcessRequest(execution) - - - - - - - - - - - - - - - - - - - - - diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn index fefa022bb9..1f29f817b8 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn @@ -29,7 +29,7 @@ dcsi.createServiceInstance(execution) def dcsi = new DoCreateTnNssiInstance() dcsi.createAllottedResource(execution) - + Flow_1c8zr59 @@ -67,13 +67,23 @@ dcsi.validateSDNCResponse(execution, response, "allocate") - + SequenceFlow_1uiz85h + Flow_07tmxxo - SequenceFlow_17u69c4 + Flow_0dp5afv + + SequenceFlow_17u69c4 + Flow_0dp5afv + Flow_07tmxxo + + + #{(execution.getVariable("enableSdnc" ) == true)} + + @@ -91,7 +101,7 @@ dcsi.validateSDNCResponse(execution, response, "allocate") - + @@ -118,12 +128,36 @@ dcsi.validateSDNCResponse(execution, response, "allocate") + + + + + + + + + + + + + + + + + + + + + + + + @@ -141,21 +175,21 @@ dcsi.validateSDNCResponse(execution, response, "allocate") + + + - + - + - - - - - - - - + + + + + diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn index 9dbc9909fc..de8391428d 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn @@ -35,7 +35,7 @@ runScript.prepareUpdateJobStatus(execution,"finished","100","Deallocated TN NSSI - SequenceFlow_07e12rt + Flow_0sj0mtu Flow_0cpctye import org.onap.so.bpmn.infrastructure.scripts.* def runScript = new DoDeallocateTnNssi() @@ -68,6 +68,7 @@ runScript.validateSDNCResponse(execution, response, "deallocate") SequenceFlow_1jdb2oq + Flow_0dirb5b SequenceFlow_1jygjln import org.onap.so.bpmn.infrastructure.scripts.* def runScript = new DoDeallocateTnNssi() @@ -81,7 +82,7 @@ runScript.deleteServiceInstance(execution) def runScript = new DoDeallocateTnNssi() runScript.preProcessRequest(execution) - + @@ -106,6 +107,15 @@ runScript.preProcessRequest(execution) Flow_0ca4l8d + + SequenceFlow_07e12rt + Flow_0sj0mtu + Flow_0dirb5b + + + #{(execution.getVariable("enableSdnc" ) == true)} + + @@ -113,40 +123,54 @@ runScript.preProcessRequest(execution) - - + + - - + + - + - + - - - + + + - - + + - - + + - - + + + + + + + + + + + + + + + + @@ -154,17 +178,35 @@ runScript.preProcessRequest(execution) - + + + + - + - + - + + + + + + + + + + + + + + + + @@ -185,18 +227,6 @@ runScript.preProcessRequest(execution) - - - - - - - - - - - - -- cgit 1.2.3-korg