mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-11 02:16:34 +08:00
修改了脚本执行的一些BUG。
This commit is contained in:
@@ -11,6 +11,11 @@ namespace Serein.Library.Api
|
||||
/// </summary>
|
||||
public interface IDynamicContext
|
||||
{
|
||||
/// <summary>
|
||||
/// 标识流程
|
||||
/// </summary>
|
||||
string Guid {get; }
|
||||
|
||||
/// <summary>
|
||||
/// 运行环境,包含IOC容器。
|
||||
/// </summary>
|
||||
|
||||
@@ -30,13 +30,13 @@ namespace Serein.Library.Api
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
/// <returns></returns>
|
||||
object GetDataOfParams(int index);
|
||||
object GetArgData(int index);
|
||||
/// <summary>
|
||||
/// 根据入参名称从入参数据获取数据
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
object GetDataOfParams(string name);
|
||||
// object GetDataOfParams(string name);
|
||||
/// <summary>
|
||||
/// 获取全局数据
|
||||
/// </summary>
|
||||
|
||||
@@ -393,7 +393,7 @@ namespace Serein.Library
|
||||
md.ActingInstance = context.Env.IOC.Get(md.ActingInstanceType);
|
||||
}
|
||||
|
||||
object[] args = await GetParametersAsync(context, this, md);
|
||||
object[] args = await GetParametersAsync(context, this);
|
||||
var result = await dd.InvokeAsync(md.ActingInstance, args);
|
||||
return result;
|
||||
|
||||
@@ -403,10 +403,10 @@ namespace Serein.Library
|
||||
/// 获取对应的参数数组
|
||||
/// </summary>
|
||||
public static async Task<object[]> GetParametersAsync(IDynamicContext context,
|
||||
NodeModelBase nodeModel,
|
||||
MethodDetails md)
|
||||
NodeModelBase nodeModel)
|
||||
{
|
||||
// 用正确的大小初始化参数数组
|
||||
var md = nodeModel.MethodDetails;
|
||||
if (md.ParameterDetailss.Length == 0)
|
||||
{
|
||||
return null;// md.ActingInstance
|
||||
@@ -670,8 +670,6 @@ namespace Serein.Library
|
||||
// parameters[i] = result;
|
||||
//}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -65,11 +65,18 @@ namespace Serein.Library.Utils
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static Type CreateTypeWithProperties(IDictionary<string, Type> properties, string typeName)
|
||||
/// <summary>
|
||||
/// 创建具有属性的类型
|
||||
/// </summary>
|
||||
/// <param name="properties">成员属性名称及类型</param>
|
||||
/// <param name="typeName">类型名称</param>
|
||||
/// <param name="isOverlay">是否覆盖</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public static Type CreateTypeWithProperties(IDictionary<string, Type> properties, string typeName, bool isOverlay = false)
|
||||
{
|
||||
// 如果类型已经缓存,直接返回缓存的类型
|
||||
if (typeCache.ContainsKey(typeName))
|
||||
// 如果类型已经缓存,且没有显示指定需要覆盖,直接返回缓存的类型
|
||||
if (typeCache.ContainsKey(typeName) && !isOverlay)
|
||||
{
|
||||
return typeCache[typeName];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user