summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-09-06 12:43:30 +0000
committerGerrit Code Review <gerrit@onap.org>2019-09-06 12:43:30 +0000
commitff853257afc3ba42059fad2453f51674a61248d2 (patch)
treea2878ac654fbc57e5649ae7ad6b6d9e5f3469497
parent16dfa234954d54334f73b2a5c0ed3da47ff27c13 (diff)
parent50a9d5df3bb42d204248c7ffc025b4c58d0c6ccb (diff)
Merge "Resource resolution fix + improvement."
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt9
1 files changed, 7 insertions, 2 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt
index 641175ca2..51170a9b2 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt
@@ -28,6 +28,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.proc
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceDefinitionUtils.createResourceAssignments
import org.onap.ccsdk.cds.controllerblueprints.core.*
+import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition
import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintTemplateService
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
@@ -151,7 +152,9 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica
ResourceAssignmentUtils.generateResourceDataForAssignments(resourceAssignments.toList())
resolvedContent = blueprintTemplateService.generateContent(bluePrintRuntimeService, nodeTemplateName,
- artifactTemplate, resolvedParamJsonContent)
+ artifactTemplate, resolvedParamJsonContent, false,
+ mutableMapOf(ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_OCCURRENCE to
+ properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_OCCURRENCE].asJsonPrimitive()))
if (isToStore(properties)) {
templateResolutionDBService.write(properties, resolvedContent, bluePrintRuntimeService, artifactPrefix)
@@ -330,7 +333,9 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica
resourceAssignmentList.forEach {
if (compareOne(resourceResolution, it)) {
log.info("Resource ({}) already resolve: value=({})", it.name, resourceResolution.value)
- val value = resourceResolution.value!!.asJsonPrimitive()
+
+ // Make sure to recreate value as per the defined type.
+ val value = resourceResolution.value!!.asJsonType(it.property!!.type)
it.property!!.value = value
it.status = resourceResolution.status
ResourceAssignmentUtils.setResourceDataValue(it, raRuntimeService, value)