locked
Creating Dynamic Workflows - Handling the persisted instance RRS feed

  • Question

  • Hi,

    I am creating workflows dynamically for each project based on the tasks defined for projects in database.  Its working fine as long as i don't modify the tasks for any project like adding new task and removing the existing task for the workflow tree for a project. When I make changes to the workflow tree that time I see error msg like 'workflow tree is not matching with persisted instance'.

    To make it more clear:

    1. I am creating workflow pro-grammatically based on the tasks defined in database for a project.

    2. During the execution of project, I am adding new task or removing task from the that particular project in database

    3. When i resume and load the instance with new modified workflow tree schema, it throws error.

    My Question is :

     How can i handle such situation with same instance ID?

    Regards,

    Mahendra

    Monday, August 13, 2012 7:05 AM

Answers

  • Hi Mahendra, are you using WF 4.0 or 4.5?

    On 4.0 you must keep the instance-specific workflow "definition" along with the persisted instances of that definition. We do that by tracking definition snapshots on our own table and associating the definition on-the-fly when loading the instance from the persistence store.

    There is no easy way to "migrate" an existing and persisted workflow into another one on this version.

    Version 4.5 introduces version management and migration (dynamic update), please look at this article.

    http://msdn.microsoft.com/en-us/library/hh314054(v=vs.110).aspx

    Hope it helps,

    Cheers

    Adriano


    Adriano


    Tuesday, August 14, 2012 7:18 AM

All replies

  • Hi Mahendra, are you using WF 4.0 or 4.5?

    On 4.0 you must keep the instance-specific workflow "definition" along with the persisted instances of that definition. We do that by tracking definition snapshots on our own table and associating the definition on-the-fly when loading the instance from the persistence store.

    There is no easy way to "migrate" an existing and persisted workflow into another one on this version.

    Version 4.5 introduces version management and migration (dynamic update), please look at this article.

    http://msdn.microsoft.com/en-us/library/hh314054(v=vs.110).aspx

    Hope it helps,

    Cheers

    Adriano


    Adriano


    Tuesday, August 14, 2012 7:18 AM
  • HI Mahendra

                Even I am trying to work on dynamic workflow 4.0, can you provide me some solution design on dynamic workflow as I am new to WF, I don't have enough knowledge on the same.


    • Edited by shidh Monday, March 11, 2013 6:43 PM
    Monday, March 11, 2013 6:35 PM