One Step one step study WF series (iv) Workflow simulation landing

Source: Internet
Author: User
Keywords nbsp we work user
Tags activity basic code continuous control control mode development starting

1. The SUMMARY

We are already familiar with the basic concept of WF, I believe you are also eager to. Want to step into the real WF development.

Starting with this article, let's familiarize ourselves with the activities in WF.

2. Activities

The core of WF is a series of activities.

A workflow is a system in which multiple activities are grouped together to form a sequential, orderly, custom and flow-through workflow engine and based on business needs.

With the above two definitions, I believe we should all understand what the activity means to the workflow.

3. codeactivity

The code control is the most usage-efficient control we have in WF. The user performs a function through the code control.

The common function of the code control is to check the state of the workflow, and to change local variables and information. In general, code codes should not invoke external resources, such as WebService.

One of the most important key events in CodeActivity is Executecode. This event occurs when code executes.

These uses will be slowly understood in future examples. Here we look at a simple example:

Then write the code in the background:

private void Helloexecute (object sender, EventArgs e) {Console.WriteLine ("Hello");}

We've talked about this before and we're not going to talk about it anymore.

4. IfElseActivity

This activity, as we mentioned in the first chapter, is the equivalent of the IF---else in our language.

Conditionally run one of two or more activities of type ifelsebranchactivity.

We use examples to explain slowly, here, we simulate a user login process.

First, let's do the prep work, create a WinForm form, and form a landing interface:

Then we write two attributes in the workflow's background code:

private string Username;private string Userpassword;public string username{set {userName = value;}} public string userpassword{set {UserPassword = value;}}

Next, we'll drag and drop a IfElse control into the workflow.

Next, we right-click on ifElseBranchActivity1 and look at one of his important attributes.

IfElseBranchActivity1 is equivalent to a branch of an if---else. So, of course, we need to specify his entry conditions.

We notice the condition attribute, which we can see after the expansion:

So let's choose to add a branch to add an if---else clause:

Continue >> Next [1th] [page 2nd]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.