diff options
Diffstat (limited to 'ms/blueprintsprocessor/modules/services/execution-service')
4 files changed, 13 insertions, 8 deletions
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 c1a898582..f85b6424d 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 @@ -65,7 +65,7 @@ abstract class AbstractComponentFunction : BlueprintFunctionNode<ExecutionServic var operationInputs: MutableMap<String, JsonNode> = hashMapOf() override fun getName(): String { - return stepName + return "$stepName - $nodeTemplateName" } override suspend fun prepareRequestNB(executionRequest: ExecutionServiceInput): ExecutionServiceInput { @@ -143,8 +143,12 @@ abstract class AbstractComponentFunction : BlueprintFunctionNode<ExecutionServic properties = stepOutputs } executionServiceOutput.stepData = stepOutputData - // Set the Default Step Status + status.eventType = EventType.EVENT_COMPONENT_EXECUTED.name + + bluePrintRuntimeService.getBlueprintError().stepErrors(stepName)?.let { + status.message = BlueprintConstants.STATUS_FAILURE + } } catch (e: Exception) { status.message = BlueprintConstants.STATUS_FAILURE status.eventType = EventType.EVENT_COMPONENT_FAILURE.name @@ -192,11 +196,11 @@ abstract class AbstractComponentFunction : BlueprintFunctionNode<ExecutionServic } fun addError(type: String, name: String, error: String) { - bluePrintRuntimeService.getBlueprintError().addError(type, name, error) + bluePrintRuntimeService.getBlueprintError().addError(type, name, error, stepName) } fun addError(error: String) { - bluePrintRuntimeService.getBlueprintError().addError(error) + bluePrintRuntimeService.getBlueprintError().addError(error, stepName) } /** diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutor.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutor.kt index 815b190dd..5a552e32a 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutor.kt +++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutor.kt @@ -101,7 +101,6 @@ open class ComponentRemoteScriptExecutor( } override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { - bluePrintRuntimeService.getBlueprintError() - .addError("Failed in ComponentRemoteScriptExecutor : ${runtimeException.message}") + addError("Failed in ComponentRemoteScriptExecutor : ${runtimeException.message}") } } diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutor.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutor.kt index 213d21eae..d2c81a626 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutor.kt +++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutor.kt @@ -67,8 +67,7 @@ open class ComponentScriptExecutor(private var componentFunctionScriptingService } override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { - bluePrintRuntimeService.getBlueprintError() - .addError("Failed in ComponentScriptExecutor : ${runtimeException.message}") + addError("Failed in ComponentScriptExecutor : ${runtimeException.message}") } open fun populateScriptDependencies(scriptDependencies: MutableList<String>) { diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt index 8440e5faa..3438821c7 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt +++ b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt @@ -41,6 +41,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractCompone import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.nodeTypeComponentScriptExecutor import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintError import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType @@ -90,6 +91,8 @@ class AbstractComponentFunctionTest { any(), any(), any() ) } returns Implementation() + + every { bluePrintRuntimeService.getBlueprintError() } returns BlueprintError() } @Test |