From b96b44d6d7ca11dbbc3ad4bd2194df31fba5efb6 Mon Sep 17 00:00:00 2001 From: Jozsef Csongvai Date: Wed, 9 Dec 2020 19:49:48 -0500 Subject: Refactoring to enable on_failure for imperative workflow BlueprintError needs to associate errors with the steps in which they occurred in order for imperative workflow to handle on_failure properly. Made stepName more accessible and corrected places where stepName was assigned to nodeTemplateName. Issue-ID: CCSDK-3219 Change-Id: I7e5805745c63558cff6be533e1b99c32ad06c3db Signed-off-by: Jozsef Csongvai --- .../functions/python/executor/ComponentJythonExecutor.kt | 3 +-- .../functions/python/executor/ComponentRemotePythonExecutor.kt | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'ms/blueprintsprocessor/functions/python-executor') diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentJythonExecutor.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentJythonExecutor.kt index 7911559ae..b32ccea13 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentJythonExecutor.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentJythonExecutor.kt @@ -56,8 +56,7 @@ open class ComponentJythonExecutor( } override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { - bluePrintRuntimeService.getBlueprintError() - .addError("Failed in ComponentJythonExecutor : ${runtimeException.message}") + addError("Failed in ComponentJythonExecutor : ${runtimeException.message}") } private suspend fun populateJythonComponentInstance() { diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt index a809d8f18..f059604ff 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt @@ -339,11 +339,11 @@ open class ComponentRemotePythonExecutor( } } - private fun noBlueprintErrors() = bluePrintRuntimeService.getBlueprintError().errors.isEmpty() + private fun noBlueprintErrors() = + bluePrintRuntimeService.getBlueprintError().stepErrors(stepName).isNullOrEmpty() override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { - bluePrintRuntimeService.getBlueprintError() - .addError("Failed in ComponentRemotePythonExecutor : ${runtimeException.message}") + addError("Failed in ComponentRemotePythonExecutor : ${runtimeException.message}") } private fun formatNestedJsonNode(node: JsonNode): String { -- cgit 1.2.3-korg