Record Class FlowInstance

java.lang.Object
java.lang.Record
cloud.opencode.base.flow.model.FlowInstance
Record Components:
id - instance id — 实例 ID
definitionId - definition id — 流程定义 ID
flowKey - redundant flow key — 冗余 key
initiatorId - initiator user id — 发起人 ID
currentStepId - currently active step — 当前步骤 ID
status - instance status — 实例状态
variables - business variables (immutable; may contain PII) — 业务变量
addsignDepth - addsign chain depth — 加签链深度
lockVersion - optimistic lock version — 乐观锁版本
startedAt - start timestamp — 启动时间
endedAt - end timestamp (null when running) — 结束时间

public record FlowInstance(String id, String definitionId, String flowKey, String initiatorId, String currentStepId, InstanceStatus status, Map<String,Object> variables, int addsignDepth, int lockVersion, Instant startedAt, Instant endedAt) extends Record
Running flow instance (mirrors flow_instance row). 运行中的流程实例(对应 flow_instance 表行)。

PII WARNING (v4 §6.2): variables may contain Personally Identifiable Information or credentials supplied by the host system. toString() is overridden to skip the variables payload — only variables.size is printed — so accidental logging of a FlowInstance cannot leak sensitive data. If you need to inspect variables, do so deliberately via variables().

PII 警告(v4 §6.2):variables 可能包含宿主提供的 个人信息或凭据。toString() 已覆盖,不打印变量内容,仅打印 variables.size,避免误日志泄漏;如需查看具体变量,请显式访问 variables()。

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

    • FlowInstance

      public FlowInstance(String id, String definitionId, String flowKey, String initiatorId, String currentStepId, InstanceStatus status, Map<String,Object> variables, int addsignDepth, int lockVersion, Instant startedAt, Instant endedAt)
      Compact constructor; defensively copies variables into an immutable map. 紧凑构造器:对 variables 做不可变拷贝。
      Since:
      JDK 25, opencode-base-flow V1.0.5
  • Method Details

    • toString

      public String toString()
      PII-safe string representation. Variables are not rendered; only their size is printed. PII 安全的字符串表示。不打印变量内容,只打印 size。
      Specified by:
      toString in class Record
      Returns:
      safe string form — 安全字符串
      Since:
      JDK 25, opencode-base-flow V1.0.5
    • 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
    • definitionId

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

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

      public String initiatorId()
      Returns the value of the initiatorId record component.
      Returns:
      the value of the initiatorId record component
    • currentStepId

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

      public InstanceStatus status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • variables

      public Map<String,Object> variables()
      Returns the value of the variables record component.
      Returns:
      the value of the variables record component
    • addsignDepth

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

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

      public Instant startedAt()
      Returns the value of the startedAt record component.
      Returns:
      the value of the startedAt record component
    • endedAt

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