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)