Home >Backend Development >C#.Net Tutorial >【.NET】 Getting Started with WF

【.NET】 Getting Started with WF

黄舟
黄舟Original
2017-02-23 09:53:054070browse

Introduction

## The full name of WF is Windows Workflow Foundation, which is a set of work launched by Microsoft after .NET3.0 Stream development framework. WF is one of the three major frameworks (WPF, WCF and WF) launched by Microsoft on .NET3.0. Its main purpose is to embed workflow applications into existing .NET applications. The latest .NET4.5 version is currently The WF function has been perfectly integrated. WF is not an independent workflow application. It provides some class libraries to assist the development of workflow applications and provides some mechanisms that need to be implemented when implementing workflow applications, such as persistence, compensation, and tracking mechanisms. wait.

Usage

## WF is used to simplify and enhance the development of .NET applications If the application needs to involve workflow then WF is the best choice. WF is not an independent application development environment, it provides a framework for assisting workflow development. WF will be hosted into a stand-alone application, such as a Windows Forms application, ASP.NET application or Web Service.

The first WF program HelloWord

## Next we use VS2013 to implement a WF application Program, the control result is displayed with a delay of 10 seconds.

1. Create a workflow console application

2. Drag and drop a “Sequence” sequence control flow from the toolbox:

## 3. Drag and drop a Delay component in Sequence to delay the time, set the delay to 10s

4. Drag and drop another active node "WriteLine" below Dealy to output helloWord

5. At this point, the basic controls have been dragged and dropped, but In order to reflect the time difference, we add a "WriteLine" before Delay and after the output result to display the current system time

6. Host code (the code is quite simple after .NET4.0)

##

<span style="font-family:KaiTi_GB2312;font-size:18px;color:#666666;"><strong> class Program
    {
        static void Main(string[] args)
        {
            WorkflowInvoker.Invoke(new Workflow1());
        }
    }</strong></span>

7. Output the result


I have been exposed to workflow in projects before, but I only understand its ideas and have not personally practiced its specific usage. Here is just an entry-level small program, which is very simple. If you have a deeper understanding, I hope you can communicate at any time. Please criticize and correct any shortcomings.

The above is the content of Getting Started with WF. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


##

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn