Examples of SbiThreshold


Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThreshold

      }

      SbiDomains thresholdType=(SbiDomains)session.load(SbiDomains.class, th.getThresholdTypeId());

      // main attributes     
      SbiThreshold hibTh = new SbiThreshold();
      hibTh.setThresholdId(th.getId());
      hibTh.setName(th.getName());
      hibTh.setCode(th.getCode());
      hibTh.setDescription(th.getDescription());
      hibTh.setThresholdType(thresholdType);
      Transaction tx = session.beginTransaction();
      session.save(hibTh);
      tx.commit();

      // load Threshold Value
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThreshold

      return hibMapFeature;
    } else if (hibObj instanceof it.eng.spagobi.kpi.threshold.metadata.SbiThreshold) {
      String label = (String) unique;
      hql = "from SbiThreshold ds where ds.code = '" + label + "'";
      hqlQuery = sessionCurrDB.createQuery(hql);
      SbiThreshold hibDs = null;
      try{
        hibDs = (SbiThreshold) hqlQuery.uniqueResult();
      }
      catch (Exception e) {
        throw new EMFUserError(EMFErrorSeverity.ERROR, "9001", "component_impexp_messages");
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThreshold

      if(newThId==null) {
        logger.error("could not find threshold "+exportedKpi.getSbiThreshold().getCode());
        existingKpi.setSbiThreshold(null);
      }
      else{
        SbiThreshold newSbiThreshold = (SbiThreshold) sessionCurrDB.load(SbiThreshold.class, newThId);
        existingKpi.setSbiThreshold(newSbiThreshold);
      }
    }
    else{
      existingKpi.setSbiThreshold(null);
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThreshold

        logger.error("could not find Threshold between association"+exportedKpiInst.getSbiThreshold().getName());
        existingKpiInst.setSbiThreshold(null);
      }
      else{
        // I must get the new SbiDomains object
        SbiThreshold newSbiThreshold = (SbiThreshold) sessionCurrDB.load(SbiThreshold.class, newThId);
        existingKpiInst.setSbiThreshold(newSbiThreshold);
      }
    }
    else{
      existingKpiInst.setSbiThreshold(null);
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThreshold

      if(newThresholdId==null) {
        logger.error("could not find threshold between association"+exportedThValue.getSbiThreshold().getName());
      }
      else{
        // I must get the new SbiDomains object
        SbiThreshold newSbiThreshold = (SbiThreshold) sessionCurrDB.load(SbiThreshold.class, newThresholdId);
        existingThvalue.setSbiThreshold(newSbiThreshold);
      }
    }
    // TODO sbi alarm,   
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThreshold

   *
   * @return the new hibernate parameter object
   */
  public static SbiThreshold makeNewSbiThreshold(SbiThreshold threshold,Session sessionCurrDB, MetadataAssociations metaAss){
    logger.debug("IN");
    SbiThreshold newTh = new SbiThreshold();
    try{
      newTh.setCode(threshold.getCode());
      newTh.setDescription(threshold.getDescription());
      newTh.setName(threshold.getName());

      // associations
      entitiesAssociationsSbiThreshold(threshold, newTh, sessionCurrDB, metaAss);

      logger.debug("OUT");
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThreshold

   * @throws EMFUserError the EMF user error
   */
  public static SbiThreshold modifyExistingSbiThreshold(SbiThreshold exportedTh, Session sessionCurrDB,
      Integer existingId, MetadataAssociations metaAss) throws EMFUserError {
    logger.debug("IN");
    SbiThreshold existingTh = null;
    try {
      // update th Value
      existingTh = (SbiThreshold) sessionCurrDB.load(SbiThreshold.class, existingId);
      existingTh.setCode(exportedTh.getCode());
      existingTh.setName(exportedTh.getName());

      // associations
      entitiesAssociationsSbiThreshold(exportedTh, existingTh, sessionCurrDB, metaAss);
    }

View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThreshold

        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();
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThreshold

      dsId = dsC.getDsId();
      dsLabel = dsC.getLabel();
    }

    IThresholdDAO thresholdDAO=DAOFactory.getThresholdDAO();
    SbiThreshold thresh = kpi.getSbiThreshold();
    if(thresh!=null){
      Threshold threshold=thresholdDAO.toThreshold(thresh);
      toReturn.setThreshold(threshold);
      logger.debug("Kpi threshold setted");
    }
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThreshold

        Integer ds_id = kpi.getKpiDsId() ;
        ds = (SbiDataSetConfig) aSession.load(SbiDataSetConfig.class,
            ds_id);
      }

      SbiThreshold sbiThreshold = null;
      if (kpi.getThreshold() != null) {
        Integer thresholdId = kpi.getThreshold().getId();
        sbiThreshold = (SbiThreshold) aSession.load(SbiThreshold.class, thresholdId);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.