Get the Window Workflow Foundation Tutorial source code here


I am responsible for designing the tutorials that go into the documentation for Windows Workflow Foundation (among other things). I'm also responsible for implementation which includes all the coding and writing for the tutorials. The Beta 1 release of Windows Workflow Foundation contains 3 tutorials but there will be more for Beta 2 and the eventual RTM of Windows Workflow Foundation.

The 3 tutorials in the docs right now consist of the following:

  • Simple Expense Report: This is a simple windows form application that simulates a minimal expense report. After filling in a monetary value and clicking the Submit button, a sequential workflow is started that acts on that value. If it's over 1000, the workflow communicates back to the WinForm app to let it know that manager approval is needed. Otherwise, it says that the "Lead" person needs to approve the amount. As I said in a previous post, it's a little more than "Hello World" but not enough to confuse you if it's your first foray into Windows Workflow Foundation.

  • Simple Order Form: This is another windows form application that simulates a order processing system (again, very minimal). Once you select the fruit to order and the quantity, a state machine workflow is started to process the order.

  • Web Tear Custom Activity: This tutorial/project shows how to create a custom activity. The custom activity here is called the WebTear activity whose sole purpose is to "tear" the text from a web page. Before you start on some of the more advanced activity concepts (such as validation), going through this tutorial will give you a good base that you can build on.

There you have it. All 3 tutorials are included in the archive. Also, in case you are wondering, the C# and the VB.NET version is included.

Here you go: WWF Tutorials 1-3.zip

- Mark


Comments (6)
  1. LaVinci says:

    Yes, this is just what I’m looking for.

    now that i have development environment complete with the WinWF installed I’m rearing to go.

    Thanks for the heads up. I was only aware of the PDC hands on labs.

    😉

    — LaVinci

  2. Hi Mark!

    When I open the workflow in the Quickstart1 sample (I double click SeqWorkflowQuickStart.cs) then the designer shows the following error:

    The variable ‘evaluateExpenseReportAmount’ is either undeclared or was never assigned.

    Hide

    Edit

    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)

    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)

    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)

    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)

    The variable ‘listenApproveReject’ is either undeclared or was never assigned.

    Hide

    Edit

    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)

    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)

    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)

    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)

    The service ‘System.Workflow.ComponentModel.Design.IMemberCreationService’ must be installed for this operation to succeed. Ensure that this service is available.

    Hide

    at System.Workflow.ComponentModel.Design.NamePropertyDescriptor.SetValue(Object component, Object value)

    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)

    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)

  3. Mathias,

    You’re right. The source code I uploaded is a little different than the code in the docs. My mistake. I will post an update that will allow you to open the tutorials in the designer soon.

  4. Rajiv Gupta says:

    It is a nice point to start with your sample small applications. But none of them works. Have you uploaded the complete working examples? If yes where? Otherwise when are you going to upload them. I will be eagerly waiting for your sample applications.

  5. michael willoughby says:

    I’ve tried building the examples but VS2005 reports that it can’t find the namespace messaging doesn’t exist along with Sequential workFlow and WorkFlowMessageEventArgs plus other errors

    Also the visual view of workflow won’t show either.

    The references are made to activities,component model and runtime and I have the latest donwloads for workflow and the extensions.

    Any suggestions

  6. peteappleton@foretel.co.uk says:

    OK, I’ve run through the examples, but maybe I’m missing something – WHY???

    Take the simple order form – this uses about 300 lines of code.  However, using simple C# with OO (public class Order { }, etc) takes about 20, is a lot less work, and runs faster.  So… why do I want to use WF?  I’m really struggling to find a use case for it; it seems "cool", and it seems like a "good idea", but what do I actually want to use it for instead of just writing some code???

Comments are closed.

Skip to main content