Unanswered SqlWorkflowInstanceStore is not working

  • Wednesday, February 22, 2012 4:07 PM
     
      Has Code

    I am trying to use SqlWorkflowInstanceStore to presist data.  I fellew http://msdn.microsoft.com/en-us/library/dd489452.aspx to implement the presist data logic.  For some reasons, the data is not presisted in the InstancesTable table.  There is only an entry created in the LockOwnersTable table.  Does anyone know if I miss anything?

    Here is the code snippets:

                DynamicActivity act = ActivityXamlServices.Load(Path) as DynamicActivity;
    
                IDictionary<string, object=""> inputs = new Dictionary<string, object="">();
                inputs.Add("Request", request);
                inputs.Add("Response", response);
    
                AutoResetEvent idleEvent = new AutoResetEvent(false);
    
                WorkflowApplication wfApp = new WorkflowApplication(act, inputs);
    
                SqlWorkflowInstanceStore store = new SqlWorkflowInstanceStore(request.InstanceStoreConnectionString);
                wfApp.InstanceStore = store;
    
                TransitionExtension transExt = new TransitionExtension();
                wfApp.Extensions.Add(transExt);
    
                wfApp.PersistableIdle = delegate(WorkflowApplicationIdleEventArgs e)
                {
                    response.CurrentState = transExt.CurrentState;
                    response.Bookmark = transExt.Bookmark;
                    idleEvent.Set();
                    return PersistableIdleAction.Unload;
                };
    
                wfApp.Completed = delegate(WorkflowApplicationCompletedEventArgs e)
                {
    
                    response = (WorkflowResponse)(e.Outputs["Response"]);
                    idleEvent.Set();
                };
    
                wfApp.Run();
    
                idleEvent.WaitOne();</string,></string,>

    Thank you so much for your help!



    • Edited by Wai C Wednesday, February 22, 2012 4:08 PM
    •  

All Replies

  • Wednesday, February 22, 2012 7:22 PM
     
     
    I actually find that if I set one of the properties of the Request object to null, it works.  I am thinking that object cannot be serialized.  I am wondering if there is a way I can debug SqlWorkflowInstanceStore, so I know what really cause that.