重新优化了NodeModel类;从硬编码类型改为“注册/获取”的方式,为下一步解耦Workbench与节点UI做准备。

新增了“全局数据节点”;保存项目文件时,不同节点可以使用自定义数据保存自身独特的数据,不再借用“方法参数”。
重新设计了运行时的环境输出;增量式生成器现在可以选择在属性变更的前后时间点插入自定义代码;重写了加载项目、保存项目的方法。
This commit is contained in:
fengjiayi
2024-12-12 20:31:50 +08:00
parent dbbaa10cc0
commit 49603bb58f
40 changed files with 999 additions and 681 deletions

View File

@@ -16,13 +16,6 @@ namespace Serein.NodeFlow.Model
}
/// <summary>
/// 加载完成后调用的方法
/// </summary>
public override void OnCreating()
{
}
/// <summary>
/// 执行触发器进行等待触发
@@ -60,59 +53,7 @@ namespace Serein.NodeFlow.Model
throw new FlipflopException(base.MethodDetails.MethodName + "触发器超时触发。Guid" + base.Guid);
}
return dynamicFlipflopContext.Value;
/*try
{
}
catch (FlipflopException ex)
{
if(ex.Type == FlipflopException.CancelClass.CancelFlow)
{
throw;
}
SereinEnv.WriteLine(InfoType.ERROR, $"触发器[{this.MethodDetails.MethodName}]异常:" + ex);
context.NextOrientation = ConnectionInvokeType.None;
context.ExceptionOfRuning = ex;
return null;
}
catch (Exception ex)
{
SereinEnv.WriteLine(InfoType.ERROR, $"触发器[{this.MethodDetails.MethodName}]异常:" + ex);
context.NextOrientation = ConnectionInvokeType.IsError;
context.ExceptionOfRuning = ex;
return null;
}
finally
{
// flipflopTask?.Dispose();
}*/
}
/// <summary>
/// 获取触发器参数
/// </summary>
/// <returns></returns>
public override ParameterData[] GetParameterdatas()
{
if (base.MethodDetails.ParameterDetailss.Length > 0)
{
return MethodDetails.ParameterDetailss
.Select(it => new ParameterData
{
SourceNodeGuid = it.ArgDataSourceNodeGuid,
SourceType = it.ArgDataSourceType.ToString(),
State = it.IsExplicitData,
Value = it.DataValue
})
.ToArray();
}
else
{
return [];
}
}
}
}