private LinkInfo(NodeInfo nodeInfo, Slot slot, Node node) { Slot = slot; SlotInfo = SlotInfo.From(nodeInfo, slot); SlotInfo.PropertyChanged += SlotInfo_PropertyChanged; Node = node; NodeInfo = NodeInfo.From(nodeInfo.FlowInfo, node); NodeInfo.PropertyChanged += NodeInfo_PropertyChanged; }
private void Reset() { FlowInfo.Flow.Reset(); nodes.Clear(); nodes = FlowInfo.Flow.Origins .Select(n => NodeInfo.From(FlowInfo, n)) .ToList(); foreach (NodeInfo nodeInfo in nodes) { nodeInfo.Status = NodeStatus.Paused; } State = DebuggerState.Break; }
private async Task Evaluate(NodeInfo nodeInfo) { NodeStep nodeStep; nodeInfo.Status = NodeStatus.Running; try { Log.Trace(DebuggerCategory, "Entering node {0}", nodeInfo.Type.Name); nodeStep = nodeInfo.Node.Evaluate(); Log.Trace(DebuggerCategory, "Exiting node {0} with result {1}", nodeInfo.Type.Name, nodeStep.Result); } catch (Exception e) { Log.Error(DebuggerCategory, "Error while executing node {0}. {1}", nodeInfo.Type.Name, e.Message); nodeStep = new NodeStep(NodeResult.Fail, null); } if (State == DebuggerState.Idle) { return; } nodeInfo.Status = NodeStatus.Idle; nodeInfo.Result = nodeStep.Result; switch (nodeStep.Result) { case NodeResult.Skip: return; case NodeResult.Fail: Break(); return; case NodeResult.Stop: Stop(); return; } NodeInfo[] nodeInfos = nodeStep.Slot.Nodes.Select(n => NodeInfo.From(FlowInfo, n)).ToArray(); foreach (NodeInfo node in nodeInfos) { node.Status = NodeStatus.Paused; } lock (nodes) nodes.AddRange(nodeInfos); }
public void Stop() { if (State == DebuggerState.Idle) { return; } State = DebuggerState.Idle; nodes.Clear(); tasks.Clear(); foreach (NodeInfo nodeInfo in FlowInfo.Flow.GetAllNodes().Select(n => NodeInfo.From(FlowInfo, n))) { nodeInfo.Status = NodeStatus.Idle; } }