Now that we have a basic concept of workflows, let’s look at how they are modeled within WF. WF is a new framework that will be bundled within the future release of WinFX. WinFX consists of
- Windows Presentation Foundation
- Windows Communication Foundation
- Windows Workflow Foundation.
I mention that WF is a framework for two reasons. First, WF is not a server or application. The WF Runtime manages a workflows lifecycle which is hosted within applications like Web, Windows, Console, etc., supporting long-running workflows using persistence, transactions, tracking. Second, because WF is a true framework that can be extended. WF also has three different styles for workflows.
- State Machine - Minimum of two states where one state is active
- Sequential – Predefined and/or predictable flow of activities
- Rules-Driven – Data Driven flow of activities
Using these styles, WF can model both Human and System type of workflows. Human workflows are a more flexible and reactive within their environment, where system workflows follow a more structured or formal flow. By using the above styles, you can see how Human workflow could be modeled more from State Management style because of the flexibility within the style, where with System workflows, Sequential style is more appropriate because the particular process is solidified. Even though these are the obvious differences, these styles can be interwoven. State Machine styled workflows could have a Sequential styled sub-workflow. For example, when a workflow (a,b,C,d,e) gets to state C, a Sequential styled workflow could be ran to process some data. Finally, Rules-Driven styled workflows are driven, based on set rules for each activity. Let’s say a workflow is measuring an amount and that it has three activities (ABC). The amount is $10 going into activity “A”. Now Activity “B” states, “Bypass me and go to C if amount is less then or equal to $10”.
In conclusion to model workflows based on these styles, three questions should be asked.
Does the flow of a workflow depend on…
- Data-driven rules?
- Outside Input?
- Being Predefined and/or Predictable