summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy')
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy16
1 files changed, 13 insertions, 3 deletions
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 a715e7799d..b09161d5cd 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
@@ -38,6 +38,9 @@ import org.onap.so.db.request.beans.ResourceOperationStatus
import org.slf4j.Logger
import org.slf4j.LoggerFactory
+import static org.apache.commons.lang3.StringUtils.isBlank
+import static org.apache.commons.lang3.StringUtils.isEmpty
+
class DoDeallocateTnNssi extends AbstractServiceTaskProcessor {
String Prefix = "TNDEALLOC_"
@@ -68,10 +71,11 @@ class DoDeallocateTnNssi extends AbstractServiceTaskProcessor {
String sliceServiceInstanceName = execution.getVariable("servicename")
execution.setVariable("sliceServiceInstanceName", sliceServiceInstanceName)
-
String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
String modelUuid = execution.getVariable("modelUuid")
- //here modelVersion is not set, we use modelUuid to decompose the service.
+ if (isEmpty(modelUuid)) {
+ modelUuid = tnNssmfUtils.getModelUuidFromServiceInstance(execution.getVariable("serviceInstanceID"))
+ }
def isDebugLogEnabled = true
execution.setVariable("isDebugLogEnabled", isDebugLogEnabled)
String serviceModelInfo = """{
@@ -81,7 +85,13 @@ class DoDeallocateTnNssi extends AbstractServiceTaskProcessor {
}"""
execution.setVariable("serviceModelInfo", serviceModelInfo)
- tnNssmfUtils.setEnableSdncConfig(execution)
+ String additionalPropJsonStr = execution.getVariable("sliceParams")
+ if (isBlank(additionalPropJsonStr) ||
+ isBlank(tnNssmfUtils.setExecVarFromJsonIfExists(execution,
+ additionalPropJsonStr,
+ "enableSdnc", "enableSdnc"))) {
+ tnNssmfUtils.setEnableSdncConfig(execution)
+ }
logger.debug("Finish preProcessRequest")
}