Using this MSDN article as an example for pausing and resuming, one would suggest that it would be quite simple. This is how I pause the workflow ...
LastWfGuid = workflow.Id;
workflow.Unload();
Quite simply, it should be stored in the instance store (which I already set before these two lines), and I see the entries in the Instance and InstancesTable views. When I am ready to resume the workflow, I do this ...
workflow = new WorkflowApplication( myActivity, myWfArgs );
workflow.InstanceStore = wfStore;
workflow.Load(LastWfGuid);
At this point, I am getting InvalidOperationExceptionan exception message ...
Workflow inputs cannot be used with Load or LoadRunnableInstance, since they are only provided to new instances.
If I cannot load a workflow that was previously saved, how can I resume it? I tried just downloading Persist()instead Unload(), and from the outside it looks fine, and I get no exception. But the workflow continues to work on this course, and this is not what I'm looking for. I want to pause and then resume my workflow.
source
share