mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-11 12:10:47 +08:00
移除了文件
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Serein.Library.Api;
|
||||
using Serein.Library.Utils.SereinExpression;
|
||||
using System.Reactive;
|
||||
using System.Reflection.Metadata;
|
||||
|
||||
namespace Serein.NodeFlow.Model
|
||||
{
|
||||
@@ -33,17 +34,52 @@ namespace Serein.NodeFlow.Model
|
||||
/// </summary>
|
||||
public override void OnLoading()
|
||||
{
|
||||
Console.WriteLine("SingleExpOpNode 暂未实现 OnLoading");
|
||||
var pd = new ParameterDetails
|
||||
{
|
||||
Index = 0,
|
||||
Name = "Exp",
|
||||
DataType = typeof(object),
|
||||
ExplicitType = typeof(object),
|
||||
IsExplicitData = false,
|
||||
DataValue = string.Empty,
|
||||
ArgDataSourceNodeGuid = string.Empty,
|
||||
ArgDataSourceType = ConnectionArgSourceType.GetPreviousNodeData,
|
||||
NodeModel = this,
|
||||
Convertor = null,
|
||||
ExplicitTypeName = "Value",
|
||||
Items = Array.Empty<string>(),
|
||||
};
|
||||
|
||||
this.MethodDetails.ParameterDetailss = new ParameterDetails[] { pd };
|
||||
}
|
||||
|
||||
|
||||
public override Task<object?> ExecutingAsync(IDynamicContext context)
|
||||
public override async Task<object?> ExecutingAsync(IDynamicContext context)
|
||||
{
|
||||
var data = context.TransmissionData(this); // 表达式节点使用上一节点数据
|
||||
object? parameter = null;// context.TransmissionData(this); // 表达式节点使用上一节点数据
|
||||
var pd = MethodDetails.ParameterDetailss[0];
|
||||
|
||||
if (pd.ArgDataSourceType == ConnectionArgSourceType.GetOtherNodeData)
|
||||
{
|
||||
// 使用自定义节点的参数
|
||||
parameter = context.GetFlowData(pd.ArgDataSourceNodeGuid);
|
||||
}
|
||||
else if (pd.ArgDataSourceType == ConnectionArgSourceType.GetOtherNodeDataOfInvoke)
|
||||
{
|
||||
// 立刻调用目标节点,然后使用其返回值
|
||||
parameter = await Env.InvokeNodeAsync(context, pd.ArgDataSourceNodeGuid);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 条件节点透传上一节点的数据
|
||||
parameter = context.TransmissionData(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
var newData = SerinExpressionEvaluator.Evaluate(Expression, data, out bool isChange);
|
||||
var newData = SerinExpressionEvaluator.Evaluate(Expression, parameter, out bool isChange);
|
||||
Console.WriteLine(newData);
|
||||
object? result = null;
|
||||
if (isChange)
|
||||
@@ -52,7 +88,7 @@ namespace Serein.NodeFlow.Model
|
||||
}
|
||||
else
|
||||
{
|
||||
result = data;
|
||||
result = parameter;
|
||||
}
|
||||
|
||||
context.NextOrientation = ConnectionInvokeType.IsSucceed;
|
||||
@@ -62,7 +98,7 @@ namespace Serein.NodeFlow.Model
|
||||
{
|
||||
context.NextOrientation = ConnectionInvokeType.IsError;
|
||||
RuningException = ex;
|
||||
return Task.FromResult(data);
|
||||
return parameter;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user