Thursday, March 08, 2007

Microsoft Windows Workflow Foundation (WF) Introduction - My first step!

Microsoft Windows Workflow Foundation (WF)

Windows Workflow Foundation is the programming model, engine and tools for quickly building workflow enabled applications. WF radically enhances a developer’s ability to model and support business processes.

Introduction:

Windows workflow is a part of .NET 3.0 framework. This will help the developers and IT professionals to create Business process managed application. Workflow is consist of four parts Activity Model, Workflow Designer, Workflow Runtime and Rules Engine.

You can download the windows workflow from the following below mentioned links.
Microsoft® Visual Studio® 2005 Extensions for Windows® Workflow Foundation Release Candidate 2

You can get the .NET 3.0 framework from the below link.
Microsoft .NET Framework 3.0 Redistributable Package

My first sample - WF (Sequential Workflow Console Application)

First create a new sequential workflow console application project using your visual studio 2005.


Then open the solution explorer and delete the workflow1.cs from your create from your project.





After deleting the workflow1.cs, select your solution and right clik and add new item to your solution.



After selecting add new item you select the item template named Sequential Workflow (with code separation) and click the Add button to add the new workflow to your solution project.



The new Sequential Workflow project will now contain two files: Workflow1.xoml and Workflow1.xoml.cs. Workflow1.xoml contains the XML markup that represents the workflow type. Workflow1.xoml.cs contains the code-beside class for the workflow. Double click on the Workflow1.xoml file in Solution Explorer to open the Visual Studio workflow designer.



Selecting the smart tag will cause the Properties tool window to be displayed with the ExecuteCode property highlighted. Enter the value codeActivity1_CodeHandler for the ExecuteCode property and press Enter.


Code:

private void codeActivity1_ExecuteCode(object sender, EventArgs e)
{
Console.WriteLine("My first WF code sample");
}

After successfully building the solution, while running the project you will get the following message as output.



Download Sourcecode

No comments:

ASP.NET MVC - Sport Facility Booking system

  The project relies on some external service providers. Thus accessing them via their API requires authentication. An API Key need to be su...