I recently had a customer ask me how to use the Skip to Stage functionality of Nintex Workflow for Project Server. Now I know I have done a few Nintex posts recently, but I promised them I would post this for the greater good of the EPM community (and will lay off Nintex for the next few months).
In case your not aware, the Skip to Stage capability of Project Server allows an administrator to skip a workflow to a particular stage, usually as a result of modifying the existing workflow, or swapping to a different workflow and needing to skip over some of the business logic or steps.
Sam Chung wrote an excellent blog post on this over at the Project Programmability blog back in February 2010, and the same concepts apply to Nintex. Consider the flow chart below which outlines a simple Project Server workflow scenario.
Should the administrator wish to skip this workflow to the the execution stage, and skip the approval, it is not possible as the workflow has not been coded to allow it. This is where the Skip To Stage information comes into play. When an administrator chooses to skip to a specific stage using the Server Settings > Change or Restart a workflow, the workflow is initiated with two pieces of information:
- the Skip To Stage parameter set to ‘True’;
- the Stage UID of the desired stage to skip to is passed through.
In the workflow, if logic is added to check for this, then it is possible to bypass the business logic for the stage and skip over. The Project Server workflow engine is clever enough to determine if the stage being skipped to is the stage in the StageUID and will stop the skipping there (however the same caveats that apply for a Visual Studio workflow apply and if the required fields for a stage being skipped are not completed, the workflow won’t skip).
Now to incorporate this into a Nintex Workflow for Project Server couldn’t be simpler, all that is required is to use the ‘Set a condition’ action to do a check on the Skip To Stage context variable, and then branch to the approval / flexi task (as below) if the value is no, or to skip over the approval logic if the value is yes. In the screenshot below, I have also added a ‘Set Status Information’ so I can log to the workflow that the skip is happening.
The Skip To Stage information is stored within the Workflow Context, so when setting up the ‘Set a Condition’ action, make sure you pick the Workflow Context.
Finally, as mentioned in Sam’s original blog post, you need to ensure you have selected the Always Wait option in your Set Stage actions.
If you don’t do this, the workflow may continue to skip past the requested stage.