Loading persisted workflow after workflowdefinition has changed in WF4

Posted by Flores on Stack Overflow See other posts from Stack Overflow or by Flores
Published on 2010-01-14T13:59:36Z Indexed on 2010/04/07 9:53 UTC
Read the original article Hit count: 704

How to solve this problem (in WF4):

I create a workflow in xaml and start several instances of it, I have a persistancestore and all workflows persist on a bookmark half way their workflow.

Now I stop the application

If I restart te application everything is resumed, en nicely completes.

But what if I want to change the workflow definition after the running instances persist? the only way to load the running workflows (that I was able to find) is the following way:

        WorkflowApplication wfapp = new WorkflowApplication(new WorkflowDefinition());
        wfapp.InstanceStore = new SqlWorkflowInstanceStore(connStr);

        wfapp.Load(wfGuid);

So you need the workflow definition, if it has changed during the persistance, things go horribly wrong.

What is the best way to solve this?

© Stack Overflow or respective owner

Related posts about workflow-foundation-4

Related posts about workflow-foundation