State Workflow Example

Another workflow pattern is modeled by the StateMachineWorkflowActivity class. Control is outside of the workflow itself. Human beings or machines decide what action is executed by the workflow next. The workflow itself restricts the choices available. The result of each possible choice is represented by a state of the workflow. The workflow has one initial, and one end state.

To illustrate this pattern, we will build a trivial insurance claim evaluation system. Each claim can be in one of four states: Created, Gathering Information, Under Evaluation, or Processed. The initial state is Created. A claim can go from the Created state to the Gathering Information state. From the Gathering Information state it can go to the ...

Get Building Applications with Windows Workflow Foundation: State Machine and Rules-Driven Workflows now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.