mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
重写了节点主动中断功能,修改了运行环境持久化注册已有实例的逻辑。
This commit is contained in:
@@ -27,7 +27,7 @@ namespace Serein.NodeFlow.Model
|
||||
if (DebugSetting.IsInterrupt) // 执行触发前
|
||||
{
|
||||
string guid = this.Guid.ToString();
|
||||
await this.DebugSetting.GetInterruptTask();
|
||||
await this.DebugSetting.GetInterruptTask.Invoke();
|
||||
await Console.Out.WriteLineAsync($"[{this.MethodDetails.MethodName}]中断已取消,开始执行后继分支");
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -141,12 +141,23 @@ namespace Serein.NodeFlow.Model
|
||||
public override async Task<object?> ExecutingAsync(IDynamicContext context)
|
||||
{
|
||||
var @params = await GetParametersAsync(context);
|
||||
ScriptFlowApi.Context= context;
|
||||
//dynamic obj = ((object[])@params[0])[0];
|
||||
//try
|
||||
//{
|
||||
// SereinEnv.WriteLine(InfoType.INFO, "Dynamic Object Value :" + obj.VarInfo);
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
// SereinEnv.WriteLine(ex);
|
||||
//}
|
||||
//ScriptFlowApi.Context = context; // 并发破坏了数据状态
|
||||
context.AddOrUpdate($"{context.Guid}_{this.Guid}_Params", @params[0]); // 后面再改
|
||||
|
||||
mainNode ??= new SereinScriptParser(Script).Parse();
|
||||
IScriptInvokeContext scriptContext = new ScriptInvokeContext();
|
||||
IScriptInvokeContext scriptContext = new ScriptInvokeContext(context);
|
||||
|
||||
var result = await ScriptInterpreter.InterpretAsync(scriptContext, mainNode); // 从入口节点执行
|
||||
//SereinEnv.WriteLine(InfoType.INFO, "FlowContext Guid : " + context.Guid);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user