Class AddSignOperation
java.lang.Object
cloud.opencode.base.flow.operation.AddSignOperation
Add-sign action — appends additional approvers to the current step
(v4 §8.5). Depth is tracked via CAS on
flow_instance.addsign_depth (D21).
后加签操作 —— 通过对 flow_instance.addsign_depth 做 CAS 限制链深度。- Since:
- JDK 25, opencode-base-flow V1.0.5
- Author:
- Leon Soo
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault max addsign chain depth (v4 §8.5).static final intHard ceiling on a single addSign call's recipient list.static final StringSystem property key for max addsign depth. -
Constructor Summary
ConstructorsConstructorDescriptionAddSignOperation(FlowRepository repo, HistoryWriter history, TransitionResolver router, StepEntry stepEntry) Construct an add-sign operation with the default max-depth read once from system properties (v4 D22 — frozen at construction).AddSignOperation(FlowRepository repo, HistoryWriter history, TransitionResolver router, StepEntry stepEntry, int maxDepth) Test-only constructor with explicit max-depth. -
Method Summary
-
Field Details
-
PROP_ADDSIGN_MAX_DEPTH
System property key for max addsign depth.- See Also:
-
DEFAULT_MAX_DEPTH
public static final int DEFAULT_MAX_DEPTHDefault max addsign chain depth (v4 §8.5).- See Also:
-
MAX_USERS_PER_CALL
public static final int MAX_USERS_PER_CALLHard ceiling on a single addSign call's recipient list. Prevents memory / metric / history blowup from a single malicious call that asks to spawn millions of tasks. 单次加签 userId 列表上限;防止单次调用扇出到千万级任务。- See Also:
-
-
Constructor Details
-
AddSignOperation
public AddSignOperation(FlowRepository repo, HistoryWriter history, TransitionResolver router, StepEntry stepEntry) Construct an add-sign operation with the default max-depth read once from system properties (v4 D22 — frozen at construction). 构造加签操作;构造时一次性读取PROP_ADDSIGN_MAX_DEPTH并固化。- Parameters:
repo- persistence facade — 持久化门面history- history writer — 历史追加器router- transition resolver — 流转解析器stepEntry- step entry helper — 节点进入工具- Since:
- JDK 25, opencode-base-flow V1.0.5
-
AddSignOperation
public AddSignOperation(FlowRepository repo, HistoryWriter history, TransitionResolver router, StepEntry stepEntry, int maxDepth) Test-only constructor with explicit max-depth. 测试用构造器(显式 max-depth)。- Parameters:
repo- persistence facade — 持久化门面history- history writer — 历史追加器router- transition resolver — 流转解析器stepEntry- step entry helper — 节点进入工具maxDepth- max chain depth (≥ 1) — 链深度上限(≥ 1)- Since:
- JDK 25, opencode-base-flow V1.0.5
-
-
Method Details
-
execute
Execute the add-sign action. 执行加签操作。R1 S-5: the CAS-increment + per-user task creation + history append runs inside
FlowRepository.runInTransaction(Runnable)so a partial failure rolls back atomically on JDBC backends.R1 S-5:CAS 深度自增 + 逐人 task 创建 + history 追加置于
FlowRepository.runInTransaction(Runnable),JDBC 后端可原子回滚。- Parameters:
task- already-validated owned PENDING task — 已校验任务def- flow definition — 流程定义additionalUserIds- new approver user ids (non-empty) — 新增 userId 列表(非空)comment- sanitised comment (nullable) — 已清洗意见- Since:
- JDK 25, opencode-base-flow V1.0.5
-