Fix occurrence really optional 33/92533/4
authorEliezio Oliveira <eliezio.oliveira@est.tech>
Mon, 29 Jul 2019 14:46:42 +0000 (15:46 +0100)
committerDan Timoney <dtimoney@att.com>
Fri, 9 Aug 2019 19:45:34 +0000 (19:45 +0000)
Change-Id: I18c4d0803e20ed18e4dde553288d37143dff936a
Issue-ID: CCSDK-1572
Signed-off-by: Eliezio Oliveira <eliezio.oliveira@est.tech>
ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponent.kt

index 875b9ae..0521919 100644 (file)
@@ -53,7 +53,7 @@ open class ResourceResolutionComponent(private val resourceResolutionService: Re
 
     override suspend fun processNB(executionRequest: ExecutionServiceInput) {
 
-        val occurrence = getOperationInput(ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_OCCURRENCE).asInt()
+        val occurrence = getOptionalOperationInput(ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_OCCURRENCE)?.asInt() ?: 1
         val resolutionKey = getOptionalOperationInput(ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_KEY)?.returnNullIfMissing()?.textValue() ?: ""
         val storeResult = getOptionalOperationInput(ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_STORE_RESULT)?.asBoolean() ?: false
         val resourceId = getOptionalOperationInput(ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOURCE_ID)?.returnNullIfMissing()?.textValue() ?: ""