I've my fair share of posts from TechEd with I've found the technology interesting and wanted to learn more about it and so I did :) Workflow is something I see a need for in 99% of projects I've done up until this point and in coming projects I have on the horizon. I won't bore you with the details about WF here you can however go to the site for WF if you want to get some background information on the technology.
So this was a whiteboard discussion and lots of great questions were asked. The first one:
Why?
Why did Microsoft create WF? They did it because they identified a need for such a thing internally in Microsoft. Lots of their products have some sort of work flow built like Exchange (Assign Task to User), SQL Server, and of course BizTalk. A lightweight framework for doing workflow was needed in order to allow for it to be used in smaller scale applications such as web- or win applications.
WF is already in use in some Microsoft products today examples are SharePoint server, nothing too surprising there, however it may surprise you to learn that Speech Server utilizes WF also. There are other examples but those are the ones he could remember off of the top of his head. Also BizTalk will use WF for orchestrations in the next version.
When should we use BizTalk instead of WF?
It's basically a build vs. buy decision. You can do everything with WF you can do in BizTalk it requires some custom programming though. I liken the situation with that of SharePoint Server and SharePoint Services. With services you get a lot of standard functionality to build on and with server you get lot of extra bits on top of that.
BAM can monitor WF in BizTalk R2
How do you expose WF to the end user?
There's a MMC snap-in called the Workflow Manager which can display and alter workflows. WF provides a design surface for workflows which can be hosted in any application. It can even be used in a web scenario as it can save itself as an image and be displayed to the user in a browser that way. You cannot edit in that case but there are some third party clients which uses AJAX to provide a similar experience to the design surface.
How do we create workflows?
You use the design surface or create it using code. A workflow is stored as XAML the workflow engine loads this file and processes it. As we are only dealing with XAML workflows can be stored anywhere.
Versioning?
When you start a new process the workflow definition is stored alongside the process. This means that a running process will be unaffected when you update a workflow definition. You override this behavior and have the definition updated for running processes as well.
How do we create a page flow with WF?
Page flow is a UI driven by WF. You create a page for each state and utilize a state workflow. Rules will determine which step is the next in the flow. A demo was shown of an internal prototype for creating navigation workflows. We might see it in the next version.
Exception Management?
Exception management as in errors in a business process not as in System.Exception. It's a good way to introduce workflow into legacy applications. When something happens in the existing process you can have it trigger the workflow to handle the exception. From here on in the workflow will do the heavylifting until the issue is resolved. At this time the workflow will pass a message back into the legacy process to tell it that the issue is resolved.
Rules?
WF supports rules with its rules engine. Rules are a way of externalizing conditions on might a workflow acts. Complicated rules are more easily handled this way. They are stored in a separate file from the workflow definition. Visual Studio includes a rules editor when WF is installed. The rules engine can be employed outside the WF framework and be run against objects if you only need the rules engine. it supports chaining meaning that if a rules passed in step 1 but step 3 causes the rule to not validate any longer the rules engine will detect this and fail the process. The behavior can be turned off if you so desire. The rules should be employed if they change a lot. There is some deadlock detection present but this is an area which will be expanded in the future and a rules API exist if you need to do advanced deadlock detection today.
Diagnostics?
A tracking service is provided which writes results to the SQL Server datastore on top of this you can build reports which can be used to display workflows which might be having issues.
How to create business processes and longrunning processes?
I actually asked this question because it's something which has been on my mind as this is the area where I see an immediate need for WF.
Some kind of host is needed, typically either IIS or a Windows service. Choosing one over the other is a question of how much processing the workflow will do. IIS may be busy serving up pages and it would be unfortunate to burden it further with heavy workflows. You would use IIS if the workflow is operating in a request/response environment.
Event driven workflows are the way to go with longrunning processes. Basically a nobrainer there.
Restarts are handled gracefully if the reboot is done properly. Turning off the machine without allows it to shutdown will of course not work the workflow will restart from the last save point in this case. A proper shutdown will cause the workflow to persist itself using the persistence service (which you can create yourself). Powerouts and other situations which can't be handled by WF can be dealt with by using System.Transaction.
Multiple consumers can work on a single store of processes to allow for scaleout scenarios. Processes will be logically locked to prevent them being pulled into multiple consumers.