Search Wiki:
Resource Page Description
This library enabled the use of SQL Server Compact edition as the data store for workflow persistence.

This project uses LINQ to SQL as the data access technology. Although the main point of this project is to use SQL Server Compact edition as the database using LINQ to SLQ means it could equally well be used with a full SQL Server edition. The datbase schema is slightly different to the default Workflow Foundation persistence database used. The main difference is that no provision is made or an owner or an ownedUntill as I consider this less than useful with SQL Server Compact as this is a local in process database and not really meant as a shared database.

Sample usage:
   static void Main(string[] args)
   {
       using(WorkflowRuntime workflowRuntime = new WorkflowRuntime())
       {
           string connectionStr = @"Data Source=WorkflowPersistenceDatabase.sdf";
   
           SqlCeWorkflowPersistenceService persistence = new SqlCeWorkflowPersistenceService(connectionStr, true);
           workflowRuntime.AddService(persistence);
   
           workflowRuntime.WorkflowTerminated += delegate(object sender, WorkflowTerminatedEventArgs e)
           {
               Console.WriteLine(e.Exception.Message);
           };
   
           WorkflowInstance instance = workflowRuntime.CreateWorkflow(typeof(TestClient.Workflow1));
           instance.Start();
   
           Console.WriteLine("Done...");
           Console.ReadLine();
       }
   }
Last edited Apr 10 2008 at 2:11 PM  by Maurice, version 8
Comments
Maurice wrote  Jul 21 2008 at 2:39 PM  
Added additional error handling when a workflow is reloaded from the persistence store but cannot be deserialized for some reason. The WorkflowRuntime ServicesExceptionNotHandled event will now be raised with the original exception and the workflow instance id of the offending workflow. The workflow itself is left as is so you will still need to decide what to do with the error and take the appropriate action.

Maurice wrote  Jul 28 2008 at 10:49 PM  
On using the SqlCeWorkflowPersistenceService and SQL Compact 3.5 on a 64 bits Windows.

The sample/test application is set to the default of "Any CPU". The result is that the LINQ provider cannot load the runtime and a InvalidOperationException with message "Cannot open 'WorkflowPersistenceDatabase.sdf'. Provider 'System.Data.SqlServerCe.3.5' not installed." is the result. Now the fix is rather easy but it has to be done in the main program and that is to compile it for X86 instead of Any CPU.

Maurice wrote  Nov 12 2008 at 4:49 PM  
As noted in by Matt in the comments there is, as of .NET 3.5 SP1, a 64 bits version available of SqlCe. You can download it from: http://www.microsoft.com/downloads/details.aspx?FamilyId=DC614AEE-7E1C-4881-9C32-3A6CE53384D9&displaylang=en.

Updating...
Page view tracker