将FlowTrigger触发器整合成接口的形式方便替换

This commit is contained in:
fengjiayi
2024-12-23 23:19:10 +08:00
parent 0f9c9b9988
commit 5941f75313
29 changed files with 403 additions and 164 deletions

View File

@@ -14,7 +14,14 @@ namespace Serein.NodeFlow.Model
}
/// <summary>
/// 执行方法
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override Task<object> ExecutingAsync(IDynamicContext context)
{
return base.ExecutingAsync(context);
}
}
}

View File

@@ -1,7 +1,6 @@
using Serein.Library.Api;
using Serein.Library;
using Serein.Library.Utils;
using Serein.NodeFlow.Env;
using static Serein.Library.Utils.ChannelFlowInterrupt;
namespace Serein.NodeFlow.Model
@@ -48,7 +47,9 @@ namespace Serein.NodeFlow.Model
dynamic dynamicFlipflopContext = await dd.InvokeAsync(md.ActingInstance, args);
FlipflopStateType flipflopStateType = dynamicFlipflopContext.State;
context.NextOrientation = flipflopStateType.ToContentType();
if (dynamicFlipflopContext.Type == TriggerType.Overtime)
if (dynamicFlipflopContext.Type == TriggerDescription.Overtime)
{
throw new FlipflopException(base.MethodDetails.MethodName + "触发器超时触发。Guid" + base.Guid);
}

View File

@@ -15,6 +15,7 @@ using System.Xml.Linq;
namespace Serein.NodeFlow.Model
{
[NodeProperty(ValuePath = NodeValuePath.Node)]
public partial class SingleScriptNode : NodeModelBase
{
@@ -58,7 +59,6 @@ namespace Serein.NodeFlow.Model
}
}
public override void OnCreating()
{
MethodInfo? method = this.GetType().GetMethod(nameof(GetFlowApi));