using System.Text.Json.Serialization; namespace Workflow.Domain.Engine; /// 条件/并行分支容器中的一条分支。 public sealed class TreeBranch { /// 分支 id,纯 Guid 字符串。 [JsonPropertyName("id")] public string Id { get; set; } = string.Empty; /// 分支显示名(如"条件 1"/"默认分支"/"分支 A")。 [JsonPropertyName("label")] public string? Label { get; set; } /// /// 条件表达式(仅 ConditionBranch 使用;复用 ConditionEvaluator 语法,如 金额 > 5000)。 /// 默认分支(else)置空,编译时 order 最大,引擎兜底命中。 /// [JsonPropertyName("condition")] public string? Condition { get; set; } /// 该分支内的首节点(分支内又是顺序链;null 表示空分支,编译时直通收口)。 [JsonPropertyName("child")] public TreeNode? Child { get; set; } }