In the state machine style of workflow authoring, the author models the workflow as a state machine. The workflow itself is made up of a set of states. One state is denoted as a start state. Each state can receive a certain set of events. Based on an event a transition can be made to another state. The state machine workflow can have a final state. When a transition is made to the final state the workflow completes.The following flowchart is an example of a state machine workflow
The following table lists the state machine-related activities in the Windows Workflow Foundation framework activity set.
The following table lists the state machine-related activities in the Windows Workflow Foundation framework activity set.
Activity
Description
EventDrivenActivity
Used for states that rely on an external event to begin executing. The EventDrivenActivity must have an activity that implements the IEventActivity interface as the first child activity. For more information, see Using the EventDrivenActivity Activity.
SetStateActivity
Specifies a transition to a new state. For more information, see Using the SetStateActivity Activity.
StateActivity
Represents a state in a state machine; may contain additional State activities.For more information, see Using the StateActivity Activity.
StateInitializationActivity
Executes when a state is entered; may contain other activities. For more information, see Using the StateInitializationActivity Activity.
StateFinalizationActivity
Executes contained activities when leaving a StateActivity. For more information, see Using the StateFinalizationActivity Activity.
The sequential workflow style is straightforward and useful for repetitive, predictable operations, such as designing a set of activities to be performed in a prescribed sequence that is always the same.
The following flowchart shows a sequential workflow.
A sequential workflow executes activities in a sequential manner until the last activity completes. Sequential workflows are not necessarily entirely deterministic, even under normal operation. For example, you can use a Listen activity or a Parallel activity, and the exact sequence of events can vary in these cases.
For more information about workflow authoring, see Workflow Authoring Styles
Commentaires