Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
 Using the EventDrivenActivity Activ...
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Using the EventDrivenActivity Activity

The EventDrivenActivity activity contains a sequence of activities whose execution is started by an event. This event is subscribed to by the first child activity in the sequence, which must derive from the IEventActivity interface. The IEventActivity interface is implemented by activities that wait for external events, such as HandleExternalEventActivity and DelayActivity.

In a sequential workflow, you can have multiple IEventActivity-derived activities inside an EventDrivenActivity activity.

In a state machine workflow, you can add an EventDrivenActivity activity as an immediate child of a StateActivity activity, or to the workflow itself. However, when you use an EventDrivenActivity activity in a state machine workflow, you can only use a single activity derived from IEventActivity, and this activity must be the first activity in the state. This is because the state machine workflow model that Windows Workflow Foundation implements processes only one EventDrivenActivity activity at a time. For example, if multiple IEventActivity activities inside an EventDrivenActivity activity were able to run, you would have a situation where an EventDrivenActivity activity becomes blocked while it waits for an IEventActivity that might never execute. This would prevent the state machine from being able to process any more messages.

For more information, see the EventDrivenActivity class and the IEventActivity interface of the System.Workflow.Activities namespace in the Windows Workflow Foundation Class Library reference.

For a code sample that demonstrates how to use the EventDrivenActivity activity, see the Listen Sample.

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker