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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.