mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-15 22:16:34 +08:00
1. 重新设计了Generate项目及相关特性的命名,避免与其他类型混淆。
2. 补充了部分注释。 3. 修改了删除容器节点时,容器内子节点未正确删除的问题。
This commit is contained in:
@@ -11,10 +11,23 @@ namespace Serein.Library
|
||||
[DynamicFlow(Name ="[基础功能]")]
|
||||
public static class FlowBaseLibrary
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 对象透传,直接返回入参的值
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
[NodeAction(NodeType.Action, "对象透传")]
|
||||
public static object TransmissionObject(object value) => value;
|
||||
|
||||
/// <summary>
|
||||
/// 键值对组装,将入参的值与名称组装成一个字典对象
|
||||
/// </summary>
|
||||
/// <param name="argNames"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
|
||||
[NodeAction(NodeType.Action, "键值对组装")]
|
||||
public static Dictionary<string, object> DictSet(string argNames, params object[] value)
|
||||
{
|
||||
@@ -32,12 +45,22 @@ namespace Serein.Library
|
||||
return dict;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数组组装,将入参的值组装成一个数组对象
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
[NodeAction(NodeType.Action, "数组组装")]
|
||||
public static object[] ArraySet(params object[] value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 输出到控制台,使用SereinEnv.WriteLine方法输出信息
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
[NodeAction(NodeType.Action, "输出")]
|
||||
public static object[] Console(params object[] value)
|
||||
{
|
||||
@@ -48,7 +71,14 @@ namespace Serein.Library
|
||||
return value;
|
||||
}
|
||||
|
||||
[NodeAction(NodeType.Action, "逻辑分支")]
|
||||
/// <summary>
|
||||
/// 逻辑分支,根据布尔值选择返回的值,如果布尔值为true则返回t_value,否则返回f_value
|
||||
/// </summary>
|
||||
/// <param name="bool"></param>
|
||||
/// <param name="t_value"></param>
|
||||
/// <param name="f_value"></param>
|
||||
/// <returns></returns>
|
||||
[NodeAction(NodeType.Action, "逻辑选择")]
|
||||
public static object LogicalBranch([NodeParam(IsExplicit = false)]bool @bool,
|
||||
object t_value,
|
||||
object f_value)
|
||||
@@ -56,6 +86,12 @@ namespace Serein.Library
|
||||
return @bool ? t_value : f_value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 文本拼接,将多个文本值拼接成一个字符串,支持换行符和制表符的特殊处理
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
[NodeAction(NodeType.Action, "文本拼接")]
|
||||
public static string TextJoin(params object[] value)
|
||||
{
|
||||
@@ -79,6 +115,13 @@ namespace Serein.Library
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 动态构建对象,将字典中的键值对转换为一个动态对象,支持指定类名和打印结果
|
||||
/// </summary>
|
||||
/// <param name="dict"></param>
|
||||
/// <param name="classTypeName"></param>
|
||||
/// <param name="IsPrint"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
[NodeAction(NodeType.Action, "键值对动态构建对象")]
|
||||
public static object CreateDynamicObjectOfDict(Dictionary<string, object> dict,
|
||||
@@ -100,13 +143,5 @@ namespace Serein.Library
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
[NodeAction(NodeType.Action, "设置或更新全局数据")]
|
||||
public static object AddOrUpdateFlowGlobalData(string name, object data)
|
||||
{
|
||||
SereinEnv.AddOrUpdateFlowGlobalData(name, data);
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user