From 1f69e1c3569196305c23f085cfbc03bdba14f4e0 Mon Sep 17 00:00:00 2001 From: Steve Siani Date: Thu, 23 May 2019 00:09:46 -0400 Subject: make templating service support JsonNode instead of any. Issue-ID: CCSDK-1360 Signed-off-by: Steve Siani Change-Id: I374a6a013514df9062ffdfc1ab278bd9e00776d9 --- .../resolution/processor/ResourceAssignmentProcessor.kt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/main') diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt index 3482d4534..1cc44a2cb 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt @@ -28,7 +28,6 @@ import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintFunctionNode import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintVelocityTemplateService -import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition import org.slf4j.LoggerFactory @@ -68,27 +67,23 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode") - open fun resolveInputKeyMappingVariables(inputKeyMapping: Map): Map { - val resolvedInputKeyMapping = HashMap() + open fun resolveInputKeyMappingVariables(inputKeyMapping: Map): Map { + val resolvedInputKeyMapping = HashMap() if (MapUtils.isNotEmpty(inputKeyMapping)) { for ((key, value) in inputKeyMapping) { val resultValue = raRuntimeService.getResolutionStore(value) - val expressionValue = JacksonUtils.getValue(resultValue) - log.trace("Reference dictionary key ({}), value ({})", key, expressionValue) - resolvedInputKeyMapping[key] = expressionValue + resolvedInputKeyMapping[key] = resultValue } } return resolvedInputKeyMapping } - //TODO("Convert keyMapping = MutableMap") - open suspend fun resolveFromInputKeyMapping(valueToResolve: String, keyMapping: MutableMap): + open suspend fun resolveFromInputKeyMapping(valueToResolve: String, keyMapping: MutableMap): String { if (valueToResolve.isEmpty() || !valueToResolve.contains("$")) { return valueToResolve } - //TODO("Optimize to JSON Node directly") + //TODO("Optimize to JSON Node directly without velocity").asJsonNode().toString() return BluePrintVelocityTemplateService.generateContent(valueToResolve, keyMapping.asJsonNode().toString()) } -- cgit 1.2.3-korg