Sunday, October 21, 2012

Hello Workflow

Creating a Simple Hello Workflow Application

We will create a very simple workflow that will be the equivalent to this code:

C#
private static void SayHello()
{
  Console.WriteLine("Hello Workflow 4");
}

Visual Basic
Private Shared Sub SayHello()
  Console.WriteLine("Hello Workflow 4")
End Sub

  1. Start Microsoft Visual Studio 2010 from Start | All Programs | Microsoft Visual Studio 2010.
  2. Create a new project in Visual Studio 2010 of type Workflow Console Application (under the Workflow project type) in either the Visual C# or Visual Basic projects Templates list. Ensure .NET Framework 4 is selected as the target runtime, and name it HelloWorkflow. Name the solution Begin, set the desired location, and click OK.
    Creating a new Workflow Console Application (C#)
    Creating a new Workflow Console Application (C#)
  3. Creating a new Workflow Console Application (Visual Basic)
    Creating a new Workflow Console Application (Visual Basic)

  4. Since your business process is a 1 step process, you can simply add a WriteLine activity to implement the process. From the Toolbox, drag a WriteLine activity and drop it on the design surface.
    Adding a WriteLine activity
    Adding a WriteLine activity
    Note: If the Toolbox window is not visible, select Toolbox from the View menu.
    1. Set the WriteLine Text property to "Hello Workflow 4".
      Setting the Text property
      Setting the Text property
      Note: The WriteLine activity is a simple activity that will display a message on the console. The text property is an Expression which could be the result of calling a function or evaluating the property of an object. In this case, the expression is a literal string so you must quote the string.
      1. Press CTRL+F5 to build and run the workflow without debugging. The application should run in a console window and print the message “Hello Workflow 4”.
        The completed HelloWorkflow application
        The completed HelloWorkflow application

        2 comments:

        Automatic Traffic Exchange

        YallaTech Facebook page