Workflow Programming Step-by-Step (3:while activity)

Source: Internet
Author: User
Tags continue

First, the introduction of this article, we learn another simple activity--while activities. The while activity will continue to loop until the specified judgment is false.

Next, let's build a simple example. The purpose of this example is to display a 99 multiplication table primarily using the while activity implementation.

Second, create a console Sequence Workflow sample program framework

Follow the steps below to create a console sequential Workflow sample program:

1. Start VS2008, click menu "File" | " New "|" Project, create a console sequential Workflow sample program named WhileActivity.

2. After that, the system automatically opens the Workflow designer interface.

3. Drag the While activity from the toolbox to the Chinese character hint on the right side of the diagram, and get the situation as shown in the illustration.

4. Because a 99 multiplication table is displayed in the console, it is important to use a double loop to achieve this. In other words, we're going to use a nested while activity. On the other hand, we know that there is a connection between the outer loop and the inner loop variable, that is, after each internal loop execution completes, a new initialization operation is performed. Therefore, embedding a while activity directly in a while activity does not achieve the established functionality.

However, there is a workaround, where we can embed a composite activity in a while activity, a activity that allows it to continue to contain (possibly multiple) child activities, such as parallel execution activities (PARALLEL), serial execution activity (Sequence), and so on.

5. To this end, we finally get the following workflow diagram:

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.