/** * Searches the list of steps for a step with a certain name. * * @param name * The name of the step to look for * @return The step information or null if no nothing was found. */ public StepMeta findStep( String name ) { return findStep( name, null ); }
public void run() { StepMeta stepMeta = transMeta.findStep( stepname ); if ( stepMeta != null ) { setComboBoxes(); } } };
/** * Counts the number of previous steps for a step name. * * @param stepname * The name of the step to start from * @return The number of preceding steps. * @deprecated */ @Deprecated public int findNrPrevSteps( String stepname ) { return findNrPrevSteps( findStep( stepname ), false ); }
/** * Find the fields that are entering a step with a certain name. * * @param stepname * The name of the step queried * @return A row containing the fields (w/ origin) entering the step * @throws KettleStepException * the kettle step exception */ public RowMetaInterface getPrevStepFields( String stepname ) throws KettleStepException { return getPrevStepFields( findStep( stepname ) ); }
/** * Retrieve an array of succeeding step names for a certain originating step name. * * @param stepname * The originating step name * @return An array of succeeding step names */ public String[] getPrevStepNames( String stepname ) { return getPrevStepNames( findStep( stepname ) ); }
/** * Find the informational fields coming from an informational step into the step specified. * * @param stepname * The name of the step * @return A row containing fields with origin. * @throws KettleStepException * the kettle step exception */ public RowMetaInterface getPrevInfoFields( String stepname ) throws KettleStepException { return getPrevInfoFields( findStep( stepname ) ); }
/** * Return the fields that are emitted by a step with a certain name. * * @param stepname * The name of the step that's being queried. * @param row * A row containing the input fields or an empty row if no input is required. * @return A Row containing the output fields. * @throws KettleStepException * the kettle step exception */ public RowMetaInterface getThisStepFields( String stepname, RowMetaInterface row ) throws KettleStepException { return getThisStepFields( findStep( stepname ), null, row ); }
/** * Counts the number of previous steps for a step name taking into account whether or not they are informational. * * @param stepname * The name of the step to start from * @param info * true if only the informational steps are desired, false otherwise * @return The number of preceding steps. * @deprecated */ @Deprecated public int findNrPrevSteps( String stepname, boolean info ) { return findNrPrevSteps( findStep( stepname ), info ); }
/** * Find the previous step on a certain location (i.e. the specified index). * * @param stepname * The source step name * @param nr * the index into the step list * * @return The preceding step found. * @deprecated */ @Deprecated public StepMeta findPrevStep( String stepname, int nr ) { return findPrevStep( findStep( stepname ), nr ); }
private List<String> getOutputFieldNames( final TransMeta transMeta, final String stepName ) { final Map<String, RowMetaInterface> targetFieldsMap = getOutputRowMetaInterfaces( transMeta, transMeta.findStep( stepName ), null, false ); final List<String> targetFieldNames = new ArrayList(); if ( targetFieldsMap != null ) { final List<ValueMetaInterface> fieldValues = targetFieldsMap.values().iterator().next().getValueMetaList(); for ( final ValueMetaInterface fieldValue : fieldValues ) { targetFieldNames.add( fieldValue.getName() ); } } return targetFieldNames; }
private void ok() { if ( Utils.isEmpty( wStepname.getText() ) ) { return; } List<StreamInterface> infoStreams = input.getStepIOMeta().getInfoStreams(); StreamInterface headStream = infoStreams.get( 0 ); StreamInterface tailStream = infoStreams.get( 1 ); headStream.setStepMeta( transMeta.findStep( wHeadHop.getText() ) ); tailStream.setStepMeta( transMeta.findStep( wTailHop.getText() ) ); stepname = wStepname.getText(); // return value dispose(); } }
public void setFlags() { wlIgnoreFlagField.setEnabled( wErrorIgnored.getSelection() ); wIgnoreFlagField.setEnabled( wErrorIgnored.getSelection() ); DatabaseMeta databaseMeta = transMeta.findDatabase( wConnection.getText() ); boolean hasErrorHandling = transMeta.findStep( stepname ).isDoingErrorHandling(); // Can't use batch yet when grabbing auto-generated keys... // Only enable batch option when not returning keys. // If we are on PostgreSQL (and look-a-likes), error handling is not supported. (PDI-366) // boolean enableBatch = wBatch.getSelection() && !transMeta.isUsingUniqueConnections(); enableBatch = enableBatch && !( databaseMeta != null && databaseMeta.supportsErrorHandlingOnBatchUpdates() && hasErrorHandling ); }
private void ok() { if ( Utils.isEmpty( wStepname.getText() ) ) { return; } stepname = wStepname.getText(); // return value String trueStepname = Const.NVL( wTrueTo.getText(), null ); String falseStepname = Const.NVL( wFalseTo.getText(), null ); List<StreamInterface> targetStreams = input.getStepIOMeta().getTargetStreams(); targetStreams.get( 0 ).setStepMeta( transMeta.findStep( trueStepname ) ); targetStreams.get( 1 ).setStepMeta( transMeta.findStep( falseStepname ) ); input.setCondition( wCondition.getText() ); dispose(); } }
public void run() { StepMeta stepMeta = transMeta.findStep( stepname ); if ( stepMeta != null ) { try { inputFields = transMeta.getPrevStepFields( stepMeta ); setComboBoxes(); } catch ( KettleException e ) { logError( BaseMessages.getString( PKG, "ClosureGeneratorDialog.Log.UnableToFindInput" ) ); } } } };
public void run() { StepMeta stepMeta = transMeta.findStep( stepname ); if ( stepMeta != null ) { try { RowMetaInterface row = transMeta.getPrevStepFields( stepMeta ); // Remember these fields... for ( int i = 0; i < row.size(); i++ ) { inputFields.put( row.getValueMeta( i ).getName(), Integer.valueOf( i ) ); } setComboBoxes(); } catch ( KettleException e ) { logError( BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Message" ) ); } } } };
private void ok() { if ( Utils.isEmpty( wStepname.getText() ) ) { return; } if ( wCondition.getLevel() > 0 ) { wCondition.goUp(); } else { stepname = wStepname.getText(); // return value input.setPrefix( wPrefix.getText() ); input.setDirectory( wSortDir.getText() ); input.setCacheSize( Const.toInt( wCache.getText(), -1 ) ); input.setMainStep( transMeta.findStep( wMainStep.getText() ) ); dispose(); } }
@Test public void testGetStep() { StepMeta mockStepMeta = mock( StepMeta.class ); when( mockStepMeta.getName() ).thenReturn( "testName" ); StepDataInterface mockStepDataInterface = mock( StepDataInterface.class ); int cnr = 10; TransMeta mockTransMeta = mock( TransMeta.class ); Trans mockTrans = mock( Trans.class ); when( mockTransMeta.findStep( "testName" ) ).thenReturn( mockStepMeta ); StepInterface step = new UnivariateStatsMeta().getStep( mockStepMeta, mockStepDataInterface, cnr, mockTransMeta, mockTrans ); assertTrue( "Expected Step to be instanceof " + UnivariateStats.class, step instanceof UnivariateStats ); }
public void run() { StepMeta stepMeta = transMeta.findStep( stepname ); if ( stepMeta != null ) { try { RowMetaInterface row = transMeta.getPrevStepFields( stepMeta ); // Remember these fields... for ( int i = 0; i < row.size(); i++ ) { inputFields.put( row.getValueMeta( i ).getName(), i ); } setComboBoxes(); } catch ( KettleException e ) { logError( BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Message" ) ); } } } };
private void getInfo( TableInputMeta meta, boolean preview ) { meta.setSQL( preview && !Utils.isEmpty( wSQL.getSelectionText() ) ? wSQL.getSelectionText() : wSQL.getText() ); meta.setDatabaseMeta( transMeta.findDatabase( wConnection.getText() ) ); meta.setRowLimit( wLimit.getText() ); StreamInterface infoStream = input.getStepIOMeta().getInfoStreams().get( 0 ); infoStream.setStepMeta( transMeta.findStep( wDatefrom.getText() ) ); meta.setExecuteEachInputRow( wEachRow.getSelection() ); meta.setVariableReplacementActive( wVariables.getSelection() ); meta.setLazyConversionActive( wLazyConversion.getSelection() ); }
public void run() { StepMeta stepMeta = transMeta.findStep( stepname ); if ( stepMeta != null ) { try { inputRowMeta = transMeta.getPrevStepFields( stepMeta ); infoRowMeta = transMeta.getPrevInfoFields( stepMeta ); outputRowMeta = transMeta.getThisStepFields( stepMeta, null, inputRowMeta.clone() ); populateFieldsTree(); } catch ( KettleException e ) { log.logError( BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Message" ), e ); } } } };