It is interesting to see that the workflow basically provides almost all the constructs of a language. Can it be that we are in a visual language era? The era where system analysts will design the code and developers design the plumbing.Anyway, I decided to attend the deep dives to workflows since the C#3.0 review was to be repeated again.
Workflows are nothing of activities. Activities are things that do things for you in a way that contributes to your process. WWF is not meant to be neither an application or a server. Instead its a framework that allows you to build more.http://www.workflowPatterns.org has some workflow patterns. There are a set of basic activities that come out of the box. There are some cool visual designers that allow you to design the workflows right from VS.NET 2005. It can even be debugged. The primary thing about implementing a custom activity is that you need to derive off of Activity and implement Execute which returns a Status. It all exists in System.Workflow.ComponentModel. The presenter is Dennis at http://www.dennispi.com/ Activity contains a set of components associated through activity definition.
Services -> call -> Activity -> [optional services] Designer/Validator/Serializer/Code GeneratorYou always want to associate a designer or any of the components, you need to use [Designer] attribute on those classes. If you want to implement a desinger, derive off of Designer.
If you want to restrict the kind of activities that can be inserted into a sequential designer, you can implement CanInsertActivities. That does not prevent you from coding in the restrictions imperetively though. So, You will need to implement a validator that would throw out any restricted item.Activity execution
- Initialized [Initialize()]
- Executing [Execute()]
- Canceled[If Cancel()ed]
Property promotions are provided in order to allow parent activities to modify your local activities. http://www.windowsworkflow.net contains more.