SIGN UP MEMBER LOGIN:    
ARTICLE

Start working with Workflow 4.0 in Visual Studio 2010

Posted by Kimi Kalon Articles | Workflow Foundation in C# August 11, 2011
Start working with Microsoft’s Workflow Foundation. The WF 4.0 represents a whole new paradigm for building workflow-based applications, it is a visual designer and debugger for the graphical construction.
Reader Level:
Download Files:
 

This is my first article on this site I hope it will help some-one..

Introduction

A workflow is a series of distinct programming steps or phases. Each step is modeled in WF as an Activity. It has been completely reengineered from the ground up. It is a way to execute business processes and in today's applications supporting business processes we are frequently using Windows Workflow technologies as the key technical solution.

A key component of workflow design is the use of extensions to configure the environment in which the workflow activities operate, the .NET Framework provides a library of activities and custom activities can also be developed for additional functionality. The Workflow Designer is built using Windows Presentation Foundation (WPF). This enhances the activity designer experience and improves performance for large and complex workflows.

Some of the major criteria for workflows are listed below:

  • Visual Representation of process
  • Can be dynamically modified at run-time
  • Can be long-running

Activities can be assembled visually into workflows using the Workflow Designer, a design surface that runs within Visual Studio. The designer can also be hosted in other applications.

Getting Started:

Step 1: Start Visual Studio 2010 and select the New Project and choose Workflow Console Application give name in my case HelloWorld

Workflow application

The application generates a Program.cs file and Workflow1.xaml file which is used for the console application and workflow

autogenerated files in Workflow 4.0

Step 2: First go to Workflow1.xaml file initial it is empty, drag a WriteLine activity

writeline activity in Workflow 4.0

Step 3: Go to the  properties of WriteLine activity and insert the value

activity properties in Workflow 4.0

Step 4: Go to the Program.cs file and modify the code like below

program file in Workflow 4.0

using System;
using System.Linq;
using System.Activities;
using System.Activities.Statements;
 
namespace HelloWorld
{
 
    class Program
    {
        static void Main(string[] args)
        {
            WorkflowInvoker.Invoke(new Workflow1());

            Console.WriteLine("Press ENTER to exit");
            Console.ReadLine();
        }
    }
}

Step 5: Run the application

output file in Workflow 4.0

Output

Press Enter to exit the application output

Thank You I hope you like this article....

Login to add your contents and source code to this article
share this article :
post comment
 

Thank you Dinesh...

Posted by Kimi Kalon Aug 12, 2011

Useful article, welcome to the Mindcracker Community.

Posted by Dinesh Beniwal Aug 11, 2011
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
Team Foundation Server Hosting
Become a Sponsor