SqlWorkflowInstanceStore is not working
-
יום רביעי 22 פברואר 2012 16:07
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!
- נערך על-ידי Wai C יום רביעי 22 פברואר 2012 16:08
כל התגובות
-
יום רביעי 22 פברואר 2012 19:22I 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.