Record Class FlowDefinition

java.lang.Object
java.lang.Record
cloud.opencode.base.flow.model.FlowDefinition
Record Components:
id - unique definition id — 定义 ID(base-id snowflake)
flowKey - business key — 业务 key
version - business version number — 业务版本号
name - human-friendly name — 流程名称
dslJson - original DSL JSON — 原始 DSL JSON
status - lifecycle status — 生命周期状态
steps - parsed steps (immutable) — 解析后的步骤(不可变)
transitions - parsed transitions (immutable) — 解析后的流转(不可变)
createdAt - creation timestamp — 创建时间
createdBy - creator id — 创建人

public record FlowDefinition(String id, String flowKey, int version, String name, String dslJson, FlowStatus status, List<Step> steps, List<Transition> transitions, Instant createdAt, String createdBy) extends Record
Deployed flow definition (immutable view of flow_definition row + parsed DSL). 已部署的流程定义(flow_definition 行 + 解析后 DSL 的不可变视图)。

steps and transitions are copied with List.copyOf(java.util.Collection) on construction, so the record is deeply immutable (modulo Step.assignees which is itself an immutable copy).

steps 与 transitions 在构造时通过 List.copyOf(java.util.Collection) 拷贝,记录是深度不可变的。

Since:
JDK 25, opencode-base-flow V1.0.5
Author:
Leon Soo
  • Constructor Details

    • FlowDefinition

      public FlowDefinition(String id, String flowKey, int version, String name, String dslJson, FlowStatus status, List<Step> steps, List<Transition> transitions, Instant createdAt, String createdBy)
      Compact constructor; deeply copies the step / transition lists. 紧凑构造器:对步骤/流转列表做深拷贝。
      Throws:
      NullPointerException - when a required argument is null
      Since:
      JDK 25, opencode-base-flow V1.0.5
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • flowKey

      public String flowKey()
      Returns the value of the flowKey record component.
      Returns:
      the value of the flowKey record component
    • version

      public int version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • dslJson

      public String dslJson()
      Returns the value of the dslJson record component.
      Returns:
      the value of the dslJson record component
    • status

      public FlowStatus status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • steps

      public List<Step> steps()
      Returns the value of the steps record component.
      Returns:
      the value of the steps record component
    • transitions

      public List<Transition> transitions()
      Returns the value of the transitions record component.
      Returns:
      the value of the transitions record component
    • createdAt

      public Instant createdAt()
      Returns the value of the createdAt record component.
      Returns:
      the value of the createdAt record component
    • createdBy

      public String createdBy()
      Returns the value of the createdBy record component.
      Returns:
      the value of the createdBy record component