Examples of SbiKpiInstance


Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiInstance

    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiKpiInstance sbiKpiInst = (SbiKpiInstance) aSession.load(
          SbiKpiInstance.class, kpiInstId);
      Criteria critt = aSession.createCriteria(SbiKpiValue.class);
      critt.add(Expression.eq("sbiKpiInstance", sbiKpiInst));
      List sbiKpiValueList = critt.list();
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiInstance

      // Load tKpi Instance
      if (mi.getKpiInstance() != null) {
        KpiInstance kpiInstance=mi.getKpiInstance();
        insertKpiInstance(kpiInstance.getKpiInstanceId(), session);
        SbiKpiInstance hibKpiInst = (SbiKpiInstance) session.load(SbiKpiInstance.class, kpiInstance.getKpiInstanceId());
        hibMi.setSbiKpiInstance(hibKpiInst);

      }

      //load all organizational units
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiInstance

      // recover kpi instance from Id
      IKpiInstanceDAO kpiInstDAO=DAOFactory.getKpiInstanceDAO();
      KpiInstance kpiInst=kpiInstDAO.loadKpiInstanceById(kpiInstId);

      // main attributes     
      SbiKpiInstance hibKpiInst = new SbiKpiInstance();
      hibKpiInst.setIdKpiInstance(kpiInst.getKpiInstanceId());
      hibKpiInst.setBeginDt(kpiInst.getD());
      hibKpiInst.setWeight(kpiInst.getWeight());
      hibKpiInst.setTarget(kpiInst.getTarget());

      if(kpiInst.getChartTypeId()!=null){
        SbiDomains chartType=(SbiDomains)session.load(SbiDomains.class, kpiInst.getChartTypeId());     
        hibKpiInst.setChartType(chartType);
      }

      // Kpi
      if (kpiInst.getKpi()!=null) {   
        insertKpi(kpiInst.getKpi(), session);
        SbiKpi sbiKpi= (SbiKpi) session.load(SbiKpi.class, kpiInst.getKpi());
        hibKpiInst.setSbiKpi(sbiKpi);
      }

      // load threshold
      if (kpiInst.getThresholdId() != null) {
        IThresholdDAO thresholdDAO=DAOFactory.getThresholdDAO();
        Threshold th=thresholdDAO.loadThresholdById(kpiInst.getThresholdId());
        insertThreshold(th, session);
        SbiThreshold sbiTh= (SbiThreshold) session.load(SbiThreshold.class, th.getId());
        hibKpiInst.setSbiThreshold(sbiTh);
      }

      // load measureUnit!
      if(kpiInst.getScaleCode()!=null){
        IMeasureUnitDAO muDao=DAOFactory.getMeasureUnitDAO();
        MeasureUnit mu=muDao.loadMeasureUnitByCd(kpiInst.getScaleCode());
        insertMeasureUnit(mu, session);
        SbiMeasureUnit sbiMu= (SbiMeasureUnit) session.load(SbiMeasureUnit.class, mu.getId());
        hibKpiInst.setSbiMeasureUnit(sbiMu);
      }

      // Insert KPI Instance

      Transaction tx = session.beginTransaction();
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiInstance

      // Kpi instance should be already inserted

      if (kpiInstPeriod.getKpiInstId()!= null) {
        Integer kpiInstPeriodId=kpiInstPeriod.getKpiInstId();
        SbiKpiInstance sbiKpiInstance= (SbiKpiInstance) session.load(SbiKpiInstance.class, kpiInstPeriodId);
        if(sbiKpiInstance!=null){
          hibKpiInstPeriod.setSbiKpiInstance(sbiKpiInstance);
        }
      }
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiInstance

      hibAlarm.setAutoDisabled(alarm.isAutoDisabled());
      hibAlarm.setSingleEvent(alarm.isSingleEvent());

      // kpi Instance (already inserted)
      if(alarm.getIdKpiInstance()!=null){
        SbiKpiInstance sbiKpiInst=(SbiKpiInstance)session.load(SbiKpiInstance.class, alarm.getIdKpiInstance());     
        hibAlarm.setSbiKpiInstance(sbiKpiInst);
      }

      // Threshold Value (already inserted)
      if(alarm.getIdThresholdValue()!=null){
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiInstance

   *
   * @return the new hibernate parameter object
   */
  public static SbiKpiInstance makeNewSbiKpiInstance(SbiKpiInstance kpiInst,Session sessionCurrDB, MetadataAssociations metaAss){
    logger.debug("IN");
    SbiKpiInstance newKpiInst = new SbiKpiInstance();
    try{
      newKpiInst.setBeginDt(kpiInst.getBeginDt());
      newKpiInst.setTarget(kpiInst.getTarget());
      newKpiInst.setWeight(kpiInst.getWeight());

      // associations
      entitiesAssociationsSbiKpiInstance(kpiInst, newKpiInst, sessionCurrDB, metaAss);

      logger.debug("OUT");
    }
    catch (Exception e) {
      logger.error("Error inc reating new kpi instance with id "+newKpiInst.getIdKpiInstance());     
    }
    finally{

    }
    return newKpiInst;
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiInstance

   * @throws EMFUserError the EMF user error
   */
  public static SbiKpiInstance modifyExistingSbiKpiInstance(SbiKpiInstance exportedKpiInst, Session sessionCurrDB,
      Integer existingId, MetadataAssociations metaAss) throws EMFUserError {
    logger.debug("IN");
    SbiKpiInstance existingKpiInst = null;
    try {
      // update th Value
      existingKpiInst = (SbiKpiInstance) sessionCurrDB.load(SbiKpiInstance.class, existingId);
      existingKpiInst.setBeginDt(exportedKpiInst.getBeginDt());
      existingKpiInst.setTarget(exportedKpiInst.getTarget());
      existingKpiInst.setWeight(exportedKpiInst.getWeight());

      // overwrite existging entities (maybe create a function speciic for domains, maybe not)
      entitiesAssociationsSbiKpiInstance(exportedKpiInst, existingKpiInst, sessionCurrDB, metaAss);

    }
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiInstance

        logger.error("could not find Kpi iNts between association"+exportedModInst.getSbiKpiInstance().getIdKpiInstance());
        existingModInst.setSbiKpiInstance(null);
      }
      else{
        // I must get the new SbiDomains object
        SbiKpiInstance newSbiKpiInst= (SbiKpiInstance) sessionCurrDB.load(SbiKpiInstance.class, newKpiInstId);
        existingModInst.setSbiKpiInstance(newSbiKpiInst);
      }
    }
    else{
      existingModInst.setSbiKpiInstance(null);
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiInstance

      if(newTypeId==null) {
        logger.error("could not find kpi instance associater to kpiInstPeriod with previous id "+exportedKpiInstPeriod.getSbiKpiInstance().getIdKpiInstance());
      }
      else{
        // I must get the new SbiDomains object
        SbiKpiInstance newSbiType = (SbiKpiInstance) sessionCurrDB.load(SbiKpiInstance.class, newTypeId);
        existingKpiInstPeriod.setSbiKpiInstance(newSbiType);
      }
    }

View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiInstance

      if(newKpiInstId==null) {
        logger.error("could not find kpi instance associated to current alarm: "+exportedAlarm.getSbiKpiInstance().getIdKpiInstance());
      }
      else{
        // I must get the new SbiDomains object
        SbiKpiInstance newSbiKpiInstance= (SbiKpiInstance) sessionCurrDB.load(SbiKpiInstance.class, newKpiInstId);
        existingAlarm.setSbiKpiInstance(newSbiKpiInstance);
      }
    }

    // Threshold Value
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.