From d2ec19b59ee0bdc1ba3a22baff5d0d30bd8a9e19 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) --- .../services/workflow/BlueprintSvcLogicService.kt | 10 ++-------- .../services/workflow/executor/ComponentExecuteNodeExecutor.kt | 2 ++ 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'ms/blueprintsprocessor/modules/services/workflow-service/src/main') diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/BlueprintSvcLogicService.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/BlueprintSvcLogicService.kt index 8750d98b3..0600f62d2 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/BlueprintSvcLogicService.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/BlueprintSvcLogicService.kt @@ -125,12 +125,6 @@ class DefaultBlueprintSvcLogicService : BlueprintSvcLogicService { override fun execute(graph: SvcLogicGraph, svcLogicContext: SvcLogicContext): SvcLogicContext { MDC.put("currentGraph", graph.toString()) - val ctx = svcLogicContext as BlueprintSvcLogicContext - - val blueprintRuntimeService = ctx.getBluePrintService() - - log.info("Blueprint Runtime Service : ${blueprintRuntimeService}") - var curNode: SvcLogicNode? = graph.getRootNode() log.info("About to execute graph {}", graph.toString()) @@ -138,7 +132,7 @@ class DefaultBlueprintSvcLogicService : BlueprintSvcLogicService { while (curNode != null) { MDC.put("nodeId", curNode.nodeId.toString() + " (" + curNode.nodeType + ")") log.info("About to execute node # {} ({})", curNode.nodeId, curNode.nodeType) - val nextNode = this.executeNode(curNode, ctx) + val nextNode = this.executeNode(curNode, svcLogicContext) curNode = nextNode } } catch (var5: ExitNodeException) { @@ -147,6 +141,6 @@ class DefaultBlueprintSvcLogicService : BlueprintSvcLogicService { MDC.remove("nodeId") MDC.remove("currentGraph") - return ctx + return svcLogicContext } } \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/executor/ComponentExecuteNodeExecutor.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/executor/ComponentExecuteNodeExecutor.kt index 125a1ff6f..ace9f2787 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/executor/ComponentExecuteNodeExecutor.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/executor/ComponentExecuteNodeExecutor.kt @@ -60,6 +60,8 @@ open class ComponentExecuteNodeExecutor : ExecuteNodeExecutor() { log.info("executing node template($nodeTemplateName) component($componentName)") // Get the Component Instance val plugin = this.getComponentFunction(componentName) + // Set the Blueprint Service + plugin.bluePrintRuntimeService = ctx.getBluePrintService() val executionInput = ctx.getRequest() as ExecutionServiceInput // Get the Request from the Context and Set to the Function Input and Invoke the function -- cgit 1.2.3-korg