How to keep track of the stage in Custom Task Process of SharePoint designer workflow
In this post I want to introduce you a technique to keep track of in which stage you are in. when you are using the Custom Task Process in SharePoint workflow designer, it is very useful to know in which assignment stage you are in and based on that information you can do some customizations, for example you can change the title of individual task, or send the notification emails or other requirements you may have.
In a series of posts, I am describing the different features of Custom Task Process in Microsoft SharePoint designer. You can see a list of link to all posts here.
It is better you first create the simple working example of Custom Task Process in SharePoint designer and then you can check other posts that you are interested in.
Please bear in mind that the technique I am describing here is for the workflow which we are developing through a series of posts. In our example we have a serial approval process between three parties. If you want to change this logic, for example add some parallel steps or have a combination of parallel and serial steps or change the completion criteria of the workflow, you have to tweak this technique to suit your needs.
To develop the Custom Task Process workflow and keep track of the stage, I use SharePoint Designer 2013 with SharePoint Online and SharePoint workflow engine 2010.
First you have to define a new Workflow local variable in your SharePoint designer workflow: varStage
Figure 1 – create a new workflow variable
Then you have to assign the first stage value to the varStage variable.
Figure 2 – prepopulate the varStage workflow local variable
then you have to go to the customization page of the custom task process by clicking on the name of the task process
Figure 3 – custom task process customization page
Then you have to click on the Change the behavior of the single task link in the custom task process customization page.
Figure 4 – click on the behavior of a single task
Then scroll down to the “When a task completes” section and add these criteria:
Figure 5 – criteria to change varStage
By this technique you have the stage of the custom task process in every stage in a local workflow variable called varStage, so you can use it to customize the different aspects of workflow tasks