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;
}
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();
}
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;
}
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;
}
}
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");
}
Aggregations