重新设计了@get 表达式,修改了 Workbench后台长时间运行时,重新切换到前台会产生参数连接线错误显示的问题

This commit is contained in:
fengjiayi
2024-12-18 00:05:42 +08:00
parent 587f7cffb2
commit 0471452ed9
16 changed files with 386 additions and 306 deletions

View File

@@ -387,6 +387,25 @@ namespace Serein.NodeFlow
}
await nextNodes[i].StartFlowAsync(context); // 启动执行触发器后继分支的节点
}
nextNodes = singleFlipFlopNode.SuccessorNodes[ConnectionInvokeType.Upstream];
for (int i = nextNodes.Count - 1; i >= 0 && !_flipFlopCts.IsCancellationRequested; i--)
{
// 筛选出启用的节点
if (!nextNodes[i].DebugSetting.IsEnable)
{
continue;
}
context.SetPreviousNode(nextNodes[i], singleFlipFlopNode);
if (nextNodes[i].DebugSetting.IsInterrupt) // 执行触发前
{
var cancelType = await nextNodes[i].DebugSetting.GetInterruptTask();
await Console.Out.WriteLineAsync($"[{nextNodes[i].MethodDetails.MethodName}]中断已{cancelType},开始执行后继分支");
}
await nextNodes[i].StartFlowAsync(context); // 启动执行触发器后继分支的节点
}
context.Exit();
});

View File

@@ -146,10 +146,11 @@ namespace Serein.NodeFlow.Model
}
}
bool judgmentResult = false;
try
{
var isPass = SereinConditionParser.To(parameter, Expression);
context.NextOrientation = isPass ? ConnectionInvokeType.IsSucceed : ConnectionInvokeType.IsFail;
judgmentResult = SereinConditionParser.To(parameter, Expression);
context.NextOrientation = judgmentResult ? ConnectionInvokeType.IsSucceed : ConnectionInvokeType.IsFail;
}
catch (Exception ex)
{
@@ -158,7 +159,8 @@ namespace Serein.NodeFlow.Model
}
SereinEnv.WriteLine(InfoType.INFO, $"{result} {Expression} -> " + context.NextOrientation);
return result;
//return result;
return judgmentResult;
}