diff options
author | Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com> | 2018-11-19 12:48:31 -0500 |
---|---|---|
committer | Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com> | 2018-11-28 19:46:23 -0500 |
commit | d2ec19b59ee0bdc1ba3a22baff5d0d30bd8a9e19 (patch) | |
tree | d0ddce3aee20da3f8ea6376b4201d13e5ed1cd83 /ms/blueprintsprocessor/modules/services/execution-service | |
parent | 3f83c10aa60ccecd020b06917de694ec11f544b0 (diff) |
Implement Base Jython Executor function.
Change-Id: I3fb066a021de4a7b3aa1fce7f6c191bc3944fb51
Issue-ID: CCSDK-696
Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Diffstat (limited to 'ms/blueprintsprocessor/modules/services/execution-service')
-rw-r--r-- | ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/execution/AbstractComponentFunction.kt | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/execution/AbstractComponentFunction.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/execution/AbstractComponentFunction.kt index 9a0d1f91c..801b66036 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/execution/AbstractComponentFunction.kt +++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/execution/AbstractComponentFunction.kt @@ -19,7 +19,10 @@ package org.onap.ccsdk.apps.blueprintsprocessor.services.execution import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceOutput
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.apps.controllerblueprints.core.getAsString
import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BlueprintFunctionNode
+import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRuntimeService
import org.slf4j.LoggerFactory
/**
@@ -29,14 +32,39 @@ import org.slf4j.LoggerFactory abstract class AbstractComponentFunction : BlueprintFunctionNode<ExecutionServiceInput, ExecutionServiceOutput> {
private val log = LoggerFactory.getLogger(AbstractComponentFunction::class.java)
- override fun prepareRequest(executionRequest: ExecutionServiceInput): ExecutionServiceInput {
+ var executionServiceInput: ExecutionServiceInput? = null
+ val executionServiceOutput = ExecutionServiceOutput()
+ var bluePrintRuntimeService: BluePrintRuntimeService<*>? = null
+ var processId: String = ""
+ var workflowName: String = ""
+ var stepName: String = ""
+ var interfaceName: String = ""
+ var operationName: String = ""
+ var nodeTemplateName: String = ""
+
+
+ override fun prepareRequest(executionServiceInput: ExecutionServiceInput): ExecutionServiceInput {
+
+ this.executionServiceInput = this.executionServiceInput
+
+ processId = executionServiceInput.commonHeader.requestId
+ workflowName = executionServiceInput.actionIdentifiers.actionName
+
+ val metadata = executionServiceInput.metadata
+ stepName = metadata.getAsString(BluePrintConstants.PROPERTY_CURRENT_STEP)
+ nodeTemplateName = metadata.getAsString(BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE)
+ interfaceName = metadata.getAsString(BluePrintConstants.PROPERTY_CURRENT_INTERFACE)
+ operationName = metadata.getAsString(BluePrintConstants.PROPERTY_CURRENT_OPERATION)
+
+ checkNotNull(bluePrintRuntimeService) { "failed to prepare blueprint runtime" }
+
log.info("prepareRequest...")
- return executionRequest
+ return executionServiceInput
}
override fun prepareResponse(): ExecutionServiceOutput {
log.info("Preparing Response...")
- return ExecutionServiceOutput()
+ return this.executionServiceOutput
}
override fun apply(executionServiceInput: ExecutionServiceInput): ExecutionServiceOutput {
|