I. Ordered Workflow
Ordered activities are the most basic and simple container-type activities in WWF workflows. Ordered activities can be used as branches of many other activities.
Code:
Private void codeexecute1 (Object sender, eventargs e) {console. writeline ("sequence workflow Step 1! ");} Private void codeexecute2 (Object sender, eventargs e) {console. writeline (" sequence workflow Step 2! ");} Private void codeexecute3 (Object sender, eventargs e) {console. writeline (" step 3 of sequential workflow! "); Console. readkey ();}
Effect:
Ii. ifelse
An ifelse activity is a container-type activity. Each branch of an ifelse activity consists of ordered activities. When designing a workflow, if you encounter logic judgment, you can implement it through ifelse activities.
In the toolbox, drag an ifelse and select "code condition" for the attribute "condition. Then, a condition is added. Enter the event name" ifelsebranch1judge "and press enter to enter the judgment code.
Private int icondition = 90; Public workflow1 () {initializecomponent ();} private void ifelsebranch1judge (Object sender, conditionaleventargs e) {// less than 10, then take this line E. result = icondition <10;} private void codeactivityappsexecutecode (Object sender, eventargs e) {console. writeline ("line less than 10");} private void codeactivity2_executecode (Object sender, eventargs e) {console. writeline ("line greater than 10"); console. readkey ();}
If there are only two branches and the first branch is not met, the second branch is automatically followed. When there are multiple branches, the last one is automatically executed if the previous one is not met.
If the rules are declared, the method is as follows:
3. While
While activity is a container-type compliant activity, which is a typical rule-based workflow mode.
While activity has a key attribute "conditions". This property page also provides two methods to define its cyclic judgment conditions, they are "code condition" and "declarative rule condition" respectively. They are used in the same way as the logic judgment defined in the ifelse activity.
WWF <Article 2>