summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules
diff options
context:
space:
mode:
authorKAPIL SINGAL <ks220y@att.com>2022-04-13 12:47:30 +0000
committerGerrit Code Review <gerrit@onap.org>2022-04-13 12:47:30 +0000
commit221223e7d0689e5d43d72acba112f95589b51892 (patch)
tree47cf2c4f7d8d6ad29e45c676be36a37df64fe5fb /ms/blueprintsprocessor/modules
parentf5329877c16a910338274240d8e5e80ad7a28573 (diff)
parent577316e6c8fbf21bb25f41174cd80f7bd8df327a (diff)
Merge "Return errormessages in failing imperative workflows"
Diffstat (limited to 'ms/blueprintsprocessor/modules')
-rw-r--r--ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintError.kt2
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionService.kt3
2 files changed, 3 insertions, 2 deletions
diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintError.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintError.kt
index 1ac49d6fe..18dcd16f7 100644
--- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintError.kt
+++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintError.kt
@@ -35,4 +35,6 @@ class BluePrintError {
fun allErrors(): List<String> = errors.values.flatten()
fun stepErrors(stepName: String): MutableList<String>? = errors[stepName]
+
+ fun clearAll() = errors.clear();
}
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
}