将流程事件接口与流程运行环境解耦。

This commit is contained in:
fengjiayi
2025-06-02 19:17:30 +08:00
parent c7fbdc1cbb
commit 999060b67a
22 changed files with 734 additions and 483 deletions

View File

@@ -227,12 +227,12 @@ namespace Serein.NodeFlow.Model
};
var envEvent = (IFlowEnvironmentEvent)context.Env;
envEvent.OnFlowRunComplete += onFlowStop; // 防止运行后台流程
envEvent.FlowRunComplete += onFlowStop; // 防止运行后台流程
if (token.IsCancellationRequested) return null;
var result = await ScriptInterpreter.InterpretAsync(scriptContext, mainNode); // 从入口节点执行
envEvent.OnFlowRunComplete -= onFlowStop;
envEvent.FlowRunComplete -= onFlowStop;
return new FlowResult(this, context, result);
}