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]