mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
1. 更新了节点入参的条件判断:入参类型为IFlowContext(流程上下文)时禁止创建参数来源连接。
2. [Script]脚本节点移除了“getFlowContext”内置方法,改为自动识别入参名称为“context""flowContext""flow_context",如果是,将自动使用 IFlowContext 类型参数(运行时自动给定) 3. NodeFlow项目中,FlowLibraryService添加了GetType(string)以及TryGetType(string,Type?)方法,用于流程环境搜索外部加载的程序集类型。
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Serein.Library;
|
||||
using Serein.Library.Api;
|
||||
using Serein.Library.Utils;
|
||||
using Serein.NodeFlow.Services;
|
||||
using Serein.Script;
|
||||
using Serein.Script.Node.FlowControl;
|
||||
using System;
|
||||
@@ -49,7 +50,6 @@ namespace Serein.NodeFlow.Model.Nodes
|
||||
public SingleScriptNode(IFlowEnvironment environment) : base(environment)
|
||||
{
|
||||
sereinScript = new SereinScript();
|
||||
|
||||
}
|
||||
|
||||
static SingleScriptNode()
|
||||
@@ -195,7 +195,11 @@ namespace Serein.NodeFlow.Model.Nodes
|
||||
ScriptArgInfo[] array = JsonHelper.Deserialize<ScriptArgInfo[]>(paramsTypeNameJson);
|
||||
|
||||
string returnTypeName = nodeInfo.CustomData?.ReturnTypeName ?? typeof(object);
|
||||
Type?[] argType = array.Select(item => string.IsNullOrWhiteSpace(item.ArgType) ? null : Type.GetType(item.ArgType) ?? typeof(Unit)).ToArray();
|
||||
|
||||
var flowLibService = Env.IOC.Get<FlowLibraryService>();
|
||||
|
||||
Type?[] argType = array.Select(item => string.IsNullOrWhiteSpace(item.ArgType) ? null : flowLibService.GetType(item.ArgType) ?? typeof(Unit)).ToArray();
|
||||
|
||||
Type? resType = Type.GetType(returnTypeName);
|
||||
for (int i = 0; i < paramCount; i++)
|
||||
{
|
||||
@@ -352,7 +356,7 @@ namespace Serein.NodeFlow.Model.Nodes
|
||||
|
||||
var @params = await flowCallNode.GetParametersAsync(context, token);
|
||||
|
||||
IScriptInvokeContext scriptContext = new ScriptInvokeContext(context);
|
||||
IScriptInvokeContext scriptContext = new ScriptInvokeContext();
|
||||
|
||||
if (@params[0] is object[] agrDatas)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user