diff options
author | 2019-11-22 18:06:08 -0500 | |
---|---|---|
committer | 2019-11-26 21:32:38 +0000 | |
commit | 341db21b2ac0a14a1ed2b8bf7930914dda054bfe (patch) | |
tree | 113bba965b06cfe3a8af3a0a527d1a41c9faf0f9 /ms/blueprintsprocessor/modules/services/workflow-service/src/main | |
parent | d274e5fc552cf9ae25500f504f0434981cf3accf (diff) |
Formatting Code base with ktlint
No Business logic change, just the code format.
Competible with IntelliJ: https://github.com/pinterest/ktlint#option-3
To format run: mvn process-sources -P format
Issue-ID: CCSDK-1947
Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Change-Id: Ic9e9209fb7023d77f434693ad5a01229f8d09331
Diffstat (limited to 'ms/blueprintsprocessor/modules/services/workflow-service/src/main')
10 files changed, 146 insertions, 93 deletions
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt index cde919ce8..492b0ba44 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt @@ -29,23 +29,25 @@ import org.springframework.stereotype.Service @Service("bluePrintWorkflowExecutionService") open class BluePrintWorkflowExecutionServiceImpl( - private val componentWorkflowExecutionService: ComponentWorkflowExecutionService, - private val dgWorkflowExecutionService: DGWorkflowExecutionService, - private val imperativeWorkflowExecutionService: ImperativeWorkflowExecutionService + private val componentWorkflowExecutionService: ComponentWorkflowExecutionService, + private val dgWorkflowExecutionService: DGWorkflowExecutionService, + private val imperativeWorkflowExecutionService: ImperativeWorkflowExecutionService ) : BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput> { private val log = LoggerFactory.getLogger(BluePrintWorkflowExecutionServiceImpl::class.java)!! - override suspend fun executeBluePrintWorkflow(bluePrintRuntimeService: BluePrintRuntimeService<*>, - executionServiceInput: ExecutionServiceInput, - properties: MutableMap<String, Any>): ExecutionServiceOutput { + override suspend fun executeBluePrintWorkflow( + bluePrintRuntimeService: BluePrintRuntimeService<*>, + executionServiceInput: ExecutionServiceInput, + properties: MutableMap<String, Any> + ): ExecutionServiceOutput { val bluePrintContext = bluePrintRuntimeService.bluePrintContext() val workflowName = executionServiceInput.actionIdentifiers.actionName // Assign Workflow inputs - //check if request structure exists + // check if request structure exists if (!executionServiceInput.payload.has("$workflowName-request")) { throw BluePrintProcessorException("Input request missing the expected '$workflowName-request' block!") } @@ -59,7 +61,7 @@ open class BluePrintWorkflowExecutionServiceImpl( /** If workflow has multiple steps, then it is imperative workflow */ val executionServiceOutput: ExecutionServiceOutput = if (steps.size > 1) { imperativeWorkflowExecutionService - .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, properties) + .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, properties) } else { // Get the DG Node Template val nodeTemplateName = bluePrintContext.workflowFirstStepNodeTemplate(workflowName) @@ -71,15 +73,17 @@ open class BluePrintWorkflowExecutionServiceImpl( when { derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_COMPONENT, true) -> { componentWorkflowExecutionService - .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, properties) + .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, properties) } derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW, true) -> { dgWorkflowExecutionService - .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, properties) + .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, properties) } else -> { - throw BluePrintProcessorException("couldn't execute workflow($workflowName) step mapped " + - "to node template($nodeTemplateName) derived from($derivedFrom)") + throw BluePrintProcessorException( + "couldn't execute workflow($workflowName) step mapped " + + "to node template($nodeTemplateName) derived from($derivedFrom)" + ) } } } @@ -93,5 +97,4 @@ open class BluePrintWorkflowExecutionServiceImpl( executionServiceOutput.payload.set("$workflowName-response", workflowOutputs.asObjectNode()) return executionServiceOutput } - } diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicContext.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicContext.kt index a2db8aab7..044e8cf53 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicContext.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicContext.kt @@ -48,5 +48,4 @@ class BlueprintSvcLogicContext : SvcLogicContext() { fun getResponse(): Any { return this.response!! } - -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicService.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicService.kt index df250ae98..9cc325d94 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicService.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BlueprintSvcLogicService.kt @@ -18,14 +18,25 @@ package org.onap.ccsdk.cds.blueprintsprocessor.services.workflow import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService -import org.onap.ccsdk.sli.core.sli.* -import org.onap.ccsdk.sli.core.sli.provider.base.* +import org.onap.ccsdk.sli.core.sli.ExitNodeException +import org.onap.ccsdk.sli.core.sli.SvcLogicContext +import org.onap.ccsdk.sli.core.sli.SvcLogicException +import org.onap.ccsdk.sli.core.sli.SvcLogicGraph +import org.onap.ccsdk.sli.core.sli.SvcLogicNode +import org.onap.ccsdk.sli.core.sli.SvcLogicStore +import org.onap.ccsdk.sli.core.sli.provider.base.AbstractSvcLogicNodeExecutor +import org.onap.ccsdk.sli.core.sli.provider.base.BlockNodeExecutor +import org.onap.ccsdk.sli.core.sli.provider.base.BreakNodeExecutor +import org.onap.ccsdk.sli.core.sli.provider.base.ExecuteNodeExecutor +import org.onap.ccsdk.sli.core.sli.provider.base.ExitNodeExecutor +import org.onap.ccsdk.sli.core.sli.provider.base.ReturnNodeExecutor +import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicServiceBase import org.slf4j.LoggerFactory import org.slf4j.MDC import org.springframework.beans.factory.annotation.Autowired import org.springframework.context.ApplicationContext import org.springframework.stereotype.Service -import java.util.* +import java.util.Properties import javax.annotation.PostConstruct interface BlueprintSvcLogicService : SvcLogicServiceBase { @@ -54,7 +65,6 @@ interface BlueprintSvcLogicService : SvcLogicServiceBase { } } - @Service class DefaultBlueprintSvcLogicService : BlueprintSvcLogicService { @@ -88,9 +98,12 @@ class DefaultBlueprintSvcLogicService : BlueprintSvcLogicService { } } - override suspend fun execute(graph: SvcLogicGraph, bluePrintRuntimeService: BluePrintRuntimeService<*>, - input: Any): Any { - //Initialise BlueprintSvcLogic Context with Blueprint Runtime Service and Input Request + override suspend fun execute( + graph: SvcLogicGraph, + bluePrintRuntimeService: BluePrintRuntimeService<*>, + input: Any + ): Any { + // Initialise BlueprintSvcLogic Context with Blueprint Runtime Service and Input Request val blueprintSvcLogicContext = BlueprintSvcLogicContext() blueprintSvcLogicContext.setBluePrintRuntimeService(bluePrintRuntimeService) blueprintSvcLogicContext.setRequest(input) @@ -140,4 +153,4 @@ class DefaultBlueprintSvcLogicService : BlueprintSvcLogicService { MDC.remove("currentGraph") return svcLogicContext } -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ComponentWorkflowExecutionService.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ComponentWorkflowExecutionService.kt index 3c474de37..70910e15c 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ComponentWorkflowExecutionService.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ComponentWorkflowExecutionService.kt @@ -16,7 +16,6 @@ package org.onap.ccsdk.cds.blueprintsprocessor.services.workflow - 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.controllerblueprints.core.interfaces.BluePrintWorkflowExecutionService @@ -24,12 +23,14 @@ import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeServ import org.springframework.stereotype.Service @Service("componentWorkflowExecutionService") -open class ComponentWorkflowExecutionService(private val nodeTemplateExecutionService: NodeTemplateExecutionService) - : BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput> { +open class ComponentWorkflowExecutionService(private val nodeTemplateExecutionService: NodeTemplateExecutionService) : + BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput> { - override suspend fun executeBluePrintWorkflow(bluePrintRuntimeService: BluePrintRuntimeService<*>, - executionServiceInput: ExecutionServiceInput, - properties: MutableMap<String, Any>): ExecutionServiceOutput { + override suspend fun executeBluePrintWorkflow( + bluePrintRuntimeService: BluePrintRuntimeService<*>, + executionServiceInput: ExecutionServiceInput, + properties: MutableMap<String, Any> + ): ExecutionServiceOutput { val bluePrintContext = bluePrintRuntimeService.bluePrintContext() @@ -38,8 +39,9 @@ open class ComponentWorkflowExecutionService(private val nodeTemplateExecutionSe // Get the DG Node Template val nodeTemplateName = bluePrintContext.workflowFirstStepNodeTemplate(workflowName) - return nodeTemplateExecutionService.executeNodeTemplate(bluePrintRuntimeService, - nodeTemplateName, executionServiceInput) + return nodeTemplateExecutionService.executeNodeTemplate( + bluePrintRuntimeService, + nodeTemplateName, executionServiceInput + ) } - -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionService.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionService.kt index 4485800ff..b1847df43 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionService.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionService.kt @@ -26,16 +26,17 @@ import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeServ import org.slf4j.LoggerFactory import org.springframework.stereotype.Service - @Service("dgWorkflowExecutionService") -open class DGWorkflowExecutionService(private val blueprintSvcLogicService: BlueprintSvcLogicService) - : BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput> { +open class DGWorkflowExecutionService(private val blueprintSvcLogicService: BlueprintSvcLogicService) : + BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput> { private val log = LoggerFactory.getLogger(DGWorkflowExecutionService::class.java) - override suspend fun executeBluePrintWorkflow(bluePrintRuntimeService: BluePrintRuntimeService<*>, - executionServiceInput: ExecutionServiceInput, - properties: MutableMap<String, Any>): ExecutionServiceOutput { + override suspend fun executeBluePrintWorkflow( + bluePrintRuntimeService: BluePrintRuntimeService<*>, + executionServiceInput: ExecutionServiceInput, + properties: MutableMap<String, Any> + ): ExecutionServiceOutput { val bluePrintContext = bluePrintRuntimeService.bluePrintContext() @@ -47,8 +48,10 @@ open class DGWorkflowExecutionService(private val blueprintSvcLogicService: Blue log.info("Executing workflow($workflowName) directed graph NodeTemplate($nodeTemplateName)") // Get the DG file info - val artifactDefinition = bluePrintContext.nodeTemplateArtifactForArtifactType(nodeTemplateName, - WorkflowServiceConstants.ARTIFACT_TYPE_DIRECTED_GRAPH) + val artifactDefinition = bluePrintContext.nodeTemplateArtifactForArtifactType( + nodeTemplateName, + WorkflowServiceConstants.ARTIFACT_TYPE_DIRECTED_GRAPH + ) // Populate the DG Path val dgFilePath = normalizedPathName(bluePrintContext.rootPath, artifactDefinition.file) @@ -59,10 +62,10 @@ open class DGWorkflowExecutionService(private val blueprintSvcLogicService: Blue val graph = SvcGraphUtils.getSvcGraphFromFile(dgFilePath) // Execute the DG - return blueprintSvcLogicService.execute(graph, + return blueprintSvcLogicService.execute( + graph, bluePrintRuntimeService, - executionServiceInput) as ExecutionServiceOutput - + executionServiceInput + ) as ExecutionServiceOutput } - -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionService.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionService.kt index d296ec6e6..ebd9d553d 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionService.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/ImperativeWorkflowExecutionService.kt @@ -21,23 +21,35 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInpu import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.Status import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType -import org.onap.ccsdk.cds.controllerblueprints.core.* +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.asGraph +import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty import org.onap.ccsdk.cds.controllerblueprints.core.data.EdgeLabel import org.onap.ccsdk.cds.controllerblueprints.core.data.Graph import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintWorkflowExecutionService -import org.onap.ccsdk.cds.controllerblueprints.core.service.* +import org.onap.ccsdk.cds.controllerblueprints.core.logger +import org.onap.ccsdk.cds.controllerblueprints.core.service.AbstractBluePrintWorkFlowService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintWorkFlowService +import org.onap.ccsdk.cds.controllerblueprints.core.service.NodeExecuteMessage +import org.onap.ccsdk.cds.controllerblueprints.core.service.NodeSkipMessage +import org.onap.ccsdk.cds.controllerblueprints.core.service.WorkflowExecuteMessage import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope import org.springframework.stereotype.Service @Service("imperativeWorkflowExecutionService") class ImperativeWorkflowExecutionService( - private val imperativeBluePrintWorkflowService: BluePrintWorkFlowService<ExecutionServiceInput, ExecutionServiceOutput>) - : BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput> { + private val imperativeBluePrintWorkflowService: BluePrintWorkFlowService<ExecutionServiceInput, ExecutionServiceOutput> +) : + BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput> { - override suspend fun executeBluePrintWorkflow(bluePrintRuntimeService: BluePrintRuntimeService<*>, - executionServiceInput: ExecutionServiceInput, - properties: MutableMap<String, Any>): ExecutionServiceOutput { + override suspend fun executeBluePrintWorkflow( + bluePrintRuntimeService: BluePrintRuntimeService<*>, + executionServiceInput: ExecutionServiceInput, + properties: MutableMap<String, Any> + ): ExecutionServiceOutput { val bluePrintContext = bluePrintRuntimeService.bluePrintContext() @@ -45,23 +57,29 @@ class ImperativeWorkflowExecutionService( val graph = bluePrintContext.workflowByName(workflowName).asGraph() - return imperativeBluePrintWorkflowService.executeWorkflow(graph, bluePrintRuntimeService, - executionServiceInput) + return imperativeBluePrintWorkflowService.executeWorkflow( + graph, bluePrintRuntimeService, + executionServiceInput + ) } } @Service @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) -open class ImperativeBluePrintWorkflowService(private val nodeTemplateExecutionService: NodeTemplateExecutionService) - : AbstractBluePrintWorkFlowService<ExecutionServiceInput, ExecutionServiceOutput>() { +open class ImperativeBluePrintWorkflowService(private val nodeTemplateExecutionService: NodeTemplateExecutionService) : + AbstractBluePrintWorkFlowService<ExecutionServiceInput, ExecutionServiceOutput>() { + val log = logger(ImperativeBluePrintWorkflowService::class) lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*> lateinit var executionServiceInput: ExecutionServiceInput lateinit var workflowName: String - override suspend fun executeWorkflow(graph: Graph, bluePrintRuntimeService: BluePrintRuntimeService<*>, - input: ExecutionServiceInput): ExecutionServiceOutput { + override suspend fun executeWorkflow( + graph: Graph, + bluePrintRuntimeService: BluePrintRuntimeService<*>, + input: ExecutionServiceInput + ): ExecutionServiceOutput { this.graph = graph this.bluePrintRuntimeService = bluePrintRuntimeService this.executionServiceInput = input @@ -103,8 +121,8 @@ open class ImperativeBluePrintWorkflowService(private val nodeTemplateExecutionS } } - override suspend fun prepareNodeExecutionMessage(node: Graph.Node) - : NodeExecuteMessage<ExecutionServiceInput, ExecutionServiceOutput> { + override suspend fun prepareNodeExecutionMessage(node: Graph.Node): + NodeExecuteMessage<ExecutionServiceInput, ExecutionServiceOutput> { val nodeOutput = ExecutionServiceOutput().apply { commonHeader = executionServiceInput.commonHeader actionIdentifiers = executionServiceInput.actionIdentifiers @@ -112,8 +130,8 @@ open class ImperativeBluePrintWorkflowService(private val nodeTemplateExecutionS return NodeExecuteMessage(node, executionServiceInput, nodeOutput) } - override suspend fun prepareNodeSkipMessage(node: Graph.Node) - : NodeSkipMessage<ExecutionServiceInput, ExecutionServiceOutput> { + override suspend fun prepareNodeSkipMessage(node: Graph.Node): + NodeSkipMessage<ExecutionServiceInput, ExecutionServiceOutput> { val nodeOutput = ExecutionServiceOutput().apply { commonHeader = executionServiceInput.commonHeader actionIdentifiers = executionServiceInput.actionIdentifiers @@ -121,15 +139,18 @@ open class ImperativeBluePrintWorkflowService(private val nodeTemplateExecutionS return NodeSkipMessage(node, executionServiceInput, nodeOutput) } - override suspend fun executeNode(node: Graph.Node, nodeInput: ExecutionServiceInput, - nodeOutput: ExecutionServiceOutput): EdgeLabel { + override suspend fun executeNode( + node: Graph.Node, + nodeInput: ExecutionServiceInput, + nodeOutput: ExecutionServiceOutput + ): EdgeLabel { log.info("Executing workflow($workflowName[${this.workflowId}])'s step($${node.id})") val step = bluePrintRuntimeService.bluePrintContext().workflowStepByName(this.workflowName, node.id) checkNotEmpty(step.target) { "couldn't get step target for workflow(${this.workflowName})'s step(${node.id})" } val nodeTemplateName = step.target!! /** execute node template */ val executionServiceOutput = nodeTemplateExecutionService - .executeNodeTemplate(bluePrintRuntimeService, nodeTemplateName, nodeInput) + .executeNodeTemplate(bluePrintRuntimeService, nodeTemplateName, nodeInput) return when (executionServiceOutput.status.message) { BluePrintConstants.STATUS_FAILURE -> EdgeLabel.FAILURE @@ -137,18 +158,27 @@ open class ImperativeBluePrintWorkflowService(private val nodeTemplateExecutionS } } - override suspend fun skipNode(node: Graph.Node, nodeInput: ExecutionServiceInput, - nodeOutput: ExecutionServiceOutput): EdgeLabel { + override suspend fun skipNode( + node: Graph.Node, + nodeInput: ExecutionServiceInput, + nodeOutput: ExecutionServiceOutput + ): EdgeLabel { return EdgeLabel.SUCCESS } - override suspend fun cancelNode(node: Graph.Node, nodeInput: ExecutionServiceInput, - nodeOutput: ExecutionServiceOutput): EdgeLabel { + override suspend fun cancelNode( + node: Graph.Node, + nodeInput: ExecutionServiceInput, + nodeOutput: ExecutionServiceOutput + ): EdgeLabel { TODO("not implemented") } - override suspend fun restartNode(node: Graph.Node, nodeInput: ExecutionServiceInput, - nodeOutput: ExecutionServiceOutput): EdgeLabel { + override suspend fun restartNode( + node: Graph.Node, + nodeInput: ExecutionServiceInput, + nodeOutput: ExecutionServiceOutput + ): EdgeLabel { TODO("not implemented") } -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionService.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionService.kt index b64177aab..615a31c77 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionService.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/NodeTemplateExecutionService.kt @@ -33,8 +33,11 @@ open class NodeTemplateExecutionService { private val log = LoggerFactory.getLogger(NodeTemplateExecutionService::class.java)!! - suspend fun executeNodeTemplate(bluePrintRuntimeService: BluePrintRuntimeService<*>, nodeTemplateName: String, - executionServiceInput: ExecutionServiceInput): ExecutionServiceOutput { + suspend fun executeNodeTemplate( + bluePrintRuntimeService: BluePrintRuntimeService<*>, + nodeTemplateName: String, + executionServiceInput: ExecutionServiceInput + ): ExecutionServiceOutput { // Get the Blueprint Context val blueprintContext = bluePrintRuntimeService.bluePrintContext() @@ -47,12 +50,14 @@ open class NodeTemplateExecutionService { val operationName = blueprintContext.nodeTemplateFirstInterfaceFirstOperationName(nodeTemplateName) val nodeTemplateImplementation = blueprintContext - .nodeTemplateOperationImplementation(nodeTemplateName, interfaceName, operationName) + .nodeTemplateOperationImplementation(nodeTemplateName, interfaceName, operationName) val timeout: Int = nodeTemplateImplementation?.timeout ?: 180 - log.info("executing node template($nodeTemplateName) component($componentName) " + - "interface($interfaceName) operation($operationName) with timeout($timeout) sec.") + log.info( + "executing node template($nodeTemplateName) component($componentName) " + + "interface($interfaceName) operation($operationName) with timeout($timeout) sec." + ) // Get the Component Instance val plugin = BluePrintDependencyService.instance<AbstractComponentFunction>(componentName) @@ -82,5 +87,4 @@ open class NodeTemplateExecutionService { // Get the Request from the Context and Set to the Function Input and Invoke the function return plugin.applyNB(clonedExecutionServiceInput) } - -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/WorkflowServiceConfiguration.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/WorkflowServiceConfiguration.kt index 67f13f760..c1bcc649f 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/WorkflowServiceConfiguration.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/WorkflowServiceConfiguration.kt @@ -23,9 +23,8 @@ import org.springframework.context.annotation.Configuration @ComponentScan open class WorkflowServiceConfiguration - class WorkflowServiceConstants { companion object { const val ARTIFACT_TYPE_DIRECTED_GRAPH = "artifact-directed-graph" } -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/executor/ComponentExecuteNodeExecutor.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/executor/ComponentExecuteNodeExecutor.kt index b6e767503..8c4e2d215 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/executor/ComponentExecuteNodeExecutor.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/executor/ComponentExecuteNodeExecutor.kt @@ -31,14 +31,14 @@ import org.slf4j.LoggerFactory import org.springframework.stereotype.Service @Service -open class ComponentExecuteNodeExecutor(private val nodeTemplateExecutionService: NodeTemplateExecutionService) - : ExecuteNodeExecutor() { +open class ComponentExecuteNodeExecutor(private val nodeTemplateExecutionService: NodeTemplateExecutionService) : + ExecuteNodeExecutor() { private val log = LoggerFactory.getLogger(ComponentExecuteNodeExecutor::class.java) @Throws(SvcLogicException::class) - override fun execute(svc: SvcLogicServiceBase, node: SvcLogicNode, svcLogicContext: SvcLogicContext) - : SvcLogicNode = runBlocking { + override fun execute(svc: SvcLogicServiceBase, node: SvcLogicNode, svcLogicContext: SvcLogicContext): + SvcLogicNode = runBlocking { var outValue: String @@ -48,15 +48,16 @@ open class ComponentExecuteNodeExecutor(private val nodeTemplateExecutionService val executionInput = ctx.getRequest() as ExecutionServiceInput - try { // Get the Request from the Context and Set to the Function Input and Invoke the function - val executionOutput = nodeTemplateExecutionService.executeNodeTemplate(ctx.getBluePrintService(), - nodeTemplateName, executionInput) + try { // Get the Request from the Context and Set to the Function Input and Invoke the function + val executionOutput = nodeTemplateExecutionService.executeNodeTemplate( + ctx.getBluePrintService(), + nodeTemplateName, executionInput + ) ctx.setResponse(executionOutput) outValue = executionOutput.status.message ctx.status = executionOutput.status.message - } catch (e: Exception) { log.error("Could not execute plugin($nodeTemplateName) : ", e) outValue = "failure" @@ -65,5 +66,4 @@ open class ComponentExecuteNodeExecutor(private val nodeTemplateExecutionService getNextNode(node, outValue) } - -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/utils/SvcGraphUtils.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/utils/SvcGraphUtils.kt index 8f9579230..86934f29a 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/utils/SvcGraphUtils.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/utils/SvcGraphUtils.kt @@ -32,4 +32,4 @@ object SvcGraphUtils { val svcLogicParser = SvcLogicParser() return svcLogicParser.parse(fileName).first } -}
\ No newline at end of file +} |