none
How do I pass the Expanded Priority from running job to next job? RRS feed

  • Question

  • Let's say I have Job 1 currently running with Normal priority.  I right click on the job from ClusterManager and modify the Priority to Normal+5.   I have some code written that set up the first job, but then sets up a second job after the first one completes.  I would like to pass on the expanded priority from the first job to the second one that follows.  How to I do that?

    Currently, I am trying to set it up with the following code, but it's not working....

    From Job1 I'm checking the priority at the end, and if it meets the criteria of the IF statement assigning this new value to newPriority:

    int newPriority = 0; 

    if (myJob1.ExpandedPriority >= 3000)
     {
                   newPriority = myJob1.ExpandedPriority;
     }

    In Job2 code I am bringing in the new value and trying to assign it to the priority:

    if (newPriority >= 3000)
                {
                    myJob2.ExpandedPriority = newPriority;
                }

    Why isn't this working??

    Thursday, October 4, 2012 5:32 PM

All replies

  • Hi,

    you need to debug into your code and see if the first if even got broke into...or print out the value after the if?

    Friday, October 5, 2012 12:05 AM
  • Maybe you need to call job.Commit() after assignment is done?
    Wednesday, October 10, 2012 4:09 PM
  • I don't think it was the job.Commit(), but you gave me the idea that I needed to use the job.Refresh() in order to get the updated priority.  Thank you both for your replies!
    Wednesday, October 10, 2012 5:07 PM