取消使用流程上下文自定义的字典数据;更改流程环境接口的输出方式

This commit is contained in:
fengjiayi
2024-11-08 17:30:51 +08:00
parent dff9a00fb6
commit 8c54b9a014
41 changed files with 448 additions and 505 deletions

View File

@@ -33,7 +33,8 @@ namespace Serein.Library.Core
/// <summary>
/// 用来在当前流程上下文间传递数据
/// </summary>
public Dictionary<string, object> ContextShareData { get; } = new Dictionary<string, object>();
//public Dictionary<string, object> ContextShareData { get; } = new Dictionary<string, object>();
public object Tag { get; set; }
/// <summary>
/// 当前节点执行完成后,设置该属性,让运行环境判断接下来要执行哪个分支的节点。
@@ -82,7 +83,6 @@ namespace Serein.Library.Core
}
}
/// <summary>
/// 获取节点当前数据
/// </summary>
@@ -128,7 +128,6 @@ namespace Serein.Library.Core
return null;
}
/// <summary>
/// 结束流程
/// </summary>
@@ -148,26 +147,15 @@ namespace Serein.Library.Core
}
}
foreach (var nodeObj in ContextShareData.Values)
if (Tag != null && typeof(IDisposable).IsAssignableFrom(Tag?.GetType()) && Tag is IDisposable tagDisposable)
{
if (nodeObj is null)
{
continue;
}
else
{
if (typeof(IDisposable).IsAssignableFrom(nodeObj?.GetType()) && nodeObj is IDisposable disposable)
{
disposable?.Dispose();
}
}
tagDisposable?.Dispose();
}
this.Tag = null;
this.dictNodeFlowData?.Clear();
this.ContextShareData?.Clear();
RunState = RunState.Completion;
}
private void Dispose(ref IDictionary<string, object> keyValuePairs)
{
foreach (var nodeObj in keyValuePairs.Values)