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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.