congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
JobHopMeta
Code IndexAdd Tabnine to your IDE (free)

How to use
JobHopMeta
in
org.pentaho.di.job

Best Java code snippets using org.pentaho.di.job.JobHopMeta (Showing top 20 results out of 315)

origin: pentaho/pentaho-kettle

public void setHopEvaluationTrue() {
 currentHop.setConditional();
 currentHop.setEvaluation( true );
 spoon.refreshGraph();
}
origin: pentaho/pentaho-kettle

public void saveJobHopMeta( JobHopMeta hop, ObjectId id_job ) throws KettleException {
 try {
  ObjectId id_jobentry_from = null;
  ObjectId id_jobentry_to = null;
  id_jobentry_from = hop.getFromEntry() == null ? null : hop.getFromEntry().getObjectId();
  id_jobentry_to = hop.getToEntry() == null ? null : hop.getToEntry().getObjectId();
  // Insert new job hop in repository
  //
  hop.setObjectId( insertJobHop( id_job, id_jobentry_from, id_jobentry_to, hop.isEnabled(), hop
   .getEvaluation(), hop.isUnconditional() ) );
 } catch ( KettleDatabaseException dbe ) {
  throw new KettleException( BaseMessages.getString( PKG, "JobHopMeta.Exception.UnableToSaveHopInfoRep", ""
   + id_job ), dbe );
 }
}
origin: pentaho/pentaho-kettle

private Set<JobEntryCopy> enableDisableNextHops( JobEntryCopy from, boolean enabled, Set<JobEntryCopy> checkedEntries ) {
 checkedEntries.add( from );
 jobMeta.getJobhops().stream()
     .filter( hop -> from.equals( hop.getFromEntry() ) )
     .forEach( hop -> {
      if ( hop.isEnabled() != enabled ) {
       JobHopMeta before = (JobHopMeta) hop.clone();
       hop.setEnabled( enabled );
       JobHopMeta after = (JobHopMeta) hop.clone();
       spoon.addUndoChange( jobMeta, new JobHopMeta[]{ before }, new JobHopMeta[]{ after }, new int[]{ jobMeta
           .indexOfJobHop( hop ) } );
      }
      if ( !checkedEntries.contains( hop.getToEntry() ) ) {
       enableDisableNextHops( hop.getToEntry(), enabled, checkedEntries );
      }
     } );
 return checkedEntries;
}
origin: pentaho/pentaho-kettle

public void setEvaluation() {
 if ( !evaluation ) {
  setChanged();
 }
 setEvaluation( true );
}
origin: pentaho/pentaho-kettle

/**
 * Find nr next job entries.
 *
 * @param from the from
 * @return the int
 */
public int findNrNextJobEntries( JobEntryCopy from ) {
 int count = 0;
 for ( JobHopMeta hi : jobhops ) {
  // Look at all the hops
  if ( hi.isEnabled() && ( hi.getFromEntry() != null ) && hi.getFromEntry().equals( from ) ) {
   count++;
  }
 }
 return count;
}
origin: pentaho/pentaho-kettle

 if ( hop.getFromEntry().evaluates() ) {
  if ( hop.isUnconditional() ) {
   hop.setUnconditional( false );
   hop.setEvaluation( true );
  } else {
   if ( hop.getEvaluation() ) {
    hop.setEvaluation( false );
   } else {
    hop.setUnconditional( true );
JobHopMeta before = (JobHopMeta) hop.clone();
hop.setEnabled( !hop.isEnabled() );
if ( hop.isEnabled() && ( jobMeta.hasLoop( hop.getToEntry() ) ) ) {
 MessageBox mb = new MessageBox( shell, SWT.CANCEL | SWT.OK | SWT.ICON_WARNING );
 mb.setMessage( BaseMessages.getString( PKG, "JobGraph.Dialog.LoopAfterHopEnabled.Message" ) );
 int choice = mb.open();
 if ( choice == SWT.CANCEL ) {
  hop.setEnabled( false );
JobHopMeta after = (JobHopMeta) hop.clone();
spoon.addUndoChange(
 jobMeta, new JobHopMeta[] { before }, new JobHopMeta[] { after }, new int[] { jobMeta
origin: pentaho/pentaho-kettle

public JobHopMeta loadJobHopMeta( ObjectId id_job_hop, List<JobEntryCopy> jobcopies ) throws KettleException {
 JobHopMeta jobHopMeta = new JobHopMeta();
 try {
  RowMetaAndData r = getJobHop( id_job_hop );
  if ( r != null ) {
   long id_jobentry_copy_from = r.getInteger( "ID_JOBENTRY_COPY_FROM", -1L );
   long id_jobentry_copy_to = r.getInteger( "ID_JOBENTRY_COPY_TO", -1L );
   jobHopMeta.setEnabled( r.getBoolean( "ENABLED", true ) );
   jobHopMeta.setEvaluation( r.getBoolean( "EVALUATION", true ) );
   jobHopMeta.setConditional();
   if ( r.getBoolean( "UNCONDITIONAL", !jobHopMeta.getEvaluation() ) ) {
    jobHopMeta.setUnconditional();
   }
   jobHopMeta.setFromEntry( JobMeta.findJobEntryCopy( jobcopies, new LongObjectId( id_jobentry_copy_from ) ) );
   jobHopMeta.setToEntry( JobMeta.findJobEntryCopy( jobcopies, new LongObjectId( id_jobentry_copy_to ) ) );
   return jobHopMeta;
  } else {
   throw new KettleException( "Unable to find job hop with ID : " + id_job_hop );
  }
 } catch ( KettleDatabaseException dbe ) {
  throw new KettleException( BaseMessages.getString( PKG, "JobHopMeta.Exception.UnableToLoadHopInfoRep", ""
   + id_job_hop ), dbe );
 }
}
origin: pentaho/pentaho-kettle

private void addCandidateAsHop() {
 if ( hop_candidate != null ) {
  if ( !hop_candidate.getFromEntry().evaluates() && hop_candidate.getFromEntry().isUnconditional() ) {
   hop_candidate.setUnconditional();
  } else {
   hop_candidate.setConditional();
   int nr = jobMeta.findNrNextJobEntries( hop_candidate.getFromEntry() );
    JobEntryCopy jge = jobMeta.findNextJobEntry( hop_candidate.getFromEntry(), 0 );
    JobHopMeta other = jobMeta.findJobHop( hop_candidate.getFromEntry(), jge );
    if ( other != null ) {
     hop_candidate.setEvaluation( !other.getEvaluation() );
   boolean cancel = false;
   jobMeta.addJobHop( hop_candidate );
   if ( jobMeta.hasLoop( hop_candidate.getToEntry() ) ) {
    MessageBox mb = new MessageBox( spoon.getShell(), SWT.OK | SWT.CANCEL | SWT.ICON_WARNING );
    mb.setMessage( BaseMessages.getString( PKG, "JobGraph.Dialog.HopCausesLoop.Message" ) );
origin: pentaho/pentaho-kettle

  null,
  BaseMessages.getString( PKG, "TransGraph.Dialog.SplitHop.Message" )
   + Const.CR + hi.toString(),
  MessageDialog.QUESTION,
  new String[] {
if ( jobMeta.findJobHop( selectedEntry, hi.getFromEntry() ) == null
 && jobMeta.findJobHop( hi.getToEntry(), selectedEntry ) == null ) {
 if ( jobMeta.findJobHop( hi.getFromEntry(), selectedEntry, true ) == null ) {
  JobHopMeta newhop1 = new JobHopMeta( hi.getFromEntry(), selectedEntry );
  if ( hi.getFromEntry().getEntry().isUnconditional() ) {
   newhop1.setUnconditional();
   .indexOfJobHop( newhop1 ), }, true );
 if ( jobMeta.findJobHop( selectedEntry, hi.getToEntry(), true ) == null ) {
  JobHopMeta newhop2 = new JobHopMeta( selectedEntry, hi.getToEntry() );
  if ( selectedEntry.getEntry().isUnconditional() ) {
   newhop2.setUnconditional();
origin: pentaho/pentaho-kettle

/**
 * Find next job entry.
 *
 * @param from the from
 * @param cnt  the cnt
 * @return the job entry copy
 */
public JobEntryCopy findNextJobEntry( JobEntryCopy from, int cnt ) {
 int count = 0;
 for ( JobHopMeta hi : jobhops ) {
  // Look at all the hops
  if ( hi.isEnabled() && ( hi.getFromEntry() != null ) && hi.getFromEntry().equals( from ) ) {
   if ( count == cnt ) {
    return hi.getToEntry();
   }
   count++;
  }
 }
 return null;
}
origin: pentaho/pentaho-kettle

JobEntryCopy copyTo = jobMeta.findJobEntry( copyToName, copyToNr, true );
JobHopMeta jobHopMeta = new JobHopMeta( copyFrom, copyTo );
jobHopMeta.setEnabled( enabled );
jobHopMeta.setEvaluation( evaluation );
jobHopMeta.setUnconditional( unconditional );
jobMeta.addJobHop( jobHopMeta );
origin: pentaho/pentaho-kettle

protected void detach( JobEntryCopy je ) {
 JobHopMeta hfrom = jobMeta.findJobHopTo( je );
 JobHopMeta hto = jobMeta.findJobHopFrom( je );
 if ( hfrom != null && hto != null ) {
  if ( jobMeta.findJobHop( hfrom.getFromEntry(), hto.getToEntry() ) == null ) {
   JobHopMeta hnew = new JobHopMeta( hfrom.getFromEntry(), hto.getToEntry() );
   jobMeta.addJobHop( hnew );
   spoon.addUndoNew( jobMeta, new JobHopMeta[] { (JobHopMeta) hnew.clone() }, new int[] { jobMeta
    .indexOfJobHop( hnew ) } );
  }
 }
 if ( hfrom != null ) {
  int fromidx = jobMeta.indexOfJobHop( hfrom );
  if ( fromidx >= 0 ) {
   jobMeta.removeJobHop( fromidx );
   spoon.addUndoDelete( jobMeta, new JobHopMeta[] { hfrom }, new int[] { fromidx } );
  }
 }
 if ( hto != null ) {
  int toidx = jobMeta.indexOfJobHop( hto );
  if ( toidx >= 0 ) {
   jobMeta.removeJobHop( toidx );
   spoon.addUndoDelete( jobMeta, new JobHopMeta[] { hto }, new int[] { toidx } );
  }
 }
 spoon.refreshTree();
 redraw();
}
origin: pentaho/pentaho-kettle

public void flipHop() {
 selectionRegion = null;
 JobEntryCopy origFrom = currentHop.getFromEntry();
 JobEntryCopy origTo = currentHop.getToEntry();
 currentHop.setFromEntry( currentHop.getToEntry() );
 currentHop.setToEntry( origFrom );
 boolean cancel = false;
 if ( jobMeta.hasLoop( currentHop.getToEntry() ) ) {
  MessageBox mb = new MessageBox( shell, SWT.OK | SWT.CANCEL | SWT.ICON_WARNING );
  mb.setMessage( BaseMessages.getString( PKG, "JobGraph.Dialog.HopFlipCausesLoop.Message" ) );
  mb.setText( BaseMessages.getString( PKG, "JobGraph.Dialog.HopCausesLoop.Title" ) );
  int choice = mb.open();
  if ( choice == SWT.CANCEL ) {
   cancel = true;
   currentHop.setFromEntry( origFrom );
   currentHop.setToEntry( origTo );
  }
 }
 if ( !cancel ) {
  currentHop.setChanged();
 }
 spoon.refreshGraph();
 spoon.refreshTree();
 spoon.setShellText();
}
origin: pentaho/pentaho-kettle

protected void drawJobHop( JobHopMeta hop, boolean candidate ) {
 if ( hop == null || hop.getFromEntry() == null || hop.getToEntry() == null ) {
  return;
 }
 if ( !hop.getFromEntry().isDrawn() || !hop.getToEntry().isDrawn() ) {
  return;
 }
 drawLine( hop, candidate );
}
origin: pentaho/pentaho-kettle

public void deleteJobEntryCopies( JobMeta jobMeta, JobEntryCopy jobEntry ) {
 for ( int i = jobMeta.nrJobHops() - 1; i >= 0; i-- ) {
  JobHopMeta hi = jobMeta.getJobHop( i );
  if ( hi.getFromEntry().equals( jobEntry ) || hi.getToEntry().equals( jobEntry ) ) {
   int idx = jobMeta.indexOfJobHop( hi );
   spoon.addUndoDelete( jobMeta, new JobHopMeta[] { (JobHopMeta) hi.clone() }, new int[] { idx } );
   jobMeta.removeJobHop( idx );
   spoon.refreshTree();
  }
 }
 int pos = jobMeta.indexOfJobEntry( jobEntry );
 jobMeta.removeJobEntry( pos );
 spoon.addUndoDelete( jobMeta, new JobEntryCopy[] { jobEntry }, new int[] { pos } );
 spoon.refreshTree();
 spoon.refreshGraph();
}
origin: pentaho/pentaho-kettle

if ( !hi.getFromEntry().equals( selectedEntry ) && !hi.getToEntry().equals( selectedEntry ) ) {
 split_hop = true;
 last_hop_split = hi;
   hop_candidate = new JobHopMeta( startHopEntry, jobEntryCopy );
   endHopLocation = null;
  } else {
  hop_candidate = new JobHopMeta( jobEntryCopy, endHopEntry );
  endHopLocation = null;
origin: pentaho/pentaho-kettle

public void disableHop() {
 selectionRegion = null;
 boolean orig = currentHop.isEnabled();
 currentHop.setEnabled( !currentHop.isEnabled() );
 if ( !orig && ( jobMeta.hasLoop( currentHop.getToEntry() ) ) ) {
  MessageBox mb = new MessageBox( shell, SWT.CANCEL | SWT.OK | SWT.ICON_WARNING );
  mb.setMessage( BaseMessages.getString( PKG, "JobGraph.Dialog.LoopAfterHopEnabled.Message" ) );
  mb.setText( BaseMessages.getString( PKG, "JobGraph.Dialog.LoopAfterHopEnabled.Title" ) );
  int choice = mb.open();
  if ( choice == SWT.CANCEL ) {
   currentHop.setEnabled( orig );
  }
 }
 spoon.refreshGraph();
 spoon.refreshTree();
}
origin: pentaho/pentaho-kettle

public void newJobHop( JobMeta jobMeta, JobEntryCopy fr, JobEntryCopy to ) {
 JobHopMeta hi = new JobHopMeta( fr, to );
 jobMeta.addJobHop( hi );
 spoon.addUndoNew( jobMeta, new JobHopMeta[] { hi }, new int[] { jobMeta.indexOfJobHop( hi ) } );
 spoon.refreshGraph();
 spoon.refreshTree();
}
origin: pentaho/pdi-sdk-plugins

jobMeta.addJobHop( new JobHopMeta( startEntry, writeToLogEntry ) );
JobHopMeta greenHop = new JobHopMeta( writeToLogEntry, successEntry );
greenHop.setEvaluation( true );
jobMeta.addJobHop( greenHop );
JobHopMeta redHop = new JobHopMeta( writeToLogEntry, abortEntry );
redHop.setEvaluation( false );
jobMeta.addJobHop( redHop );
origin: pentaho/pentaho-kettle

public void enableDisableHopsDownstream( boolean enabled ) {
 if ( currentHop == null ) {
  return;
 }
 JobHopMeta before = (JobHopMeta) currentHop.clone();
 currentHop.setEnabled( enabled );
 JobHopMeta after = (JobHopMeta) currentHop.clone();
 spoon.addUndoChange( jobMeta, new JobHopMeta[] { before }, new JobHopMeta[] { after }, new int[] { jobMeta
  .indexOfJobHop( currentHop ) } );
 Set<JobEntryCopy> checkedEntries = enableDisableNextHops( currentHop.getToEntry(), enabled, new HashSet<>() );
 if ( checkedEntries.stream().anyMatch( entry -> jobMeta.hasLoop( entry ) ) ) {
  MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_WARNING );
  mb.setMessage( BaseMessages.getString( PKG, "JobGraph.Dialog.LoopAfterHopEnabled.Message" ) );
  mb.setText( BaseMessages.getString( PKG, "JobGraph.Dialog.LoopAfterHopEnabled.Title" ) );
  mb.open();
 }
 spoon.refreshGraph();
}
org.pentaho.di.jobJobHopMeta

Javadoc

This class defines a hop from one job entry copy to another.

Most used methods

  • <init>
  • setEvaluation
  • getEvaluation
  • getFromEntry
  • getToEntry
  • isEnabled
  • isUnconditional
  • setEnabled
  • setUnconditional
  • clone
  • setChanged
  • setConditional
  • setChanged,
  • setConditional,
  • setFromEntry,
  • setToEntry,
  • toString,
  • getDescription,
  • getXML,
  • hasChanged,
  • isSplit,
  • setObjectId

Popular in Java

  • Reading from database using SQL prepared statement
  • getExternalFilesDir (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now