![]() ![]() | ||||
HomeShow ChangesEditPrintRecent ChangesSubscriptionsLost and FoundFind ReferencesRename
History | One of the main advantages is ClickOnce deployment. In the case of the standard SqlWorkflowPersistenceService you need to have SQL Server installed and running and create the database, with a name of your choosing, using two scripts. Not a big problem but something that needs to be done first and is outside of the realm of what you would like to do with ClickOnce. Not so with SQL Server Compact. No with SqlCe you can just deploy a number of DLL's with your application and you are ready to go, so much easier and very ClickOnce compatible [ I actually did all the data access using LINQ to SQL which fully supports SqlCe as a client. It might appear not to as there is no designer support like with SQL Server itself but runtime it works just fine [ Imports TheProblemSolver.Workflow.Hosting.Persistence Module Module1 Class Program Shared Sub Main() Using workflowRuntime As New WorkflowRuntime() Dim connectionStr As String = "Data Source=WorkflowPersistenceDatabase.sdf" Dim unloadOnIdle As Boolean = True Dim loadingInterval As TimeSpan = TimeSpan.FromSeconds(15) Dim persistence As New SqlCeWorkflowPersistenceService(connectionStr, _ unloadOnIdle, _ loadingInterval) workflowRuntime.AddService(persistence) Dim workflowInstance As WorkflowInstance workflowInstance = workflowRuntime.CreateWorkflow(GetType(Workflow1)) workflowInstance.Start() Console.WriteLine("Press enter to stop...") Console.ReadLine() End Using End Sub End Class End Module Usage is real simple and pretty much the same as the standard SqlWorkflowPersistenceService type. The only extra is to set a reference to the TheProblemSolver.Workflow.Hosting.Persistence.dll that includes the SqlCeWorkflowPersistenceService type. using System; using System.Workflow.Runtime; using TheProblemSolver.Workflow.Hosting.Persistence; namespace TestClient { class Program { static void Main(string[] args) { using (WorkflowRuntime workflowRuntime = new WorkflowRuntime()) { string connectionStr = @"Data Source=WorkflowPersistenceDatabase.sdf"; bool unloadOnIdle = true; TimeSpan loadingInterval = TimeSpan.FromSeconds(15); SqlCeWorkflowPersistenceService persistence = new SqlCeWorkflowPersistenceService(connectionStr, unloadOnIdle, loadingInterval); workflowRuntime.AddService(persistence); WorkflowInstance instance = workflowRuntime.CreateWorkflow(typeof(Workflow1)); instance.Start(); Console.WriteLine("Press enter to stop..."); Console.ReadLine(); } } } } If you want to download the SqlCeWorkflowPersistenceService you can find it here http://code.msdn.microsoft.com/SqlCeWFPersistence | Wiki Usage
This wiki site is supposed to be a shared resource. As a shared resource everyone is encouraged to add new content or modify existing content! Enjoy the WF wiki. Recent Topics | ||