R – Workflow persistence – WebServiceInputActivity

persistenceworkflow-foundation

alt text http://home.elka.pw.edu.pl/~pkolodzi/Capture.PNG

I have created the IAdder interface with two methods: PassA and PassB. My workflow starts with webServiceInputActivity1 which is activated by PassA remote call. Another element in my workflow is another webServiceInputActivity2 element. This time the "IsActivating" property is set to false. I expect my workflow to be persisted after first activity finishes (which does return void). The workflow should be reactivated by calling PassB web method.

After publishing workflow as web service and invoking PassA here is what I get:

    System.InvalidOperationException: Workflow with id "b0c5f9dd-57f3-427f-b172-17d4663f7eaf" not found in state persistence store.
   at System.Workflow.Runtime.Hosting.PersistenceDBAccessor.RetrieveInstanceState(Guid instanceStateId, Guid ownerId, DateTime timeout)
   at System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService.LoadWorkflowInstanceState(Guid id)
   at System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance)
   at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext context, WorkflowInstance workflowInstance)
   at System.Workflow.Runtime.WorkflowRuntime.GetWorkflow(Guid instanceId)
   at System.Workflow.Activities.WorkflowWebService.Invoke(Type interfaceType, String methodName, Boolean isActivation, Object[] parameters)
   at PersistanceWebServiceWorkflow.Workflow1_WebService.PassA(Int32 a) in C:\Users\djpiter\AppData\Local\Temp\2dnwfnsn.cs:line 39

Do you have any ideas what I do wrong?

ps:( The database is properly set. I tested it on workflow hosted in console app and delay activity .I also added necessary line to web.config file. )

Kind Regards
PK

Best Answer

If one of your activities would throw an exception, the workflow state information would be deleted from the database. Run your workflow debugger with "break when exception is throw" configured in Debug - Exceptions - Common Language Runtime Exceptions