mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
LocalFlowEnvironment文件丢失,需要重写
This commit is contained in:
46
NodeFlow/Model/Node/SingleUINode.cs
Normal file
46
NodeFlow/Model/Node/SingleUINode.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using Serein.Library;
|
||||
using Serein.Library.Api;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Serein.NodeFlow.Model.Node
|
||||
{
|
||||
public class SingleUINode : NodeModelBase
|
||||
{
|
||||
public IEmbeddedContent Adapter { get; private set; }
|
||||
public SingleUINode(IFlowEnvironment environment) : base(environment)
|
||||
{
|
||||
}
|
||||
|
||||
public override async Task<FlowResult> ExecutingAsync(IDynamicContext context, CancellationToken token)
|
||||
{
|
||||
if (token.IsCancellationRequested) return new FlowResult(this,context);
|
||||
if(Adapter is null)
|
||||
{
|
||||
|
||||
var result = await base.ExecutingAsync(context, token);
|
||||
if (result.Value is IEmbeddedContent adapter)
|
||||
{
|
||||
Adapter = adapter;
|
||||
context.NextOrientation = ConnectionInvokeType.IsSucceed;
|
||||
}
|
||||
else
|
||||
{
|
||||
context.NextOrientation = ConnectionInvokeType.IsError;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var p = context.GetPreviousNode(this);
|
||||
var data = context.GetFlowData(p).Value;
|
||||
var iflowContorl = Adapter.GetFlowControl();
|
||||
iflowContorl.OnExecuting(data);
|
||||
}
|
||||
|
||||
return new FlowResult(this, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user