Sep 21, 2008

Adding Workflow persistence service

This can be done programatically or declaratively. Below is section of code that do it programtically.

            private static void AddServices(WorkflowRuntime instance)
            {
            String connStringPersistence = String.Format(
            "Initial Catalog={0};Data Source={1};Integrated Security={2};",
            "workflow", @".", "SSPI");

            instance.AddService(
            new SqlWorkflowPersistenceService(connStringPersistence, true,
            new TimeSpan(0, 2, 0), new TimeSpan(0, 0, 5)));
            }
            

To do it declaratively, you need to change your code and the configuration file as well. Here is a section of code

//here you use a constructor to specify the configSectionName WorkflowRuntime runtime = new WorkflowRuntime("WorkflowRuntime")

You should add you configsection in the config file. Please note that the name of the section does not necessary to be "WorkflowRuntime"