Enum Class FlowErrorCode

java.lang.Object
java.lang.Enum<FlowErrorCode>
cloud.opencode.base.flow.exception.FlowErrorCode
All Implemented Interfaces:
Serializable, Comparable<FlowErrorCode>, Constable

public enum FlowErrorCode extends Enum<FlowErrorCode>
Catalogue of stable error codes for the opencode-base-flow module. opencode-base-flow 模块的稳定错误码目录。

All codes share the BASE-FLOW- prefix as required by the design baseline (v4 §14). Enum constants follow DOMAIN_DETAIL naming (DSL / DEF / INST / TASK / ACT / RES / EXPR / CONC / CFG / INPUT). The wire-format code() is the contract that callers should match against; the defaultMessage() is a fallback English description suitable for logging when no i18n bundle is available.

所有错误码遵循设计基线(v4 §14)要求统一以 BASE-FLOW- 为前缀。 枚举常量采用 领域_细节 命名(DSL / DEF / INST / TASK / ACT / RES / EXPR / CONC / CFG / INPUT)。code() 是调用方应匹配的契约串; defaultMessage() 是英文兜底描述,当未引入 i18n 包时用于日志。

Total: 24 codes (design v4 §7.2; expanded from 23 to 24 during the 1.0.5 post-R2 hardening pass to add a dedicated database-access failure code — see R1 S-4).

共 24 项(设计方案 v4 §7.2;1.0.5 R2 后收尾阶段由 R1 S-4 修复带入, 由 23 项扩到 24 项,新增数据库访问失败码)。

Since:
JDK 25, opencode-base-flow V1.0.5
Author:
Leon Soo
See Also:
  • Enum Constant Details

    • DSL_INVALID

      public static final FlowErrorCode DSL_INVALID
      JSON structure invalid (e.g. malformed, missing required field). JSON 结构非法(如格式错误、缺必填字段)。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • DSL_DUP_STEP_ID

      public static final FlowErrorCode DSL_DUP_STEP_ID
      Duplicate step id within the same flow definition. 同一流程定义内节点 id 重复。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • DSL_INVALID_REFERENCE

      public static final FlowErrorCode DSL_INVALID_REFERENCE
      Transition references a non-existent step id. transitions 引用了不存在的节点 id。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • DSL_INVALID_ENUM

      public static final FlowErrorCode DSL_INVALID_ENUM
      Illegal value for strategy / mode / type enums. strategy / mode / type 等枚举取值非法。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • DSL_UNSUPPORTED_SCHEMA_VERSION

      public static final FlowErrorCode DSL_UNSUPPORTED_SCHEMA_VERSION
      Unsupported schemaVersion. schemaVersion 不被当前引擎支持。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • DSL_QUOTA_EXCEEDED

      public static final FlowErrorCode DSL_QUOTA_EXCEEDED
      DSL document exceeds parser quotas (size / depth / array length). DSL 文档超出解析配额(大小 / 嵌套深度 / 数组长度)。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • DEF_DUPLICATE

      public static final FlowErrorCode DEF_DUPLICATE
      Duplicate (flow_key, version) on deploy. 部署时 (flow_key, version) 已存在。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • DEF_DEPRECATED

      public static final FlowErrorCode DEF_DEPRECATED
      Attempt to use a deprecated flow definition. 尝试使用已弃用的流程定义。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • INST_NOT_FOUND

      public static final FlowErrorCode INST_NOT_FOUND
      Flow instance not found. 流程实例不存在。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • INST_ENDED

      public static final FlowErrorCode INST_ENDED
      Flow instance has already ended (COMPLETED / TERMINATED / WITHDRAWN). 流程实例已结束(COMPLETED / TERMINATED / WITHDRAWN)。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • TASK_NOT_FOUND

      public static final FlowErrorCode TASK_NOT_FOUND
      Task not found. 任务不存在。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • TASK_NOT_ASSIGNED_TO_USER

      public static final FlowErrorCode TASK_NOT_ASSIGNED_TO_USER
      Task is not assigned to the calling user (ownership pre-check failure). 任务不属于当前调用用户(所有权前置校验失败)。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • TASK_ALREADY_DONE

      public static final FlowErrorCode TASK_ALREADY_DONE
      Task is already completed. 任务已完成。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • ACT_NOT_ALLOWED

      public static final FlowErrorCode ACT_NOT_ALLOWED
      The requested action is not permitted at the current step. 当前节点不允许该动作。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • ACT_INVALID_REJECT_TARGET

      public static final FlowErrorCode ACT_INVALID_REJECT_TARGET
      Reject target step id is invalid (not visited in history). 驳回目标步骤无效(history 中未出现过)。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • ACT_WITHDRAW_FORBIDDEN

      public static final FlowErrorCode ACT_WITHDRAW_FORBIDDEN
      Withdraw failed due to withdraw-policy constraint. 撤回违反 withdraw-policy 约束。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • ACT_ADDSIGN_DEPTH_EXCEEDED

      public static final FlowErrorCode ACT_ADDSIGN_DEPTH_EXCEEDED
      Add-sign chain exceeded the configured depth limit. 加签链超出配置的深度上限。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • RES_RESOLVER_RETURNED_EMPTY

      public static final FlowErrorCode RES_RESOLVER_RETURNED_EMPTY
      AssigneeResolver returned an empty user list. AssigneeResolver 返回了空的用户列表。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • RES_USER_VALIDATION_FAILED

      public static final FlowErrorCode RES_USER_VALIDATION_FAILED
      toUserId / user validation failed (e.g. user not found). toUserId 或用户校验失败(如用户不存在)。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • EXPR_EVALUATOR_NOT_PROVIDED

      public static final FlowErrorCode EXPR_EVALUATOR_NOT_PROVIDED
      DSL references a ${expr} but no ExpressionEvaluator was injected. DSL 引用了 ${expr} 但未注入 ExpressionEvaluator。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • CONC_VERSION_CONFLICT

      public static final FlowErrorCode CONC_VERSION_CONFLICT
      Optimistic-lock version conflict (concurrent modification). 乐观锁版本冲突(并发修改)。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • CFG_INVALID_VALUE

      public static final FlowErrorCode CFG_INVALID_VALUE
      Illegal configuration value (e.g. table-prefix regex mismatch). 配置值非法(如 table-prefix 不匹配正则约束)。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • INPUT_INVALID_TEXT

      public static final FlowErrorCode INPUT_INVALID_TEXT
      User-supplied text field exceeds length limit or contains illegal control characters. 用户提交的文本字段超长或含非法控制字符。
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • DB_ACCESS_FAILURE

      public static final FlowErrorCode DB_ACCESS_FAILURE
      Generic database access failure at runtime — connection drop, deadlock, timeout, or any other JDBC error not specifically classified above. This code is distinct from CFG_INVALID_VALUE, which is reserved for startup / schema configuration errors (e.g. illegal table-prefix); it lets callers distinguish transient infrastructure faults from invalid configuration when deciding whether to retry. 通用数据库访问失败(连接抖动 / 死锁 / 超时 / 其它运行时 JDBC 错误)。 与 CFG_INVALID_VALUE(启动 / schema 期配置错误)明确分离, 便于调用方区分基础设施抖动与配置非法,从而决定是否重试。
      Since:
      JDK 25, opencode-base-flow V1.0.5
  • Method Details

    • values

      public static FlowErrorCode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FlowErrorCode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • code

      public String code()
      Returns the stable wire-format error code, e.g. "BASE-FLOW-INST-001". 返回稳定的契约错误码,例如 "BASE-FLOW-INST-001"。
      Returns:
      the error code | 错误码
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • defaultMessage

      public String defaultMessage()
      Returns the fallback English message used when no i18n bundle is wired. 返回未引入 i18n 包时使用的英文兜底消息。
      Returns:
      the default message | 默认消息
      Since:
      JDK 25, opencode-base-flow V1.0.5