O'Reilly logo

Building Applications with Windows Workflow Foundation (WF): Advanced Workflow Features by Michael Stiefel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Fault Handling and Cancellation

Fault Handling

What happens if an activity throws an exception? You cannot place a try/catch handler around it as you can in code. The Fault Handling example illustrates how to handle exceptions thrown in the course of an executing activity. We have a simple workflow of three code activities. Initially, the middle activity whose ExecuteCode delegate throws an exception is disabled (see Figure 31).

FIGURE 31 Fault Handling Example Workflow

image

Running the example causes the Start and Finish activities, as well as the WorkflowCompleted event handler to write messages to the console. The file exception.cs defines two ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required