States and State Transitions in Consumers
The following diagram displays finite states and the text describes the actions that can take place within a consumer inside each method of the IRowsetNotify interface.
Consumer state/state transition diagram
States
-
Initial is a conceptual state denoting the initial state of any IRowsetNotify method before any phase starts. Full phased events such as DBREASON_COLUMN_SET can at this point receive an OKTODO or FAILEDTODO phase. Any other phase at this point is unexpected, causing the method to undergo a transition to the Undo Work2 state that returns S_FALSE.
-
OKTODO, ABOUTTODO, SYNCHAFTER, and DIDEVENT are states to which the method undergoes a transition upon receiving the phase of the same name. All these states may involve some internal work by the consumer. All states, except DIDEVENT, may receive a FAILEDTODO notification, which causes the method to undergo a transition to the Undo Work1 state.
-
Undo Work1 is an internal state to which the listener undergoes a transition from any state (except DIDEVENT) upon reception of a FAILEDTODO phase. In this state, any work done by the consumer is undone. After the work is undone, the method reverts back to the Initial state and returns S_OK.
-
Undo Work2 is an internal state that captures any unexpected phase. In this state, any work done by the consumer is undone. Once the work is undone, the method reverts back to the Initial state and returns S_FALSE.
Transitions
-
Arrows with a continuous heavy line represent transitions within states upon reception of some expected phase.
-
Arrows with a continuous light line represent transitions resulting from receiving an unexpected phase.
-
Arrows with a dashed line represent an internal transition by the consumer.