Search This Blog

Friday, December 10, 2010

Windows Workflow 4.0

Using Persistence Services Sample

Check this link below


Custom Persistence Service Sample

Check this link below

SQL Workflow Instance Store


 
One thing I've noticed is that if I persist a Workflow in the SQL Database persistence store, and then load it back into the application later and complete the workflow, the record is removed from the persistence store when the last activity of the workflow completes. I need to find out if this functionality is by design to keep the database from getting huge, or if I'm doing something wrong.

This delete behavior is configurable. For example, if you are using the WorkflowServiceHost and are using code to configure your service host, you could set the SqlWorkflowInstanceStoreBehavior.InstanceCompletionAction to InstanceCompletionAction.DeleteNothing as in the following example:

WorkflowServiceHost host = new WorkflowServiceHost(workflow, baseAddress);
SqlWorkflowInstanceStoreBehavior persistenceBehavior = new SqlWorkflowInstanceStoreBehavior(connString);
persistenceBehavior.InstanceCompletionAction = InstanceCompletionAction.DeleteNothing;
host.Description.Behaviors.Add(persistenceBehavior);
 
For more information on features of the SQL workflow instance store and how you can configure it, check out this MSDN article.

No comments: