Record Class Task

java.lang.Object
java.lang.Record
cloud.opencode.base.flow.model.Task
Record Components:
id - task id — 任务 ID
instanceId - owning instance id — 所属实例 ID
stepId - step id of this task — 节点 ID
assigneeId - single assignee user id — 单个承接人
status - task status — 任务状态
outcome - decision outcome (null while TaskStatus.PENDING) — 决策结果(TaskStatus.PENDING 时为 null)
lockVersion - optimistic lock version — 乐观锁版本
createdAt - creation timestamp — 创建时间
finishedAt - finish timestamp (null while pending) — 完成时间

public record Task(String id, String instanceId, String stepId, String assigneeId, TaskStatus status, TaskOutcome outcome, int lockVersion, Instant createdAt, Instant finishedAt) extends Record
Current or historical task (mirrors flow_task row). 当前 / 历史任务(对应 flow_task 表行)。
Since:
JDK 25, opencode-base-flow V1.0.5
Author:
Leon Soo
  • Constructor Details

    • Task

      public Task(String id, String instanceId, String stepId, String assigneeId, TaskStatus status, TaskOutcome outcome, int lockVersion, Instant createdAt, Instant finishedAt)
      Compact constructor; validates required fields. 紧凑构造器:校验必填字段。
      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
    • instanceId

      public String instanceId()
      Returns the value of the instanceId record component.
      Returns:
      the value of the instanceId record component
    • stepId

      public String stepId()
      Returns the value of the stepId record component.
      Returns:
      the value of the stepId record component
    • assigneeId

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

      public TaskStatus status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • outcome

      public TaskOutcome outcome()
      Returns the value of the outcome record component.
      Returns:
      the value of the outcome record component
    • lockVersion

      public int lockVersion()
      Returns the value of the lockVersion record component.
      Returns:
      the value of the lockVersion record component
    • createdAt

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

      public Instant finishedAt()
      Returns the value of the finishedAt record component.
      Returns:
      the value of the finishedAt record component