From 577316e6c8fbf21bb25f41174cd80f7bd8df327a Mon Sep 17 00:00:00 2001 From: Jozsef Csongvai Date: Tue, 12 Apr 2022 19:24:37 -0400 Subject: Return errormessages in failing imperative workflows Instead of discarding error messages after each node has executed, they are now kept until the workflow completes. If the workflow completes without exceptions, it means that all errors were handled and the error messages can be cleared. If the workflow does complete with exceptions, all error messages will be propagated in the response. Also update UatExecutor to enable expected status codes other than 200. Issue-ID: CCSDK-3630 Signed-off-by: Jozsef Csongvai Change-Id: I94fd81c342ad2a798e64051c603beb62bf1aaacd --- .../services/workflow/ImperativeWorkflowExecutionService.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ms/blueprintsprocessor/modules/services/workflow-service/src') diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionService.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionService.kt index b8350f4f1..fbe51acae 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionService.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionService.kt @@ -119,6 +119,7 @@ open class ImperativeBluePrintWorkflowService(private val nodeTemplateExecutionS } message = BluePrintConstants.STATUS_FAILURE } else { + bluePrintRuntimeService.getBluePrintError().clearAll() message = BluePrintConstants.STATUS_SUCCESS } eventType = EventType.EVENT_COMPONENT_EXECUTED.name @@ -163,8 +164,6 @@ open class ImperativeBluePrintWorkflowService(private val nodeTemplateExecutionS .executeNodeTemplate(bluePrintRuntimeService, node.id, nodeTemplateName, nodeInput) if (executionServiceOutput.status.message == BluePrintConstants.STATUS_FAILURE) { - // Clear step errors so that the workflow does not fail - bluePrintRuntimeService.getBluePrintError().stepErrors(node.id)?.clear() return EdgeLabel.FAILURE } -- cgit 1.2.3-korg