Search in sources :

Example 91 with JobEntryCopy

use of org.pentaho.di.job.entry.JobEntryCopy in project pentaho-kettle by pentaho.

the class Job method execute.

/**
 * Execute a job with previous results passed in.<br>
 * <br>
 * Execute called by JobEntryJob: don't clear the jobEntryResults.
 *
 * @param nr
 *          The job entry number
 * @param result
 *          the result of the previous execution
 * @return Result of the job execution
 * @throws KettleJobException
 */
public Result execute(int nr, Result result) throws KettleException {
    finished.set(false);
    active.set(true);
    initialized.set(true);
    KettleEnvironment.setExecutionInformation(this, rep);
    // Where do we start?
    JobEntryCopy startpoint;
    // Perhaps there is already a list of input rows available?
    if (getSourceRows() != null) {
        result.setRows(getSourceRows());
    }
    startpoint = jobMeta.findJobEntry(JobMeta.STRING_SPECIAL_START, 0, false);
    if (startpoint == null) {
        throw new KettleJobException(BaseMessages.getString(PKG, "Job.Log.CounldNotFindStartingPoint"));
    }
    Result res = execute(nr, result, startpoint, null, BaseMessages.getString(PKG, "Job.Reason.StartOfJobentry"));
    active.set(false);
    return res;
}
Also used : JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) KettleJobException(org.pentaho.di.core.exception.KettleJobException) WebResult(org.pentaho.di.www.WebResult) Result(org.pentaho.di.core.Result)

Example 92 with JobEntryCopy

use of org.pentaho.di.job.entry.JobEntryCopy in project pentaho-kettle by pentaho.

the class JobMeta method clearChanged.

/**
 * Clears the different changed flags of the job.
 */
@Override
public void clearChanged() {
    changedEntries = false;
    changedHops = false;
    for (int i = 0; i < nrJobEntries(); i++) {
        JobEntryCopy entry = getJobEntry(i);
        entry.setChanged(false);
    }
    for (JobHopMeta hi : jobhops) {
        // Look at all the hops
        hi.setChanged(false);
    }
    super.clearChanged();
}
Also used : JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint)

Example 93 with JobEntryCopy

use of org.pentaho.di.job.entry.JobEntryCopy in project pentaho-kettle by pentaho.

the class JobMeta method countEntries.

/**
 * Count entries.
 *
 * @param name the name
 * @return the int
 */
public int countEntries(String name) {
    int count = 0;
    int i;
    for (i = 0; i < nrJobEntries(); i++) {
        // Look at all the hops;
        JobEntryCopy je = getJobEntry(i);
        if (je.getName().equalsIgnoreCase(name)) {
            count++;
        }
    }
    return count;
}
Also used : JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint)

Example 94 with JobEntryCopy

use of org.pentaho.di.job.entry.JobEntryCopy in project pentaho-kettle by pentaho.

the class JobMeta method realClone.

/**
 * Perform a real clone of the job meta-data object, including cloning all lists and copying all values. If the
 * doClear parameter is true, the clone will be cleared of ALL values before the copy. If false, only the copied
 * fields will be cleared.
 *
 * @param doClear Whether to clear all of the clone's data before copying from the source object
 * @return a real clone of the calling object
 */
public Object realClone(boolean doClear) {
    try {
        JobMeta jobMeta = (JobMeta) super.clone();
        if (doClear) {
            jobMeta.clear();
        } else {
            jobMeta.jobcopies = new ArrayList<JobEntryCopy>();
            jobMeta.jobhops = new ArrayList<JobHopMeta>();
            jobMeta.notes = new ArrayList<NotePadMeta>();
            jobMeta.databases = new ArrayList<DatabaseMeta>();
            jobMeta.slaveServers = new ArrayList<SlaveServer>();
            jobMeta.namedParams = new NamedParamsDefault();
        }
        for (JobEntryCopy entry : jobcopies) {
            jobMeta.jobcopies.add((JobEntryCopy) entry.clone_deep());
        }
        for (JobHopMeta entry : jobhops) {
            jobMeta.jobhops.add((JobHopMeta) entry.clone());
        }
        for (NotePadMeta entry : notes) {
            jobMeta.notes.add((NotePadMeta) entry.clone());
        }
        for (DatabaseMeta entry : databases) {
            jobMeta.databases.add((DatabaseMeta) entry.clone());
        }
        for (SlaveServer slave : slaveServers) {
            jobMeta.getSlaveServers().add((SlaveServer) slave.clone());
        }
        for (String key : listParameters()) {
            jobMeta.addParameterDefinition(key, getParameterDefault(key), getParameterDescription(key));
        }
        return jobMeta;
    } catch (Exception e) {
        return null;
    }
}
Also used : NamedParamsDefault(org.pentaho.di.core.parameters.NamedParamsDefault) SlaveServer(org.pentaho.di.cluster.SlaveServer) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleFileException(org.pentaho.di.core.exception.KettleFileException) UnknownParamException(org.pentaho.di.core.parameters.UnknownParamException) LookupReferencesException(org.pentaho.di.core.exception.LookupReferencesException) FileSystemException(org.apache.commons.vfs2.FileSystemException) KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException) IdNotFoundException(org.pentaho.di.core.exception.IdNotFoundException) JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) NotePadMeta(org.pentaho.di.core.NotePadMeta)

Example 95 with JobEntryCopy

use of org.pentaho.di.job.entry.JobEntryCopy in project pentaho-kettle by pentaho.

the class JobMeta method selectAll.

/**
 * Select all.
 */
public void selectAll() {
    int i;
    for (i = 0; i < nrJobEntries(); i++) {
        JobEntryCopy ce = getJobEntry(i);
        ce.setSelected(true);
    }
    for (i = 0; i < nrNotes(); i++) {
        NotePadMeta ni = getNote(i);
        ni.setSelected(true);
    }
    setChanged();
    notifyObservers("refreshGraph");
}
Also used : JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) NotePadMeta(org.pentaho.di.core.NotePadMeta) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint)

Aggregations

JobEntryCopy (org.pentaho.di.job.entry.JobEntryCopy)149 Point (org.pentaho.di.core.gui.Point)54 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)51 JobMeta (org.pentaho.di.job.JobMeta)47 KettleException (org.pentaho.di.core.exception.KettleException)30 Test (org.junit.Test)28 JobEntryInterface (org.pentaho.di.job.entry.JobEntryInterface)28 NotePadMeta (org.pentaho.di.core.NotePadMeta)24 JobHopMeta (org.pentaho.di.job.JobHopMeta)24 ArrayList (java.util.ArrayList)18 Job (org.pentaho.di.job.Job)18 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)16 JobEntryTrans (org.pentaho.di.job.entries.trans.JobEntryTrans)15 MessageBox (org.eclipse.swt.widgets.MessageBox)13 PluginInterface (org.pentaho.di.core.plugins.PluginInterface)10 Result (org.pentaho.di.core.Result)8 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)8 AreaOwner (org.pentaho.di.core.gui.AreaOwner)8 JobEntrySpecial (org.pentaho.di.job.entries.special.JobEntrySpecial)8 Before (org.junit.Before)7