WF (vii) (hand bag)

Source: Internet
Author: User

In this demo we will add the If/else logic to the workflow to show the different message by customizing the condition.

If the number of characters in name is odd, the first word outputs "greeting" otherwise outputs "Hello".

1. Add a method to the Sayhelloincode class,

2. Create a unit test in SayHelloFixture.cs to verify correctness,

Running the unit test results in an error and the result is "Hello", since we have not defined the information that the workflow returns under different conditions.

3. Complete the relevant definition

Open the Sayhello.xaml Workflow Designer and click the sequence activity to add the variable::

In WF, variables represent the storage of data, and each variable must have a range, which is important.

Drag and drop an if activity from the toolbar above the assign and set the display name to modify if activity called "if UserName is even",

Add a assign (drag) to then and else inside, configure

Then run the unit test again, you can succeed;

So the demo is done too;

WF (vii) (hand bag)

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.