Loading a persisted workflow from the database
Developing long-running applications is one goal of WF4, and resuming a persisted workflow from the database is the key to long-running applications. In this task, we will create a Sequence workflow with a Delay activity. The workflow will be persisted when it is idle. We then press the Enter key and then the workflow will be resumed and will run until its end.
Getting ready
The SQL workflow instance store needs to be already in use. We can refer the Configuring the SQL persistence store section of this chapter.
How to do it...
Create a workflow project:
Create a new Workflow Console Application under solution
Chapter06
and name the project asLoadingUpWorkflowFromPersistenceDB
.Create a workflow:
Open the
Workflow1.xaml
file, which is created by default, and create a simple workflow with aDelay
activity.Set the
Duration
property ofDelay
activity to 1 second. Once the Delay activity is executed, the workflow will become idle and the whole...