locked
Moving backward in a workflow RRS feed

  • Question

  • In our particular business process, there are many parallel activities.  Within those activities, a business owner may cancel out of the process or the process may cease to require some parallel activites due to changes in plans.  I would like to represent this in a workflow.  Todate, all but the custom activities are maintained in xamlx.

    I have a parent workflow that calls a parallel activity. Within the parallel activity, there are 7 branches. Each branch has an top level "if" for which an "if" can receive a bypas value that essentially keeps a long-running series of send/receive activities from having to run.  If the branch is not bypassed due to an automated response to that branch, the branch issues sends and expects to receive information in order for it to complete.  When all 7 parallel activities receive their information (or bypass values), the workflow continues.

    What I would like to be able to accomplish within any parallel activity, is that if at any time, the 7 parallel activities are not completed, any of the 7 branches can move back to their individual beginning and have an automated bypass rather than waiting for a response. That is, I would like to be able to wipe out the bookmarks and persistenace of an existing activity within the larger workflow, and start that activity over again.  At this point, I have not found a good method of accomplishing this. 

    The long-running "receives" in the parallel activities do not have CanCreateInstance, but instead use correlation.

    Do you have suggestions?

    Thanks in advance,

    Monday, December 27, 2010 9:51 PM

Answers

  • Hi,  Bruce

    ->"That is, I would like to be able to wipe out the bookmarks and persistenace of an existing activity within the larger workflow, and start that activity over again."
    Have you considered using FlowChart? WF4 state machine is also able to complete this job.
    http://wf.codeplex.com/

    Regards
    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    • Marked as answer by Andrew_Zhu Tuesday, January 4, 2011 2:56 AM
    Thursday, December 30, 2010 9:46 AM
  • Andrew -- thank you for the reply.

    I took a look at the State Machine but could not see an "easy" answer with the use of it -- albeit, it may come in handy for other areas. 

    I have solved the problem of allowing an initiater of the workflow to define a few properties on each of the parallel branches -- including multiple receive/respond.  The initiator can (1) exempt individual parallel activites out of the workflow or (2) require the parallel activity to receive only one "receive/response"  or (3)  allow any parallel branch to have multiple "receives/responses" and (4) allow a "cancel" to cancel existing responses within an individual paralllel activity and (5) allow a restart each individual parallel activity. This was accomplished via while loops and "override" Receives within each of the 7 parallel activities of the workflow. 

    The problem that took a while to resolve was to insure that the variables surronding the persistence were scoped at a level of depth allowing that the bookmarking could properly take place without causing an exception. By scoping the persistence at too high a level, a bookmarking could not work. Overally, these properties allow for quite a bit of override of the processes by management.   

    This raises the obvious question: when does the parallel allow for movement out of the activity in order to continue the sequence?  At this point, I persist an overall flag that must have signify that all 7 parallel activities have at least one response, an override "cancel" or an exemption from inclusion.  Now I am just trying to poke holes in the design.

    BTW, thanks so much for writing your book-- Microsoft Windows Workflow Foundation 4.0 Cookbook.  It is a big help for a newbie like me. The book is both broad in scope -- from activities, collections, extensions, hosting, designer....but concise in detail. Very nice!


    bruce chase
    • Marked as answer by Andrew_Zhu Wednesday, January 5, 2011 3:30 AM
    Tuesday, January 4, 2011 7:54 PM

All replies

  • Hi,  Bruce

    ->"That is, I would like to be able to wipe out the bookmarks and persistenace of an existing activity within the larger workflow, and start that activity over again."
    Have you considered using FlowChart? WF4 state machine is also able to complete this job.
    http://wf.codeplex.com/

    Regards
    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    • Marked as answer by Andrew_Zhu Tuesday, January 4, 2011 2:56 AM
    Thursday, December 30, 2010 9:46 AM
  • Andrew -- thank you for the reply.

    I took a look at the State Machine but could not see an "easy" answer with the use of it -- albeit, it may come in handy for other areas. 

    I have solved the problem of allowing an initiater of the workflow to define a few properties on each of the parallel branches -- including multiple receive/respond.  The initiator can (1) exempt individual parallel activites out of the workflow or (2) require the parallel activity to receive only one "receive/response"  or (3)  allow any parallel branch to have multiple "receives/responses" and (4) allow a "cancel" to cancel existing responses within an individual paralllel activity and (5) allow a restart each individual parallel activity. This was accomplished via while loops and "override" Receives within each of the 7 parallel activities of the workflow. 

    The problem that took a while to resolve was to insure that the variables surronding the persistence were scoped at a level of depth allowing that the bookmarking could properly take place without causing an exception. By scoping the persistence at too high a level, a bookmarking could not work. Overally, these properties allow for quite a bit of override of the processes by management.   

    This raises the obvious question: when does the parallel allow for movement out of the activity in order to continue the sequence?  At this point, I persist an overall flag that must have signify that all 7 parallel activities have at least one response, an override "cancel" or an exemption from inclusion.  Now I am just trying to poke holes in the design.

    BTW, thanks so much for writing your book-- Microsoft Windows Workflow Foundation 4.0 Cookbook.  It is a big help for a newbie like me. The book is both broad in scope -- from activities, collections, extensions, hosting, designer....but concise in detail. Very nice!


    bruce chase
    • Marked as answer by Andrew_Zhu Wednesday, January 5, 2011 3:30 AM
    Tuesday, January 4, 2011 7:54 PM
  • Glad to see the book is helpful to you:)


    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    Wednesday, January 5, 2011 3:35 AM