File-based Workflow persistence service

I was talking exactly about this some days ago and, after a bit searching, here's the solution (thanks to Zhisheng Huang).

Windows Workflow comes with SQL persistence as the way to persistence a workflow instance, but sometimes having a simple file-based persistence could be interesting. This solution does exactly this...

To use it, simply add the service to the runtime. 

FileWorkFlowPersistenceService fServ = new FileWorkFlowPersistenceService(".");
workflowRuntime.AddService(fServ);

UnloadOnIdle returns true always in the implementation. So you can see that the workflow is persisted after each call when it becomes idled if you hook up the appropriate event:

workflowRuntime.WorkflowPersisted += delegate
{
       Console.WriteLine("Workflow persisted");
};

 

Attachment(s): FileWorkFlowPersistenceService.cs

Print | posted on Saturday, December 02, 2006 11:03 AM

Comments on this post

No comments posted yet.

Your comment:

 (will show your gravatar)
 
Please add 6 and 2 and type the answer here: