Summary


The activity execution model is proof of a well-architected framework that can handle scenarios such as faults, persistence, and compensation. When an activity executes, it does so within the confines of an activity execution context. This context describes the activity’s state during the time in which it executed. Each activity’s execution context can be persisted so that compensation can occur weeks or months after it actually executed.

For activities that have multiple children or that have child activities executing multiple times, you must create separate execution contexts manually using the ActivityExecutionContextManager class, which is available from an ActivityExecutionContext instance. An example ForEachActivity was developed in this chapter to illustrate this concept. Even though this activity has only one child, each time that child executed, it was within a separate context.

The chapter also introduced workflow queues as the conduits for host-to-workflow communication. Instead of applications passing data directly to workflow instances, which may or may not even be in memory, the data is passed to a workflow queue. WorkflowQueueingService allows the creation and deletion of WorkflowQueue instances.

This chapter also introduced the concept of event activities. Event activities rely on input from the outside world to complete. The prime example of this type of activity is the out-of-the-box HandleExternalEvent activity. An example activity that blocks workflow execution until an e-mail arrives was developed to illustrate programming concepts related to event activities. This activity implements the IEventActivity interface, which allows it to be used in other event-specific activities, such as EventDriven and Listen. In addition, special considerations were made to ensure that it would execute correctly outside one of these activities.



Professional Windows Workflow Foundation
Professional Windows Workflow Foundation
ISBN: 0470053860
EAN: 2147483647
Year: 2004
Pages: 118
Authors: Todd Kitta

Similar book on Amazon
Pro WF: Windows Workflow in .NET 4 (Expert's Voice in .NET)
Pro WF: Windows Workflow in .NET 4 (Expert's Voice in .NET)
Pro WF: Windows Workflow in NET 3.5 (Expert's Voice in .NET)
Pro WF: Windows Workflow in NET 3.5 (Expert's Voice in .NET)
Microsoft  Windows  Workflow Foundation Step by Step (Microsoft Windows Step by Step)
Microsoft Windows Workflow Foundation Step by Step (Microsoft Windows Step by Step)
Essential Windows Workflow Foundation
Essential Windows Workflow Foundation

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net