From aecf1a0e9e03ecf9ecf631d8c8a38539313be31a Mon Sep 17 00:00:00 2001 From: "Singal, Kapil (ks220y)" Date: Mon, 14 Oct 2019 16:37:45 -0400 Subject: Component Script Executor Fix Fixing ExecutionServiceInput object initialization and related test cases Issue-ID: CCSDK-1829 Signed-off-by: Singal, Kapil (ks220y) Change-Id: I43354487abfb10a98b29d749aa77b08cfdff51b8 --- .../capability_cli/Scripts/kotlin/cba/capability/cli/CapabilityCli.kt | 3 ++- .../services/execution/AbstractComponentFunction.kt | 4 ++-- .../services/execution/ComponentFunctionScriptingService.kt | 1 + .../services/execution/scripts/AbstractComponentFunctionTest.kt | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/cba/capability/cli/CapabilityCli.kt b/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/cba/capability/cli/CapabilityCli.kt index d29abb0d2..9552b6136 100644 --- a/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/cba/capability/cli/CapabilityCli.kt +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/cba/capability/cli/CapabilityCli.kt @@ -35,7 +35,8 @@ open class Check : AbstractScriptComponentFunction() { override suspend fun processNB(executionRequest: ExecutionServiceInput) { log.info("Executing process : ${executionRequest.payload}") - val data = executionRequest.payload.at("/check-request/data") + val data = requestPayloadActionProperty("data")?.first() + ?: throw BluePrintProcessorException("Failed to load payload data properties.") log.info("Data : ${data.asJsonString()}") diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt index 5163a93ac..bee919249 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt +++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt @@ -167,9 +167,9 @@ abstract class AbstractComponentFunction : BlueprintFunctionNode