The Workflow Runtime


In order to start a workflow, it is necessary to create an instance of the WorkflowRuntime class. This is typically done once within your application, and this object is usually defined as a static member of the application so that it can be accessed anywhere within the app.

When you start the runtime, it can then reload any workflow instances that were executing the last time the application was executed by reading these instances from the persistence store. This uses a service called the persistence service, which is defined later in this section.

The runtime contains methods to construct instances of workflows - there are six various CreateWorkflow methods that can be used to construct workflow instances, and the runtime also contains methods for reloading a workflow instance and enumerating all running instances.

The runtime also has a number of events that are raised while workflows are executing - such as WorkflowCreated (raised when a new workflow instance is constructed), WorkflowIdled (raised when a workflow is awaiting input such as in the expense-processing example shown earlier), and WorkflowCompleted (raised when a workflow has finished).




Professional C# 2005 with .NET 3.0
Professional C# 2005 with .NET 3.0
ISBN: 470124725
EAN: N/A
Year: 2007
Pages: 427

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