Examples of SbiKpiInstance


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

        while (it.hasNext()) {
          KpiAlarmInstance kpiAlarm = new KpiAlarmInstance();
          SbiKpiModelInst kpiModelInst = (SbiKpiModelInst) it.next();
          String modelName = kpiModelInst.getName();
          kpiAlarm.setKpiModelName(modelName);
          SbiKpiInstance kpiInst = kpiModelInst.getSbiKpiInstance();
          if(kpiInst != null){
            Integer kpiInstId = kpiInst.getIdKpiInstance();
            kpiAlarm.setKpiInstanceId(kpiInstId);
            SbiKpi sk = kpiInst.getSbiKpi();
            if(sk != null){
              String kpiName = sk.getName();
              kpiAlarm.setKpiName(kpiName);
              kpiAlarmInst.add(kpiAlarm);
            }
View Full Code Here

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

    return kpiAlarmInst;
  }
 
  public SbiKpiInstance loadSbiKpiInstanceById(Integer id) throws EMFUserError {
    logger.debug("IN");
    SbiKpiInstance toReturn = null;
    Session aSession = null;
    Transaction tx = null;

    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiKpiInstance hibSbiKpiInstance = (SbiKpiInstance) aSession.load(
          SbiKpiInstance.class, id);
      toReturn = hibSbiKpiInstance;

    } catch (HibernateException he) {
      logger.error("Error while loading the Model Instance with id "
View Full Code Here

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

    List exportedKpiInstPeriod = importer.getAllExportedSbiObjects(sessionExpDB, "SbiKpiInstPeriod", null);
    Iterator iterSbiKpiInstPeriod = exportedKpiInstPeriod.iterator();
    while (iterSbiKpiInstPeriod.hasNext()) {
      SbiKpiInstPeriod dsInstPer = (SbiKpiInstPeriod) iterSbiKpiInstPeriod.next();
      String periodicityName=dsInstPer.getSbiKpiPeriodicity().getName();
      SbiKpiInstance kpiInst=dsInstPer.getSbiKpiInstance();
      Map kpiInstanceIDMap=metaAss.getKpiInstanceIDAssociation();

      Integer newKpiInstanceId=null;
      Object newKpiInstanceIdO=kpiInstanceIDMap.get(kpiInst.getIdKpiInstance());
      if(newKpiInstanceIdO!=null){
        newKpiInstanceId=(Integer)newKpiInstanceIdO;
      }
      Object existObj = null;
      if(newKpiInstanceId!=null){
View Full Code Here

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

   *
   * @throws EMFUserError
   */
  private void importKpiInstance(boolean overwrite) throws EMFUserError {
    logger.debug("IN");
    SbiKpiInstance exportedKpiInst = null;
    try {
      List exportedKpisInsts = importer.getAllExportedSbiObjects(sessionExpDB, "SbiKpiInstance", null);
      Iterator iterSbiKpisInsts = exportedKpisInsts.iterator();
      while (iterSbiKpisInsts.hasNext()) {
        exportedKpiInst = (SbiKpiInstance) iterSbiKpisInsts.next();
        Integer oldId = exportedKpiInst.getIdKpiInstance();
        Integer existingKpiInstId = null;
        Map kpiInstIdAss = metaAss.getKpiInstanceIDAssociation();
        Set kpiInstIdAssSet = kpiInstIdAss.keySet();
        if (kpiInstIdAssSet.contains(oldId) && !overwrite) {
          metaLog.log("Exported kpi instance with id" + exportedKpiInst.getIdKpiInstance() + " not inserted"
              + " because it has the same relations of an existing kpi instance");
          continue;
        } else {
          existingKpiInstId = (Integer) kpiInstIdAss.get(oldId);
        }
        if (existingKpiInstId != null) {
          logger.info("The kpi instance with id:[" + exportedKpiInst.getIdKpiInstance() + "] is just present. It will be updated.");
          metaLog.log("The kpi instance with id = [" + exportedKpiInst.getIdKpiInstance() + "] will be updated.");
          SbiKpiInstance existingKpiInst = ImportUtilities.modifyExistingSbiKpiInstance(exportedKpiInst, sessionCurrDB, existingKpiInstId, metaAss);
          sessionCurrDB.update(existingKpiInst);
        } else {
          SbiKpiInstance newKpiInst = ImportUtilities.makeNewSbiKpiInstance(exportedKpiInst, sessionCurrDB, metaAss);
          sessionCurrDB.save(newKpiInst);
          metaLog.log("Inserted new kpi instance with id " + newKpiInst.getIdKpiInstance());
          Integer newId = newKpiInst.getIdKpiInstance();
          metaAss.insertCoupleKpiInstance(oldId, newId);
        }
      }
    } catch (Exception e) {
      if (exportedKpiInst != null) {
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.