Insight

Insight from Agora Consultants

SharePoint Designer Portfolio Selection

I discovered this issue with portfolio selection about a two years ago and I have finally decided to write about it. This blog will demonstrate what the problem is and the options for a workaround.

I have never understood the ins and outs of portfolio analysis. I will not be explaining how to do a portfolio analysis or what each feature means. I will only be talking about it in the context of pushing a workflow.

Portfolio Selection in the Past

For Project Server 2010 when workflows were developed in Visual Studio 2010, any complex condition or process could be accounted for with custom coding in C#. Portfolio selection was one of these things, usually contained in a while loop so that “not selected” projects could travel back to the previous stage.

There are many activities in the image above, but the names are self-explanatory.

A project has two internal variables that are written when a portfolio analysis is done. “Optimizer” for cost analysis, and “Planner” for resource analysis. If the user clicked Commit on the Cost analysis page, the Optimizer value would be populated and the Planner value would be null. Inversely if the user clicked Commit on the Resource analysis page, then the Planner value would be populated and the Optimizer value would be null.

In 2010 with C#, this was no issue. A simple null check on each field, then whichever one had a value was compared to 0 or 3 (0 meaning selected, 3 meaning forced in). And so the project advanced.

Portfolio Selection Now

In 2013 and Project Online, SharePoint Designer does not handle this well. Consider the stage block below:

It should be simple to understand. We wait for the Commit action, then we check the Planner Decision variable for 0 or 3.

If I complete a portfolio analysis by clicking Commit on the Resource analysis page, this works as expected. If I click Commit on the Cost analysis page, I get this error on the workflow details page:

It seems like workflow manager is choking on the NULL value in Planner Decision. The workflow is now dead.

This creates a big problem. I cannot even check both Optimizer and Planner to see if they have values because the very act of checking is what causes this exception! If you know SharePoint Designer, you know that some variables have an “is not empty” option, but unfortunately I don’t have that for these variables. This is a technical problem… and I hate to be harsh to MS but this is really obvious.

Workarounds

There is no technical workaround. Only process options that you can present to your client.

  1. Change the stage to Submit

Have the user perform the portfolio analysis however they wish, and then manually go into each selected project and push it forward with a Submit.

  1. Change the stage to an Approval

Same as option 1, except the user would manually complete an approval instead of a Submit.

  1. Only use one kind of analysis

Talk to the client and figure out which is more likely to be a constraint (cost or resource) and then make sure that they only use that one kind of analysis (and that is the one you put in SPD).

Summary

I have experienced this issue on multiple computers pointing at multiple environments both in the cloud and on premises for the past two years. Fortunately, clients have been willing to take one of the above workarounds, but I think it is unacceptable that for something so basic (a NULL check) an organization will have to make a difficult process decision.



 
Comments are closed