MCPcopy Create free account
hub / github.com/astercloud/aster / executeWorkflow

Method executeWorkflow

pkg/workflow/engine.go:472–490  ·  view source on GitHub ↗

executeWorkflow 执行工作流

(execution *WorkflowExecution)

Source from the content-addressed store, hash-verified

470
471// executeWorkflow 执行工作流
472func (e *Engine) executeWorkflow(execution *WorkflowExecution) {
473 defer close(execution.done)
474
475 // 设置运行状态
476 execution.mu.Lock()
477 execution.Status = StatusRunning
478 execution.Context.Status = StatusRunning
479 execution.mu.Unlock()
480
481 // 查找开始节点
482 startNodes := e.findStartNodes(execution.Definition)
483 if len(startNodes) == 0 {
484 e.markExecutionFailed(execution, errors.New("no start node found"))
485 return
486 }
487
488 // 开始执行
489 e.executeNodes(execution, startNodes)
490}
491
492// executeNodes 执行节点
493func (e *Engine) executeNodes(execution *WorkflowExecution, nodeIDs []string) {

Callers 3

ExecuteMethod · 0.95
ExecuteAsyncMethod · 0.95
continueExecutionMethod · 0.95

Calls 3

findStartNodesMethod · 0.95
markExecutionFailedMethod · 0.95
executeNodesMethod · 0.95

Tested by

no test coverage detected