logger.debug("SbiKpiValue scaleName: "
+ (scaleName != null ? scaleName : "scaleName null"));
}
logger.debug("Requested date d: " + d.toString()
+ " in between beginDate and EndDate");
SbiThreshold t = kpiInst.getSbiThreshold();
if(t!=null){
Set ts = t.getSbiThresholdValues();
Iterator i = ts.iterator();
while (i.hasNext()) {
SbiThresholdValue tls = (SbiThresholdValue) i.next();
IThresholdValueDAO thDao=(IThresholdValueDAO)DAOFactory.getThresholdValueDAO();
ThresholdValue tr = thDao.toThresholdValue(tls);
thresholdValues.add(tr);
}
}
} else {// in case older thresholds have to be retrieved
Set kpiInstHist = kpiInst.getSbiKpiInstanceHistories();
Iterator i = kpiInstHist.iterator();
while (i.hasNext()) {
SbiKpiInstanceHistory ih = (SbiKpiInstanceHistory) i.next();
Date ihBegDt = ih.getBeginDt();
Date ihEndDt = ih.getEndDt();
if ((d.after(ihBegDt) || d.equals(ihBegDt))
&& (d.before(ihEndDt) || d.equals(ihEndDt))) {
weight = ih.getWeight();
logger.debug("SbiKpiValue weight: "
+ (weight != null ? weight.toString()
: "weight null"));
target = ih.getTarget();
logger.debug("SbiKpiValue target: "
+ (target != null ? target.toString()
: "target null"));
if (ih.getSbiMeasureUnit() != null) {
scaleCode = ih.getSbiMeasureUnit().getScaleCd();
logger.debug("SbiKpiValue scaleCode: "
+ (scaleCode != null ? scaleCode
: "scaleCode null"));
scaleName = ih.getSbiMeasureUnit().getScaleNm();
logger.debug("SbiKpiValue scaleName: "
+ (scaleName != null ? scaleName
: "scaleName null"));
}
SbiThreshold t = ih.getSbiThreshold();
if(t!=null){
Set ts = t.getSbiThresholdValues();
Iterator it = ts.iterator();
while (it.hasNext()) {
SbiThresholdValue tls = (SbiThresholdValue) it.next();
IThresholdValueDAO thDao=(IThresholdValueDAO)DAOFactory.getThresholdValueDAO();