/** * Find unused nr. * * @param name the name * @return the int */ public int findUnusedNr( String name ) { int nr = 1; JobEntryCopy je = findJobEntry( name, nr, true ); while ( je != null ) { nr++; // log.logDebug("findUnusedNr()", "Trying unused nr: "+nr); je = findJobEntry( name, nr, true ); } return nr; }
/** * Proposes an alternative job entry name when the original already exists... * * @param entryname The job entry name to find an alternative for.. * @return The alternative stepname. */ public String getAlternativeJobentryName( String entryname ) { String newname = entryname; JobEntryCopy jec = findJobEntry( newname ); int nr = 1; while ( jec != null ) { nr++; newname = entryname + " " + nr; jec = findJobEntry( newname ); } return newname; }
public JobHopMeta( Node hopnode, JobMeta job ) throws KettleXMLException { try { String from_name = XMLHandler.getTagValue( hopnode, "from" ); String to_name = XMLHandler.getTagValue( hopnode, "to" ); String sfrom_nr = XMLHandler.getTagValue( hopnode, "from_nr" ); String sto_nr = XMLHandler.getTagValue( hopnode, "to_nr" ); String senabled = XMLHandler.getTagValue( hopnode, "enabled" ); String sevaluation = XMLHandler.getTagValue( hopnode, "evaluation" ); String sunconditional = XMLHandler.getTagValue( hopnode, "unconditional" ); int from_nr, to_nr; from_nr = Const.toInt( sfrom_nr, 0 ); to_nr = Const.toInt( sto_nr, 0 ); this.from = job.findJobEntry( from_name, from_nr, true ); this.to = job.findJobEntry( to_name, to_nr, true ); if ( senabled == null ) { enabled = true; } else { enabled = "Y".equalsIgnoreCase( senabled ); } if ( sevaluation == null ) { evaluation = true; } else { evaluation = "Y".equalsIgnoreCase( sevaluation ); } unconditional = "Y".equalsIgnoreCase( sunconditional ); } catch ( Exception e ) { throw new KettleXMLException( BaseMessages.getString( PKG, "JobHopMeta.Exception.UnableToLoadHopInfoXML" ), e ); } }
private void setupJobMockExecution() { setInternalState( mockedJob, "jobMeta", mockedJobMeta ); setInternalState( mockedJob, "log", mockedLogChannel ); setInternalState( mockedJob, "jobTracker", new JobTracker( mockedJobMeta ) ); setInternalState( mockedJob, "jobEntryListeners", new ArrayList<>( ) ); setInternalState( mockedJob, "jobEntryResults", new LinkedList<>( ) ); setInternalState( mockedJob, "status", new AtomicInteger( 0 ) ); when( mockedJobMeta.findJobEntry( JobMeta.STRING_SPECIAL_START, 0, false ) ).thenReturn( mockedJobEntryCopy ); when( mockedJobEntryCopy.getEntry() ).thenReturn( mockedJobEntrySpecial ); when( mockedJobEntrySpecial.getLogChannel() ).thenReturn( mockedLogChannel ); when( mockedJobEntrySpecial.clone() ).thenReturn( mockedJobEntrySpecial ); when( mockedJob.isStopped() ).thenCallRealMethod(); doCallRealMethod().when( mockedJob ).setStopped( anyBoolean() ); KettleLogStore.init(); }
object = new TreeSelection( path[3], jobMeta.findJobEntry( path[3] ), jobMeta );
if ( startCopyName != null && !startCopyName.isEmpty() ) { int startCopyNr = jobExecutionConfiguration.getStartCopyNr(); JobEntryCopy startJobEntryCopy = jobMeta.findJobEntry( startCopyName, startCopyNr, false ); job.setStartJobEntryCopy( startJobEntryCopy );
if ( !Utils.isEmpty( getConfiguration().getStartCopyName() ) ) { JobEntryCopy copy = ( (JobMeta) abstractMeta ).findJobEntry( getConfiguration().getStartCopyName(), getConfiguration() .getStartCopyNr(), false ); if ( copy != null ) {
if ( lastChained != null && jobMeta.findJobEntry( lastChained.getName(), lastChained.getNr(), false ) == null ) { lastChained = null;
JobEntryCopy check = jobMeta.findJobEntry( entry_name, 0, true ); while ( check != null ) { entry_name = type_desc + " " + nr++; check = jobMeta.findJobEntry( entry_name, 0, true );
startpoint = jobMeta.findJobEntry( JobMeta.STRING_SPECIAL_START, 0, false ); if ( startpoint == null ) { throw new KettleJobException( BaseMessages.getString( PKG, "Job.Log.CounldNotFindStartingPoint" ) );
if ( startCopyName != null && !startCopyName.isEmpty() ) { int startCopyNr = jobExecutionConfiguration.getStartCopyNr(); JobEntryCopy startJobEntryCopy = jobMeta.findJobEntry( startCopyName, startCopyNr, false ); job.setStartJobEntryCopy( startJobEntryCopy );
JobEntryCopy copyFrom = jobMeta.findJobEntry( copyFromName, copyFromNr, true ); JobEntryCopy copyTo = jobMeta.findJobEntry( copyToName, copyToNr, true );
addMissingEntry( (MissingEntry) je.getEntry() ); JobEntryCopy prev = findJobEntry( je.getName(), 0, true ); if ( prev != null ) { prev = findJobEntry( je.getName(), je.getNr(), true ); if ( prev != null ) {
runJobMeta.findJobEntry( executionConfiguration.getStartCopyName(), executionConfiguration .getStartCopyNr(), false ); job.setStartJobEntryCopy( startJobEntryCopy );
jobEntryCopy.setEntry( JobMeta.findJobEntry( jobentries, jobEntryId ) ); if ( jobEntryCopy.getEntry() == null ) {
jge = jobMeta.findJobEntry( entry, 0, true ); if ( jge != null ) {
startpoint = jobMeta.findJobEntry( JobMeta.STRING_SPECIAL_START, 0, false ); } else { startpoint = startJobEntryCopy;