WCSF & PageFlow & View Presenter pattern

Topics: User Forum
Jan 21, 2007 at 11:22 PM
I've got a project where I am using the WCSF View-Presenter pattern as well as Pageflow.

This is the current situation:

- SQL Server Express 2005
- Visual Studio 2005

The Pageflow samples work fine, however neither example combines View-Presenter pattern with Pageflow

My own project which uses View-Presenter pattern with PageFlow crashes with the following error:

Workflow with id "9e1367da-e830-4238-ba18-38ea73bd6f68" not found in state persistence store.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Workflow with id "9e1367da-e830-4238-ba18-38ea73bd6f68" not found in state persistence store.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

InvalidOperationException: Workflow with id "9e1367da-e830-4238-ba18-38ea73bd6f68" not found in state persistence store.
System.Workflow.Runtime.Hosting.PersistenceDBAccessor.RetrieveInstanceState(Guid instanceStateId, Guid ownerId, DateTime timeout) +1769
System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService.LoadWorkflowInstanceState(Guid id) +373
System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance) +980
System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext context, WorkflowInstance workflowInstance) +424
System.Workflow.Runtime.WorkflowRuntime.GetWorkflow(Guid instanceId) +301
Microsoft.Practices.PageFlow.WorkflowFoundation.WorkflowFoundationPageFlowFactory.GetPageFlow(Type pageFlowType, Guid instanceId) +102
Microsoft.Practices.PageFlow.WorkflowFoundation.WorkflowFoundationPageFlowProvider.GetPageFlow(Type pageFlowType, Guid instanceId) +63
Microsoft.Practices.PageFlow.WorkflowFoundation.WorkflowFoundationPageFlowProvider.GetPageFlow(Guid instanceId) +265
Microsoft.Practices.PageFlow.WorkflowFoundation.WorkflowFoundationPageFlowProvider.ProcessRequest(String url) +189
Microsoft.Practices.PageFlow.PageFlowHttpModule.ProcessRequest(HttpRequest request) +117
Microsoft.Practices.PageFlow.PageFlowHttpModule.OnPostAcquireRequestState(Object sender, EventArgs e) +55
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +167
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +117

I've been through comparing config files between my project and the quickstart projects and my webconfig is setup correctly.

The crash happens when I call the _myPageFlow.Next() method.

Any help would be much appresiated.

Source code project is available if required.

Has anyone come accross this error and
Jan 22, 2007 at 12:14 AM
Further to the above error:

Reference implementation comes closest to my implementation in that it uses View - presenter and PageFlow, however the InstanceStore table is not used, so I presume that Custom Data is not used.

My implementation uses View-Presenter, PageFlow and Userdata, and that seems to cause the crash.

Jan 22, 2007 at 12:18 AM
Correction: The Reference Implementation actually uses UserData.
Jan 22, 2007 at 8:42 AM
I had some problems when I re-used the same databases for my own demo as those created for the quickstarts etc - just to get up and running as quickly as possible.

Are you using completely fresh databases?

Jan 22, 2007 at 9:35 PM
Hi Simon,

If you mean whether the database is empty, than yes, I delete all records between runs.

I have found one other difference between the reference implementation and my test project. In the reference implementation pageflow and UI view-presenter classes reside in the same assembly.

In my test project the pageflow classes and the view-presenter classes are in different assemblies. Don't know yet if this is significant other than that the reference implementation works and my test project doesn't.

What is your setup ?

Jan 23, 2007 at 3:19 AM
That error typically appears when you have a page flow instance stored in the page flow instance store that doesn't exist in the WF state persistence store. So when you run the application, the HttpModule of the Page Flow block thinks that there is a page flow instance suspended that has to be suspended and it fails because it doesn't exist in the page flow state data base.
Did you clean up both page flow tables, the pageFlow_InstanceStore and InstanceState?

Mariano Szklanny
Jan 23, 2007 at 3:21 AM
I forgot: apart from the Reference Implementation, you can also see the Page Flow Quickstart for an example implementation of the View-presenter pattern with page flow.

Mariano Szklanny
Jan 24, 2007 at 4:46 AM
Hi Mariano,

Yes, I empty the tables ofter every run.
Yes, the pageflow quickstart replicates my project setup. I've even changed my project to match as closely as possible the pageflow quickstart, but I am still getting the same exception.

Any help would be much appreciated.

Aug 26, 2011 at 4:52 PM

Hi Mariano/Everybody,

This thread is a bit old but I recently picked up the PageFlow module to use in a WCSF 2008 project I'm doing and I'm running into the same issue.

My questions/issues are:

  1. Why do I have to empty out the pageFlow_InstanceStore and InstanceState tables every time? Do I do this after calling complete on the pageflow? Do I delete all the data for every workflow or just the context user's data? This sounds a bit confusing?
  2. The reference implementation, pageflow with WCSF doesnt clean out the tables. So why should I?
  3. Where is the page flow instance store and where is the WF state persistence store



Aug 30, 2011 at 4:08 PM
Edited Aug 30, 2011 at 4:08 PM


You might find the following resources useful, as they deal with scenarios similar with the one in this thread:

I hope you find this helpful.

Guido Leandro Maliandi