Record Class FlowInstance
java.lang.Object
java.lang.Record
cloud.opencode.base.flow.model.FlowInstance
- Record Components:
id- instance id — 实例 IDdefinitionId- definition id — 流程定义 IDflowKey- redundant flow key — 冗余 keyinitiatorId- initiator user id — 发起人 IDcurrentStepId- currently active step — 当前步骤 IDstatus- 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 Summary
ConstructorsConstructorDescriptionFlowInstance(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 copiesvariablesinto an immutable map. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theaddsignDepthrecord component.Returns the value of thecurrentStepIdrecord component.Returns the value of thedefinitionIdrecord component.endedAt()Returns the value of theendedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.flowKey()Returns the value of theflowKeyrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of theinitiatorIdrecord component.intReturns the value of thelockVersionrecord component.Returns the value of thestartedAtrecord component.status()Returns the value of thestatusrecord component.toString()PII-safe string representation.Returns the value of thevariablesrecord component.
-
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 copiesvariablesinto an immutable map. 紧凑构造器:对variables做不可变拷贝。- Since:
- JDK 25, opencode-base-flow V1.0.5
-
-
Method Details
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
-
definitionId
Returns the value of thedefinitionIdrecord component.- Returns:
- the value of the
definitionIdrecord component
-
flowKey
-
initiatorId
Returns the value of theinitiatorIdrecord component.- Returns:
- the value of the
initiatorIdrecord component
-
currentStepId
Returns the value of thecurrentStepIdrecord component.- Returns:
- the value of the
currentStepIdrecord component
-
status
-
variables
-
addsignDepth
public int addsignDepth()Returns the value of theaddsignDepthrecord component.- Returns:
- the value of the
addsignDepthrecord component
-
lockVersion
public int lockVersion()Returns the value of thelockVersionrecord component.- Returns:
- the value of the
lockVersionrecord component
-
startedAt
-
endedAt
-