locked
Can a running workflow have multiple states persisted RRS feed

  • Question

  • I understand two common way to persist a running workflow is 1. Create a bookmark 2. Use Persist activity.

    My question is can a running workflow be persisted at a number of different points through its lifecycle.

    To my humble knowledge of the windows workflow 4, it appears to me:

    1. I can create multiple bookmarks. and then use WorkflowApplication.Load(workflowInstanceId) and WorkflowApplication.ResumeBookmark to load any bookmarked state back.

    2. Using Persist activity will delete the previous state presisted by Persist activity

    Are those two points correct?

    Thanks.


    Life is simple.


    • Edited by Firen Tuesday, August 30, 2011 4:25 PM
    Tuesday, August 30, 2011 3:26 PM

Answers

  • Hi,

    As per my knowledge.

    If the workflow is persisted using bookmark , you need to resume the workflow using correct bookmark with which the worklow is persisted.

    in other case while using persist activity you don;t have to resume the worklow using bookmark.

    One more point.

    You can create multiple bookmarks (using different bookmarks names) to persist the workflow in workflow life cycle. (like in parallel activity you can create different bookmark in each branch e.g. "Firstbranch" , "SecondBranch") .

    now you can resume workflow using "Firstbranch" or  "SecondBranch".

    hope this would clerify things.

     

    Regards,

    Madhur


    MB
    • Proposed as answer by MadhurBhardwaj Wednesday, August 31, 2011 11:19 AM
    • Marked as answer by Firen Wednesday, August 31, 2011 2:15 PM
    Wednesday, August 31, 2011 11:19 AM

All replies

  • My understanding may not be more complete than yours, but it a bit different:

     

    A workflow can have multiple potential persist points (bookmark creation,or persist point).  When the workflow is persisted one and only one of the potential persist points is realized.  That is the state that is stored.  In order to successfully "restart" the workflow after loading you will have to resume the correct bookmark.

    Tuesday, August 30, 2011 3:51 PM
  • Thanks Frank.

    So each running workflow can only have one persisted state stored in the DB, regardless of how it gets created (either by bookmark or Persist activity)..

    'In order to successfully "restart" the workflow after loading you will have to resume the correct bookmark'

    -> this is probably not true..I tried to use 'Persist' Activity without creating a bookmark and the workflow can be reloaded fine..


    Life is simple.
    Tuesday, August 30, 2011 4:30 PM
  • Thanks for the info..mind you in my re host I am taking away "Persist" as an unneeded complication for my users :D
    Tuesday, August 30, 2011 5:05 PM
  • Hi,

    As per my knowledge.

    If the workflow is persisted using bookmark , you need to resume the workflow using correct bookmark with which the worklow is persisted.

    in other case while using persist activity you don;t have to resume the worklow using bookmark.

    One more point.

    You can create multiple bookmarks (using different bookmarks names) to persist the workflow in workflow life cycle. (like in parallel activity you can create different bookmark in each branch e.g. "Firstbranch" , "SecondBranch") .

    now you can resume workflow using "Firstbranch" or  "SecondBranch".

    hope this would clerify things.

     

    Regards,

    Madhur


    MB
    • Proposed as answer by MadhurBhardwaj Wednesday, August 31, 2011 11:19 AM
    • Marked as answer by Firen Wednesday, August 31, 2011 2:15 PM
    Wednesday, August 31, 2011 11:19 AM
  • Thanks Madhur,

    What if I use Persist activity multiple times through the workflow life cycle, presumably any following persist will always wipe out the previous state, is this correct?


    Life is simple.
    Wednesday, August 31, 2011 2:15 PM
  • I think so. YES


    MB
    • Proposed as answer by MadhurBhardwaj Wednesday, August 31, 2011 2:38 PM
    Wednesday, August 31, 2011 2:38 PM