aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-08-09 21:48:43 +0000
committerGerrit Code Review <gerrit@onap.org>2019-08-09 21:48:43 +0000
commitb4441ff5bebb5a0b24148ee804215ffde485d40a (patch)
tree3a0d97fcce5c86a08d77745a04795f9b0e39dfc3
parent097a6e66c3ff19aa53ef3a72dce3a2e41c4eb9ed (diff)
parent56f989b82d6065a8aad01b28469aed16f7663e5c (diff)
Merge "Set resource data value when fetch from database"
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt10
1 files changed, 7 insertions, 3 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 314065763..b9b710390 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
@@ -121,7 +121,8 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica
if (isToStore(properties)) {
val existingResourceResolution = isNewResolution(bluePrintRuntimeService, properties, artifactPrefix)
if (existingResourceResolution.isNotEmpty()) {
- updateResourceAssignmentWithExisting(existingResourceResolution, resourceAssignments)
+ updateResourceAssignmentWithExisting(bluePrintRuntimeService as ResourceAssignmentRuntimeService,
+ existingResourceResolution, resourceAssignments)
}
}
@@ -296,15 +297,18 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica
}
// Update the resource assignment list with the status of the resource that have already been resolved
- private fun updateResourceAssignmentWithExisting(resourceResolutionList: List<ResourceResolution>,
+ private fun updateResourceAssignmentWithExisting(raRuntimeService : ResourceAssignmentRuntimeService,
+ resourceResolutionList: List<ResourceResolution>,
resourceAssignmentList: MutableList<ResourceAssignment>) {
resourceResolutionList.forEach { resourceResolution ->
if (resourceResolution.status == BluePrintConstants.STATUS_SUCCESS) {
resourceAssignmentList.forEach {
if (compareOne(resourceResolution, it)) {
log.info("Resource ({}) already resolve: value=({})", it.name, resourceResolution.value)
- it.property!!.value = resourceResolution.value!!.asJsonPrimitive()
+ val value = resourceResolution.value!!.asJsonPrimitive()
+ it.property!!.value = value
it.status = resourceResolution.status
+ ResourceAssignmentUtils.setResourceDataValue(it, raRuntimeService, value)
}
}
}