Using the IfElse Activity

The IfElse activity is designed to simulate an if-then-else conditional expression, and in fact you’ve used this activity in previous chapters (notably in Chapter 1, where the workflow decided whether a given postal code was valid).

The IfElse activity requires you to provide a conditional expression, which is actually implemented as an event handler. The event arguments, of type ConditionalEventArgs, have a Boolean Result property you set to indicate the results of the conditional expression you build into the event handler.

Depending on the Result value, the IfElse activity directs workflow execution to one of two branches. Visually, in the Microsoft Visual Studio workflow visual designer, true executes the path shown ...

Get Microsoft® Windows® Workflow Foundation Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.