2024-12-20 23:39:29 +08:00
|
|
|
|
using Serein.Library;
|
|
|
|
|
|
using Serein.Library.Api;
|
2024-12-21 20:47:31 +08:00
|
|
|
|
using Serein.Library.Utils;
|
2024-12-20 23:39:29 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Serein.NodeFlow
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 脚本代码中关于流程运行的API
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class ScriptFlowApi : IScriptFlowApi
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 流程环境
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public IFlowEnvironment Env { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 对应的节点
|
|
|
|
|
|
/// </summary>
|
2025-05-31 12:15:01 +08:00
|
|
|
|
public IFlowNode NodeModel { get; private set; }
|
2024-12-20 23:39:29 +08:00
|
|
|
|
|
2024-12-26 22:24:44 +08:00
|
|
|
|
|
2024-12-20 23:39:29 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 创建流程脚本接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="environment">运行环境</param>
|
|
|
|
|
|
/// <param name="nodeModel">节点</param>
|
2025-05-31 12:15:01 +08:00
|
|
|
|
public ScriptFlowApi(IFlowEnvironment environment, IFlowNode nodeModel)
|
2024-12-20 23:39:29 +08:00
|
|
|
|
{
|
|
|
|
|
|
Env = environment;
|
|
|
|
|
|
NodeModel = nodeModel;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-21 20:47:31 +08:00
|
|
|
|
public Task<object> CallNode(string nodeGuid)
|
2024-12-20 23:39:29 +08:00
|
|
|
|
{
|
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-07-30 21:15:07 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取全局数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="keyName"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2024-12-21 20:47:31 +08:00
|
|
|
|
public object? GetGlobalData(string keyName)
|
2024-12-20 23:39:29 +08:00
|
|
|
|
{
|
2024-12-21 20:47:31 +08:00
|
|
|
|
return SereinEnv.GetFlowGlobalData(keyName);
|
2024-12-20 23:39:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|