summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src
diff options
context:
space:
mode:
authorAlexis de Talhouët <adetalhouet89@gmail.com>2019-09-10 15:41:13 -0400
committerOleg Mitsura <omitsura@gmail.com>2019-11-01 15:23:56 +0000
commit7ef88712a8535c44e844b6a064ff7aaf7ceb9bc8 (patch)
tree77ead253d4d14f0d7eb136ad1258834f3fc7fceb /ms/blueprintsprocessor/functions/resource-resolution/src
parent083247bd4410f2737ceb4aecb007fa660b560792 (diff)
Provide ongoing occurrence value for scripting
This patch fixes this for template https://gerrit.onap.org/r/#/c/ccsdk/cds/+/95081/ but not for script, where the occurrence value might be needed. In reality, this overall occurrence thing is a mistacke, but it's solving an issue that I yet don't know how to properly solve. Change-Id: I7f8579ad2bde3f96b06aaf09c8b8c67d4b97e7b0 Issue-ID: CCSDK-1693 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com> Signed-off-by: Shaaban Ebrahim <shaaban.eltanany.ext@orange.com> (cherry picked from commit d39772eaeb2c6e6665c4a6d41f6af84f63151184)
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt6
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt1
2 files changed, 7 insertions, 0 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 8651e2620..7e4d8efcf 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
@@ -199,6 +199,7 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica
blueprintRuntimeService
}
+ exposeOccurrencePropertyInResourceAssignments(resourceAssignmentRuntimeService, properties)
coroutineScope {
bulkSequenced.forEach { batchResourceAssignments ->
@@ -353,4 +354,9 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica
&& resourceResolution.dictionaryVersion == resourceAssignment.version)
}
+ private fun exposeOccurrencePropertyInResourceAssignments(raRuntimeService: ResourceAssignmentRuntimeService,
+ properties: Map<String, Any>) {
+ raRuntimeService.putResolutionStore(ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_OCCURRENCE,
+ properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_OCCURRENCE].asJsonPrimitive())
+ }
}
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt
index 775c501c2..5a5336ae3 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt
@@ -261,6 +261,7 @@ class ResourceResolutionServiceTest {
every { raRuntimeService.getBluePrintError() } returns BluePrintError()
every { raRuntimeService.setBluePrintError(any())} returns Unit
every { raRuntimeService.getInputValue("device-id") } returns "123456".asJsonPrimitive()
+ every { raRuntimeService.putResolutionStore(any(), any()) } returns Unit
val applicationContext = mockk<ApplicationContext>()
every { applicationContext.getBean("rr-processor-source-capability") } returns MockCapabilityScriptRA()