The two types of workflows which exist out of the box in Visual Studio are:
* Sequential Workflow
* State Machine Workflow
Below, find the differences between them, so that when you are thinking of implementing a workflow, you would use the one that fits the most:
1. State-machine workflows are workflows which are driven by particular events. Example:
- OnWorkflowActivated etc
2. In order to move to another event, the workflow needs to meet another state.
- * If a task is created, the workflow stays on that event until another even is called, for example the user decides to edit the task (on task changed)
3. The control of the workflow is decided by the user, according to what events he calls, the workflow will execute.
4. The workflow doesn’t really have to end. It can stay in the same state for weeks for example.
5.You could use state machine workflow when for example a document requires multiple reviewers (legal, marketing, etc.) that may sign off on the document in any order
1. Sequential workflow is known to be very predictable. It works like a flowchart – Example:
- The workflow works until the user approves or denies the file in order to continue. When ALL users approve/deny it will go to the next time
2. This kind of workflow is used when there is only one way to complete the task.
3. The workflow controls the processes of what happens throughout the workflow.
4.Sequential workflows are definitely much easier to design and maintain than state machine workflows. The only difference between a state machine workflow and sequential workflow is that in sequential workflow the flow goes from first activity to the next until end of the workflow is reached