none
Change or Restart Workflow and Skip to Workflow RRS feed

  • Question

  • You have the option in server settings to "Restart current workflow for the selected projects", with the choices of skipping to current workflow stage or to a particular workflow stage. Using a new 2013 project server workflow neither of these choices work. The project in each case is returned to the very first workflow stage.

    Is this a bug or badly designed workflow?

    Is this also the case with legacy 2010 workflows?

    rgds

    Mike


    Mike Mahoney

    • Changed type Sleekstone Sunday, March 3, 2013 3:39 PM asked and answered
    Wednesday, February 27, 2013 12:32 PM

Answers

  • Mike,

    Thanks to John on the Product Team, I think I can explain what is going on.

    I am going to assume you have a workflow similar to the one below? Some simple logic, a wait event and a transition or some type.

    As the workflow progresses in the above case, it will log a message out, then wait for the submit button to be pressed before transitioning.  If you try to use the Change / Restart workflow function and choose Restart  > Skip to Stage 3, what you will see is the workflow restart, log Stage 1 to the history list, and then wait for input. There is no skipping through as the workflow is waiting for the event.

    The new workflows, whilst allowing looping etc, are essentially still sequential in nature, so to skip though the various stages, they need to start at the beginning and then progress through the stages depending on the logic in the stage transitions.

    Just like in 2010, to get something to progress, you need to introduce some special 'Skip to Stage' logic (for want of a better phrase), with this logic, you can tell the workflow 'If the workflow is being run normally, or restarts the workflow and includes this stage' execute the actions within. This is achieved by using the 'Include Stage' condition I mentioned in a post above.  In the example below, I have wrapped the logging and the Wait for submitted event in an 'Include Stage' action (and added some extra logging)

    Now when this workflow runs normally, it will go through and execute everything, including the bits inside the 'Include Stage' action because the workflow was started normally (as in the name). 

    However, if I choose to restart > Skip to Stage 3 for instance, the workflow will realise it is in 'Skip to Stage' mode and not execute anything in the 'Include Stage' action as the workflow is not being run normally, nor is that stage included (we are skipping to Stage 3). As the Wait for Submit is not executed, the workflow will not wait for the submit button to be pressed and progress without issue to the desired stage. From a logging perspective, you should see something like 'Stage 1 > Leaving Stage 1 > Stage 2 > Leaving Stage 2 > Stage 3 > Included Stage 3.

    It took some time, but I hope that explains what your seeing. If it doesn't, well it does give a good overview of how to use Skip to Stage logic in 2013 workflows.


    Alex Burton
    www.epmsource.com | Twitter
    Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page

    • Marked as answer by Sleekstone Sunday, March 3, 2013 3:40 PM
    Friday, March 1, 2013 6:11 AM
    Moderator

All replies

  • Hi,

    The change / restart capability will only skip through to a stage if all the required fields for the stage have been completed. 

    If the workflows you build also have approvals etc that you may wish to bypass, you need to define special skip to stage logic to bypass those approvals. In 2013 that skip to stage logic is defined in the stage transitions. 


    Alex Burton
    www.epmsource.com | Twitter
    Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page

    Thursday, February 28, 2013 3:36 AM
    Moderator
  • Hi Alex

    Thanks for the input.

    In my examples all required fields have been populated.

    I have a limited understanding of Sharepoint Designer 2013 which I am using to build the workflow but I did have the understanding that for 2013 project server workflow:

    1) It does not have to be sequential

    2) At any stage I can "Go to" any other stage or in fact loop back to start of existing stage.

    So I don't understand your comment about the need  " to define skip to stage logic to bypass those approvals"

    My expectation of this capability is simply to rewind a workflow to an earlier stage because of misapproval ot other snafu. At the moment Project Server prompts me to select a stage but always returns me to the start, ignoring my selection.

    rgds

    Mike


    Mike Mahoney

    Thursday, February 28, 2013 11:04 AM
  • Hi,

    To answer your points:

    1. Your correct, it doesn't have to be.

    2. Correct, using the stage transitions

    3. In 2010 workflows you had to code up for the Skip to Stage context, the workflow would sequentially progress until it hit the stage it was skipping to. If you had skip to stage logic, you could set a bypass to skip around that particular bit. 

    Getting back to your question at hand, I have been playing with SPD + the new model workflows in 2013 and can't seem to get it to skip to the chosen stage. I am seeing the same behaviour. I am wondering if the 'If Project Web App starts the workflow normally or restarts the workflow and includes this stage' transition option has some part to play, but can't get my head around that at the moment, I will have a play over the weekend and report back.


    Alex Burton
    www.epmsource.com | Twitter
    Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page

    Thursday, February 28, 2013 11:36 PM
    Moderator
  • Mike,

    Thanks to John on the Product Team, I think I can explain what is going on.

    I am going to assume you have a workflow similar to the one below? Some simple logic, a wait event and a transition or some type.

    As the workflow progresses in the above case, it will log a message out, then wait for the submit button to be pressed before transitioning.  If you try to use the Change / Restart workflow function and choose Restart  > Skip to Stage 3, what you will see is the workflow restart, log Stage 1 to the history list, and then wait for input. There is no skipping through as the workflow is waiting for the event.

    The new workflows, whilst allowing looping etc, are essentially still sequential in nature, so to skip though the various stages, they need to start at the beginning and then progress through the stages depending on the logic in the stage transitions.

    Just like in 2010, to get something to progress, you need to introduce some special 'Skip to Stage' logic (for want of a better phrase), with this logic, you can tell the workflow 'If the workflow is being run normally, or restarts the workflow and includes this stage' execute the actions within. This is achieved by using the 'Include Stage' condition I mentioned in a post above.  In the example below, I have wrapped the logging and the Wait for submitted event in an 'Include Stage' action (and added some extra logging)

    Now when this workflow runs normally, it will go through and execute everything, including the bits inside the 'Include Stage' action because the workflow was started normally (as in the name). 

    However, if I choose to restart > Skip to Stage 3 for instance, the workflow will realise it is in 'Skip to Stage' mode and not execute anything in the 'Include Stage' action as the workflow is not being run normally, nor is that stage included (we are skipping to Stage 3). As the Wait for Submit is not executed, the workflow will not wait for the submit button to be pressed and progress without issue to the desired stage. From a logging perspective, you should see something like 'Stage 1 > Leaving Stage 1 > Stage 2 > Leaving Stage 2 > Stage 3 > Included Stage 3.

    It took some time, but I hope that explains what your seeing. If it doesn't, well it does give a good overview of how to use Skip to Stage logic in 2013 workflows.


    Alex Burton
    www.epmsource.com | Twitter
    Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page

    • Marked as answer by Sleekstone Sunday, March 3, 2013 3:40 PM
    Friday, March 1, 2013 6:11 AM
    Moderator
  • Hi Alex

    A brilliant answer though clearly adds complexity to the work flow I had hoped it would be as simple as it looks.

    I have yet to try it out so will get back to you.

    rgds

    Mike


    Mike Mahoney

    Friday, March 1, 2013 10:44 AM
  • Hi Alex

    I have finally looked at this and at your recommendation is perfect. There are two areas of frustration however. I would have expected the skip to stage ability to be a default rather than necessitating wrapping each stage with an "include this stage" condition. Equally the reset stage option is unaware whether this codition is present and offers all stages to the user allowing the user to pick to which he can not navigate.

    My other beef is that in the googleverse (or should that be Bingdom) I cannot find any documentation on this condition (include this stage). So your help is much appreciated.

    rgds

    Mike


    Mike Mahoney

    Sunday, March 3, 2013 3:54 PM
  • Hello Guys,

    How to achieve the same functionality through Visual studio. There is no activity available in Visual studio similar to Sharepoint designer.


    manikantan

    Tuesday, January 6, 2015 6:23 PM