Example #1
0
  public TransHopMeta(Repository rep, long id_trans_hop, List<StepMeta> steps)
      throws KettleException {
    try {
      setID(id_trans_hop);

      RowMetaAndData r = rep.getTransHop(id_trans_hop);

      long id_step_from = r.getInteger("ID_STEP_FROM", 0); // $NON-NLS-1$
      long id_step_to = r.getInteger("ID_STEP_TO", 0); // $NON-NLS-1$
      enabled = r.getBoolean("ENABLED", false); // $NON-NLS-1$
      guiMidLocationX = r.getString("GUI_MID_LOCATION_X", "");
      guiMidLocationY = r.getString("GUI_MID_LOCATION_Y", "");

      from_step = StepMeta.findStep(steps, id_step_from);
      if (from_step == null && id_step_from > 0) // Links to a shared
      // objects, try again by
      // looking up the
      // name...
      {
        // Simply load this, we only want the name, we don't care about
        // the rest...
        StepMeta stepMeta =
            new StepMeta(
                rep,
                id_step_from,
                new ArrayList<DatabaseMeta>(),
                new Hashtable<String, Counter>(),
                new ArrayList<PartitionSchema>());
        from_step = StepMeta.findStep(steps, stepMeta.getName());
      }
      from_step.setDraw(true);

      to_step = StepMeta.findStep(steps, id_step_to);
      if (to_step == null && id_step_to > 0) // Links to a shared
      // objects, try again by
      // looking up the name...
      {
        // Simply load this, we only want the name, we don't care about
        // the rest...
        StepMeta stepMeta =
            new StepMeta(
                rep,
                id_step_to,
                new ArrayList<DatabaseMeta>(),
                new Hashtable<String, Counter>(),
                new ArrayList<PartitionSchema>());
        to_step = StepMeta.findStep(steps, stepMeta.getName());
      }
      to_step.setDraw(true);
    } catch (KettleDatabaseException dbe) {
      throw new KettleException(
          Messages.getString("TransHopMeta.Exception.LoadTransformationHopInfo") + id_trans_hop,
          dbe); //$NON-NLS-1$
    }
  }
Example #2
0
  public JobHopMeta(Repository rep, long id_job_hop, JobMeta job, List<JobEntryCopy> jobcopies)
      throws KettleException {
    try {
      long id_jobentry_copy_from;
      long id_jobentry_copy_to;

      RowMetaAndData r = rep.getJobHop(id_job_hop);
      if (r != null) {
        id_jobentry_copy_from = r.getInteger("ID_JOBENTRY_COPY_FROM", -1L);
        id_jobentry_copy_to = r.getInteger("ID_JOBENTRY_COPY_TO", -1L);
        enabled = r.getBoolean("ENABLED", true);
        evaluation = r.getBoolean("EVALUATION", true);
        unconditional = r.getBoolean("UNCONDITIONAL", !evaluation);
        guiMidLocationX = r.getString("GUI_MID_LOCATION_X", "");
        guiMidLocationY = r.getString("GUI_MID_LOCATION_Y", "");

        from_entry = JobMeta.findJobEntryCopy(jobcopies, id_jobentry_copy_from);
        to_entry = JobMeta.findJobEntryCopy(jobcopies, id_jobentry_copy_to);
      }
    } catch (KettleDatabaseException dbe) {
      throw new KettleException(
          Messages.getString("JobHopMeta.Exception.UnableToLoadHopInfoRep", "" + id_job_hop), dbe);
    }
  }