summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/services/workflow-service
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh <brindasanth@in.ibm.com>2019-03-27 13:22:51 -0400
committerMuthuramalingam, Brinda Santh <brindasanth@in.ibm.com>2019-04-01 10:43:53 -0400
commit40072d3dcc1d0193bba1ea9432c13ac24857be55 (patch)
tree2fe78015e772c4cbab4fd52184530b9e52c8c3af /ms/blueprintsprocessor/modules/services/workflow-service
parent38300292cbce3bb0500593f3cc44fe129cf5c877 (diff)
Improve function interfaces
Change-Id: I24f45d39ac05491a4217101e00bcbf8d122e4e1a Issue-ID: CCSDK-1137 Signed-off-by: Muthuramalingam, Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/blueprintsprocessor/modules/services/workflow-service')
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionService.kt6
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/mock/MockComponentFunction.kt13
2 files changed, 8 insertions, 11 deletions
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionService.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionService.kt
index 67be26e6d..8f47a0460 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionService.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionService.kt
@@ -17,8 +17,6 @@
package org.onap.ccsdk.cds.blueprintsprocessor.services.workflow
import com.fasterxml.jackson.databind.JsonNode
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.withContext
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction
@@ -64,9 +62,7 @@ open class NodeTemplateExecutionService(private val applicationContext: Applicat
plugin.bluePrintRuntimeService.put("$nodeTemplateName-step-inputs", stepInputs.asJsonNode())
// Get the Request from the Context and Set to the Function Input and Invoke the function
- return withContext(Dispatchers.Default) {
- plugin.apply(executionServiceInput)
- }
+ return plugin.apply(executionServiceInput)
}
} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/mock/MockComponentFunction.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/mock/MockComponentFunction.kt
index 1cae01ffa..5dc5b9dba 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/mock/MockComponentFunction.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/mock/MockComponentFunction.kt
@@ -1,5 +1,6 @@
/*
* Copyright © 2017-2018 AT&T Intellectual Property.
+ * Modifications Copyright © 2019 IBM.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,14 +40,14 @@ class MockComponentFunction : AbstractComponentFunction() {
private val log = LoggerFactory.getLogger(MockComponentFunction::class.java)
- override fun process(executionRequest: ExecutionServiceInput) {
+ override suspend fun processNB(executionRequest: ExecutionServiceInput) {
log.info("Processing component : $operationInputs")
bluePrintRuntimeService.setNodeTemplateAttributeValue(nodeTemplateName,
"assignment-params", "params".asJsonPrimitive())
}
- override fun recover(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
+ override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
log.info("Recovering component..")
}
}
@@ -57,11 +58,11 @@ class SingletonComponentFunction : AbstractComponentFunction() {
private val log = LoggerFactory.getLogger(MockComponentFunction::class.java)
- override fun process(executionRequest: ExecutionServiceInput) {
+ override suspend fun processNB(executionRequest: ExecutionServiceInput) {
log.info("Processing component : $operationInputs")
}
- override fun recover(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
+ override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
log.info("Recovering component..")
}
}
@@ -72,11 +73,11 @@ class PrototypeComponentFunction : AbstractComponentFunction() {
private val log = LoggerFactory.getLogger(MockComponentFunction::class.java)
- override fun process(executionRequest: ExecutionServiceInput) {
+ override suspend fun processNB(executionRequest: ExecutionServiceInput) {
log.info("Processing component : $operationInputs")
}
- override fun recover(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
+ override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
log.info("Recovering component..")
}
} \ No newline at end of file