Skip to content

VariantTransitions

Defined in: packages/client/src/lib/command-processor/action-manager.ts:113

Lets ActionManager.executeActions resolve each Action against the Instance’s current Variant and apply the Action’s transitionsTo.

CommandProcessor builds one from its store and Vessel registry.

apply(instanceId, expected, next): boolean

Defined in: packages/client/src/lib/command-processor/action-manager.ts:135

Compare-and-set: moves the Instance to next only while its Variant is still expected.

InstanceId

The Instance to transition.

VariantName

The Variant the Action started from.

VariantName

The Variant the Action transitions to.

boolean

Whether the transition applied. false means a newer write won.


resolve(instanceId, action): ActionVariantResolution

Defined in: packages/client/src/lib/command-processor/action-manager.ts:125

Reads the Instance’s current Variant and the named Action’s declaration on it. Called at the Action’s turn, and again once its handler succeeds when the Action declares a transition, since the Vessel can be redefined while the handler runs.

InstanceId

The Instance the Action targets.

ActionName

The Action about to run.

ActionVariantResolution

The Variant and declared transition, or why the Action is unavailable.