2026-07-24 12:53:36 +08:00

27 lines
1016 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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