2

Can someone tell me the best practice for transitioning between stages?

I have two stages: Stage 1 and Stage 2

In Stage 1 I kick off a task process that requests that a bunch of users approve the document. I store the result of this in a variable called complete_level1.

Now, in the Transition to Stage section of Stage 1 do I test that complete_level1 is set to Approved before continuing to Stage 2?

If so, what do I add in the Else section? I can't leave it black, but if I insert Go To Stage 1, it will restart the Task Process and I'm stuck in a loop.

Am I meant to use a Loop on the task process? What if it takes several weeks for all the user to complete the task, is it bad that it will be constantly looping in the meantime?

  • Have you looked at or attempted to modify an Out of the Box 3 stage workflow? – Jammin4CO Mar 8 '16 at 17:32
  • I don't have any workflows available to me in Designer OOTB. I am a SharePoint Online tenant. – Ray Hogan Mar 8 '16 at 17:36
  • It might help to post a screenshot of your stage 1 to show how you are setting up your tasks – Paul Lucas Mar 8 '16 at 19:18
2

NB: I have not actually tried this, my answer is based solely on looking at what options are available in 2013 workflows and specifically Task Processes.

OK, for the purposes of this answer, I am going to assume that you do not want to go on to Stage 2 unless the outcome is Approved.

If you look at a Task Process, there is a section called "Task Options" and another section called "Outcome Options". In "Task Options" there is a checkbox called "Wait for task completion". One of the options for "Completion Criteria" is "Wait for all responses". For "Wait for all responses", the description is:

This option will make the workflow wait until all of the responses have been collected. It will then return the outcome that received the most number of responses. In the event of a tie, the response that was received first will be returned.

So it seems to me you have your solution for waiting for all tasks to be complete right there. By setting that option, the workflow will be paused until all tasks have been completed (even if it takes several weeks), and only then will the task process finish and return a value to your complete_level1 variable.

Now, assuming that you do not want to proceed to Stage 2 unless the outcome is Approved, I would also take a look at the "Outcome Options" section, in particular, the "Default Outcome" setting. I would set this to be Rejected. This way, if there are any errors or problems with the Task Process itself, the outcome returned to your complete_level1 variable will not be a false positive.

Then, yes, in your Transition to stage section of Stage 1, you test your variable. If it is Approved, transition to Stage 2, and if it is not, transition to End of Workflow.

The one problem I see with this approach is that "Wait for all responses" basically chooses the majority outcome. If your requirement for what constitutes approval is that approval must be unanimous, this obviously won't work. However, looking a little deeper, there is another option for "Completion Criteria" called "Wait for a percentage of a response", and the description of that is:

This option will make the workflow wait until a specified percentage of a particular outcome is received. If the required percentage is not achieved, it will return the default outcome.

So, you could set the percentage there to 100% Approved, and then set the default outcome (in the "Outcome Options" section) to Rejected. My assumption (again, I haven't actually tried this) is that if the Task Process is waiting to check for 100% Approval, it will be waiting for all tasks to be completed before being able to make that evaluation, so again, you get that waiting functionality from this setting.


Now, all that being said, if you do not care what the outcome in complete_level1 is, and you deal with whatever the outcome was in Stage 2, then do't check anything in the Transition to Stage section, just go ahead and transition to Stage 2. The "waiting for all tasks to complete" functionality is still being handled by the Task Process itself.

  • Thanks! What I had failed to realize was that the Workflow suspended itself until the tasks were completed. I thought it done a clean sweep, then looped back around ad infinitum, until the it figured out that the tasks completed. Hence why I was incorrectly going back to the start of the workflow. What I've done is set up the task in Stage 1 and in the transition section, tested if it was approved or rejected and then navigate to the appropriate stage based on that. – Ray Hogan Mar 9 '16 at 11:28
1

Because stages don't run in parallel, the workflow won't go to the next stage until the stage completes. To avoid an infinite loop, in your last stage, in the Transition To section select go to End of Workflow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.