Files
MAF1/MAF1.Web/Web/WorkflowModels.cs
T

59 lines
1.7 KiB
C#
Raw Normal View History

using MAF1.Decisions;
2026-08-26 18:06:02 +08:00
namespace MAF1.Web;
public sealed class WorkflowGraph
{
public List<WorkflowNode> Nodes { get; set; } = [];
public List<WorkflowEdge> Edges { get; set; } = [];
}
public sealed class WorkflowNode
{
public string Id { get; set; } = "";
public string Type { get; set; } = "";
public string Title { get; set; } = "";
public double X { get; set; }
public double Y { get; set; }
public Dictionary<string, string> Config { get; set; } = new(StringComparer.OrdinalIgnoreCase);
}
public sealed class WorkflowEdge
{
public string Id { get; set; } = "";
public string From { get; set; } = "";
public string To { get; set; } = "";
public string FromPort { get; set; } = "";
public string ToPort { get; set; } = "";
public string? When { get; set; }
}
public static class WorkflowRunStatus
{
public const string Completed = "completed";
public const string NeedsDecision = "needsDecision";
public const string Failed = "failed";
}
2026-08-26 18:06:02 +08:00
public sealed class WorkflowRunResult
{
public bool Ok { get; set; }
public string Status { get; set; } = WorkflowRunStatus.Completed;
public string? RunId { get; set; }
2026-08-26 18:06:02 +08:00
public string? Error { get; set; }
public DecisionRequest? Decision { get; set; }
public DecisionAnswer? AppliedDecision { get; set; }
2026-08-26 18:06:02 +08:00
public List<NodeRunLog> Steps { get; set; } = [];
}
public sealed class NodeRunLog
{
public string NodeId { get; set; } = "";
public string Type { get; set; } = "";
public string Title { get; set; } = "";
public bool Skipped { get; set; }
public string? Message { get; set; }
public Dictionary<string, object?> Inputs { get; set; } = [];
public Dictionary<string, object?> Outputs { get; set; } = [];
}