Sep 22, 2008

Event-Driven Activities

WF includes a group of activites that work together to provide event handling within workflow. Some of these activites wait for an external event(eg HandleExternalEventActivity), while others trigger and handle an event internally( DelayActivity) In both case, the activites implment the IEventActivity interface, which is a requirement for any activity that handles an event. Other activity are composites that act as containers for these event handler activities. EventDrivenActivity is similar to SequenceActivity in that it contains a set of child activites that are executed in sequence. However, EventDrivenActivity requires that first activity implment IEventActivity. When this first child executes, it immediately begins waiting for its event. Execution of the entire EventDrivenActivity is suspended until the event is received or the activity is canceled.

Other actvities , such as ListenActivity as as containers for multiple instance of EventDrivenActivity. Each EventDrivenActivity represents a branch of execution that is triggered by a different event. The EventDrvienActivity is the only child activity permitted by the ListenActivity.