From b7a3cecc8ed9d7bfca90f1ce0a0b429a0ca46043 Mon Sep 17 00:00:00 2001 From: biniek Date: Tue, 23 Jan 2018 14:43:24 +0100 Subject: Refactor of DecomposeJsonUtils class. Change-Id: I72b779eb17ffb901266de605eb2eda49f13bd03e Issue-ID: SO-374 Signed-off-by: biniek --- .../mso/bpmn/common/scripts/DecomposeService.groovy | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'bpmn/MSOCommonBPMN/src') diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/DecomposeService.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/DecomposeService.groovy index 06cc284620..2645ea3c02 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/DecomposeService.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/DecomposeService.groovy @@ -17,7 +17,9 @@ * limitations under the License. * ============LICENSE_END========================================================= */ -package org.openecomp.mso.bpmn.common.scripts; +package org.openecomp.mso.bpmn.common.scripts + +import org.openecomp.mso.bpmn.core.json.DecomposeJsonUtil; import static org.apache.commons.lang3.StringUtils.*; @@ -96,12 +98,12 @@ public class DecomposeService extends AbstractServiceTaskProcessor { // check for input String serviceModelInvariantId = execution.getVariable("DDS_serviceModelInvariantId") String modelVersion = execution.getVariable("DDS_modelVersion") - + utils.log("DEBUG", "serviceModelInvariantId: " + serviceModelInvariantId, isDebugEnabled) - utils.log("DEBUG", "modelVersion: " + modelVersion, isDebugEnabled) - + utils.log("DEBUG", "modelVersion: " + modelVersion, isDebugEnabled) + JSONObject catalogDbResponse = null - + if (modelVersion != null && modelVersion.length() > 0) catalogDbResponse = catalogDbUtils.getServiceResourcesByServiceModelInvariantUuidAndServiceModelVersion(execution, serviceModelInvariantId, modelVersion, "v2") else @@ -140,7 +142,7 @@ public class DecomposeService extends AbstractServiceTaskProcessor { utils.log("DEBUG", "getting service decomposition", isDebugEnabled) String catalogDbResponse = execution.getVariable("DDS_catalogDbResponse") - ServiceDecomposition serviceDecomposition = new ServiceDecomposition(catalogDbResponse, serviceInstanceId) + ServiceDecomposition serviceDecomposition = DecomposeJsonUtil.jsonToServiceDecomposition(catalogDbResponse, serviceInstanceId) execution.setVariable("serviceDecomposition", serviceDecomposition) execution.setVariable("serviceDecompositionString", serviceDecomposition.toJsonString()) -- cgit 1.2.3-korg