none
OptimizerCannotCalculateSolutionStrategicAlignment error when creating a new Optimizer Solution through PSI RRS feed

  • Question

  • Hello,

    Does anyone know why QueueCreateOptimizerSolution method would throw the error mentioned in the title of this post?  What is missing or wrong with the optimizer data set that is passed into the method in order for it to raise this exception?

    What I'm trying to do is force a project out of the portfolio analysis programmataically.  So I get the optimizer solution, find the project that I want to force out and set the FORCE_STATUS for this project to "ForceOut".  Then using the updated optimizer data set I want to create a new solution, deleting the existing one first.  Looks something like this.

    oldOptimizerSolution = ReadOptimizerSolution(solutionUid);
    find necessary row in oldOptimizerSolution.SolutionProjects table
    row.FORCE_STATUS = (byte)...ForceOut;
    row.AcceptChanges();

    newOptimizerSolution = oldOptimizerSolution;
    QueueDeleteOptimizerSolution(oldOptimizerSolution);
    QueueCreateOptimizerSolution(newOptimizerSolution);

    On the last call I'm getting the above mentioned exception.  I'm wondering why, because the data sets are identical except for the changed FORCE_STATUS on one of the rows in SolutionProjects.  The solution GUIDs and names are the same, but the old solution is deleted before new one is created, so that (technically) shouldn't be a problem.

    I'm just going by what Project Server does: you force a project out, hit Recalculate after which it creates practically a new scenario called "Current Portfolio Selection" which you later may save and commit.  Is it really that the new temporary scenario gets manually recreated from the last committed scenario's data by using NewSolutionRow(), AddSolutionRow(), NewConstraintRow(), etc, etc, etc???

    Sorry for long posts, but I feel like this calls for a good explanation on my part.  Would really appreciate input on this!

    Thank you,
    Ilya

    Friday, October 28, 2011 4:34 AM

Answers