将FlowTrigger触发器整合成接口的形式方便替换

This commit is contained in:
fengjiayi
2024-12-23 23:19:10 +08:00
parent 0f9c9b9988
commit 5941f75313
29 changed files with 403 additions and 164 deletions

View File

@@ -31,15 +31,14 @@ namespace Net462DllTest.LogicControl
[NodeAction(NodeType.Flipflop, "等待视图命令")]
public async Task<IFlipflopContext<int>> WaitTask(CommandSignal command)
{
(var type, var result) = await ViewManagement.CreateTaskWithTimeoutAsync(command, TimeSpan.FromHours(10), 0);
if (type == TriggerType.Overtime)
var result = await ViewManagement.WaitTriggerWithTimeoutAsync<int>(command, TimeSpan.FromHours(10));
if (result.Type == TriggerDescription.Overtime)
{
return new FlipflopContext<int>(FlipflopStateType.Cancel, result);
return new FlipflopContext<int>(FlipflopStateType.Cancel, result.Value);
}
else
{
return new FlipflopContext<int>(FlipflopStateType.Succeed, result);
return new FlipflopContext<int>(FlipflopStateType.Succeed, result.Value);
}
}