*/
private void updateGlobalStatus()
{
- JobStatus newStatus = taskStatus;
- int currentPrecedence = ArrayUtils.indexOf(statusPrecedence, newStatus);
+ int precedence = -1;
for (BaseJob job : jobs)
{
JobStatus status = job.getStatus();
int jobPrecedence = ArrayUtils.indexOf(statusPrecedence, status);
- if (currentPrecedence < jobPrecedence)
- {
- currentPrecedence = jobPrecedence;
- newStatus = status;
- }
+ if (precedence < jobPrecedence)
+ precedence = jobPrecedence;
+ }
+ if (precedence >= 0)
+ {
+ setStatus(statusPrecedence[precedence]);
}
- setStatus(newStatus);
}
/**