public boolean evaluate( Result result ) { String Returnmessage = null; String RealMessageabort = environmentSubstitute( getMessageabort() ); try { // Return False if ( RealMessageabort == null ) { Returnmessage = BaseMessages.getString( PKG, "JobEntryAbort.Meta.CheckResult.Label" ); } else { Returnmessage = RealMessageabort; } logError( Returnmessage ); result.setNrErrors( 1 ); return false; } catch ( Exception e ) { result.setNrErrors( 1 ); logError( BaseMessages.getString( PKG, "JobEntryAbort.Meta.CheckResult.CouldNotExecute" ) + e.toString() ); return false; } }
public JobEntryAbortDialog( Shell parent, JobEntryInterface jobEntryInt, Repository rep, JobMeta jobMeta ) { super( parent, jobEntryInt, rep, jobMeta ); jobEntry = (JobEntryAbort) jobEntryInt; if ( this.jobEntry.getName() == null ) { this.jobEntry.setName( BaseMessages.getString( PKG, "JobEntryAbortDialog.Jobname.Label" ) ); } }
public void modifyText( ModifyEvent e ) { jobEntry.setChanged(); } };
/** * Copy information from the meta-data input to the dialog fields. */ public void getData() { if ( jobEntry.getName() != null ) { wName.setText( jobEntry.getName() ); } if ( jobEntry.getMessageabort() != null ) { wMessageAbort.setText( jobEntry.getMessageabort() ); } wName.selectAll(); wName.setFocus(); }
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setText( BaseMessages.getString( PKG, "System.StepJobEntryNameMissing.Title" ) ); mb.setMessage( BaseMessages.getString( PKG, "System.JobEntryNameMissing.Msg" ) ); mb.open(); return; } jobEntry.setName( wName.getText() ); jobEntry.setMessageabort( wMessageAbort.getText() ); dispose(); } }
JobEntryAbort abort = new JobEntryAbort(); abort.setName( "Abort Job" );
/** * Execute this job entry and return the result. In this case it means, just set the result boolean in the Result * class. * * @param previousResult * The result of the previous execution * @return The Result of the execution. */ public Result execute( Result previousResult, int nr ) { previousResult.setResult( evaluate( previousResult ) ); // we fail so stop // job execution parentJob.stopAll(); return previousResult; }
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ) throws KettleException { try { rep.saveJobEntryAttribute( id_job, getObjectId(), "message", messageAbort ); } catch ( KettleDatabaseException dbe ) { throw new KettleException( BaseMessages.getString( PKG, "JobEntryAbort.UnableToSaveToRepo.Label", String .valueOf( id_job ) ), dbe ); } }
changed = jobEntry.hasChanged();
private void cancel() { jobEntry.setChanged( changed ); jobEntry = null; dispose(); }