Freigeben über


Using the ListenActivity Activity

The ListenActivity activity is a composite activity that contains a minimum of two child activities. Each child activity must be an EventDrivenActivity activity. Only the EventDrivenActivity branch that is associated with the first IEventActivity event raised is executed; all other branches are canceled.

The ListenActivity activity is generally used in a workflow that is listening for a set of events, so that the workflow will continue execution when any one of the events arrives. As a result, when one of the events is received, the other ListenActivity activities stop listening for their respective events.

Note

The ListenActivity activity cannot be used in state machine workflows.

For more information, see the ListenActivity class of the System.Workflow.Activities namespace in the Windows Workflow Foundation Class Library reference.

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

See Also

Reference

ListenActivity
EventDrivenActivity
IEventActivity

Concepts

Using the EventDrivenActivity Activity

Other Resources

Listen Sample
Windows Workflow Foundation Activities