Persistent State Machine for Mobile Workflow Recovery
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Mobile device web browsers often crash during multi-device transactions, causing loss of transaction data and requiring users to restart from the beginning, as previous data is not persisted.
Innovation Solution
Implementing an on-device persistent state machine-based architecture that stores work item objects and their identifiers in both data storage and memory, allowing workflows to resume from the current state after a failure event, such as a crash, by using a state machine manager to handle state transitions and task execution.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If transaction data is stored only in volatile memory without persistent storage, then the system operates with simple architecture and fast access, but data is lost when the application crashes or closes
Solution Approach 1:
The system performs preliminary actions by saving the current workflow state to persistent storage before potential failures occur. The state machine manager continuously updates the persisted state machine with the current state, ensuring that even if a crash occurs, the most recent state is preserved and can be restored later.
Solution Approach 2:
The system creates a copy of the workflow state and stores it in persistent storage. The state machine manager maintains both an in-memory representation of the current state and a persisted representation on disk, allowing the system to recover by reloading the copied state after a failure.
2Loss of time
If the system restarts from the initial state after a crash, then data storage requirements are minimized, but user time and productivity are lost
Solution Approach 1:
The system performs preliminary actions by continuously saving workflow progress to persistent storage before failures occur. This allows the system to resume from the last saved state rather than restarting from the beginning, significantly reducing the time users need to spend completing transactions.
Solution Approach 2:
The state machine manager implements feedback mechanisms by continuously monitoring the current state and updating the persisted state machine accordingly. This feedback loop ensures that the persisted state always reflects the current workflow progress, enabling accurate resumption after failures.
3Reliability
If transaction data is not persisted across application launches, then memory usage is minimized, but transaction integrity is compromised
Solution Approach 1:
The system extracts only the essential workflow state information needed for resumption and stores it in persistent storage. Rather than persisting entire transaction objects or complex data structures, the state machine manager saves only the current state identifier and essential metadata, minimizing storage requirements while maintaining transaction integrity.
Solution Approach 2:
The system changes the parameter of data persistence by storing state information in a compact, serialized format. The persisted state machine uses parameter-efficient representations of workflow states, transforming complex state objects into minimal data structures that consume little storage space while preserving all necessary information for resumption.
Data Source
AI summary
A workflow for a work item may be executed using an on-device persistent state machine-based architecture. The on-device state machine-based architecture may include a state machine manager that executes the workflow in accordance with a state machine that includes multiple states corresponding to stages of execution in the workflow. Each state in the state machine is associated with one or more tasks to be executed in connection with that state. The state machine further specifies one or more state transitions for each state of the state machine. A state transition associated with a particular state indicates a next state to transition to from the particular state upon completion of the one or more tasks associated with the particular state.


