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

Method executeNodes

pkg/workflow/engine.go:493–513  ·  view source on GitHub ↗

executeNodes 执行节点

(execution *WorkflowExecution, nodeIDs []string)

Source from the content-addressed store, hash-verified

491
492// executeNodes 执行节点
493func (e *Engine) executeNodes(execution *WorkflowExecution, nodeIDs []string) {
494 execution.mu.Lock()
495 execution.CurrentNodes = nodeIDs
496 execution.LastActivity = time.Now()
497 execution.mu.Unlock()
498
499 for _, nodeID := range nodeIDs {
500 if !e.executeNode(execution, nodeID) {
501 return // 节点执行失败
502 }
503 }
504
505 // 查找下一批节点
506 nextNodes := e.findNextNodes(execution, nodeIDs)
507 if len(nextNodes) > 0 {
508 e.executeNodes(execution, nextNodes)
509 } else {
510 // 没有更多节点,工作流完成
511 e.markExecutionCompleted(execution)
512 }
513}
514
515// executeNode 执行单个节点
516func (e *Engine) executeNode(execution *WorkflowExecution, nodeID string) bool {

Callers 1

executeWorkflowMethod · 0.95

Calls 3

executeNodeMethod · 0.95
findNextNodesMethod · 0.95

Tested by

no test coverage detected