Package-level declarations

Types

Link copied to clipboard

Completely skips validation

Link copied to clipboard
interface EventRecorder

Watches all incoming events with purpose of repeating them later on clean (just constructed) StateMachine instance to reproduce exactly the same StateMachine state as before

Link copied to clipboard
class Record(val eventAndArgument: EventAndArgument<*>, val processingResult: ProcessingResult)
Link copied to clipboard
class RecordedEvents(val structureHashCode: Int, val records: List<Record>)

This class is intended to be serialized by client code

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class SavedStateConfig(val structureHashCode: Int, val activeLeafStateNames: List<String>, val dataStateLastValues: Map<String, Any?>)

A constant-size snapshot of an active state configuration. Captured with captureSavedStateConfig and restored with restoreBySavedStateConfig. This type is for data serialization.

Link copied to clipboard

Does not allow warnings or failed processing results

Link copied to clipboard

Functions

Link copied to clipboard
fun StateMachine.captureSavedStateConfig(disableUndoEnabledCheck: Boolean = false): SavedStateConfig

Captures the current active state configuration of this machine as a SavedStateConfig snapshot.

Link copied to clipboard
suspend fun StateMachine.restoreByRecordedEvents(recordedEvents: RecordedEvents, muteListeners: Boolean = true, disableStructureHashCodeCheck: Boolean = false, validator: RestorationResultValidator = StrictValidator): RestorationResult

Processes RecordedEvents with purpose of restoring a StateMachine to a state configuration as it was before (when the record was made). Starts the StateMachine if necessary and returns RestorationResult allowing to inspect how the restoration was processed. Specified RestorationResultValidator will be called to validate the result so do not have to remember to perform validation of the RestorationResult.

Link copied to clipboard
fun StateMachine.restoreByRecordedEventsBlocking(recordedEvents: RecordedEvents, muteListeners: Boolean = true, disableStructureHashCodeCheck: Boolean = false)

Blocking restoreByRecordedEvents alternative

Link copied to clipboard
suspend fun StateMachine.restoreBySavedStateConfig(savedStateConfig: SavedStateConfig, muteListeners: Boolean = true, disableStructureHashCodeCheck: Boolean = false)

Restores this machine to the state configuration described by savedStateConfig. Starts the machine if it is not already started.

Link copied to clipboard
fun StateMachine.restoreBySavedStateConfigBlocking(savedStateConfig: SavedStateConfig, muteListeners: Boolean = true, disableStructureHashCodeCheck: Boolean = false)

Blocking analog of restoreBySavedStateConfig.