WorkflowIdentifier

Represents a Workflow's "identity" and is used by the runtime to determine whether a workflow is the same as one that was rendered in a previous render pass, in which case its state should be re-used; or if it's a new workflow and needs to be started.

A workflow's identity consists primarily of its concrete type (i.e. the class that implements the Workflow interface). Two workflows of the same concrete type are considered identical. However, if a workflow class implements ImpostorWorkflow, the identifier will also include that workflow's ImpostorWorkflow.realIdentifier.

Instances of this class are equatable and hashable.

Identifiers and snapshots

Since workflows can be serialized, workflows' identifiers must also be serializable in order to match workflows back up with their snapshots when restoring. However, some WorkflowIdentifiers may represent workflows that cannot be snapshotted. When an identifier is not snapshottable, toByteStringOrNull will return null, and any identifiers that reference ImpostorWorkflows whose ImpostorWorkflow.realIdentifier is not snapshottable will also not be snapshottable. Such identifiers are created with unsnapshottableIdentifier, but should not be used to wrap arbitrary workflows since those workflows may expect to be snapshotted.

Parameters

type

Wrapper around the KClass of the Workflow this identifier identifies, or the KType of an unsnapshottableIdentifier.

proxiedIdentifier

An optional identifier from ImpostorWorkflow.realIdentifier that will be used to further narrow the scope of this identifier.

description

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Returns either a KClass or KType representing the "real" type that this identifier identifies – i.e. which is not an ImpostorWorkflow.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun toByteStringOrNull(): ByteString?

If this identifier is snapshottable, returns the serialized form of the identifier. If it is not snapshottable, returns null.

Link copied to clipboard
open override fun toString(): String

If this identifier identifies an ImpostorWorkflow, returns the result of that workflow's ImpostorWorkflow.describeRealIdentifier method, otherwise returns a description of this identifier including the name of its workflow type and any ImpostorWorkflow.realIdentifiers.