From e96fa50ce96890932c2ed38c86ba0f42945c1623 Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh(bs2796)" Date: Mon, 19 Nov 2018 12:48:31 -0500 Subject: Implement Base Jython Executor function. Change-Id: I3fb066a021de4a7b3aa1fce7f6c191bc3944fb51 Issue-ID: CCSDK-696 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) --- .../execution/AbstractComponentFunction.kt | 34 ++++++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) (limited to 'ms/blueprintsprocessor/modules/services/execution-service/src') 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 9a0d1f91..801b6603 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 { 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 { -- cgit 1.2.3-korg