Search in sources :

Example 1 with SingleThreaderMeta

use of org.pentaho.di.trans.steps.singlethreader.SingleThreaderMeta in project pentaho-kettle by pentaho.

the class TransMeta method setRepositoryOnMappingSteps.

/**
 * Set the Repository object on the Mapping step That way the mapping step can determine the output fields for
 * repository hosted mappings... This is the exception to the rule so we don't pass this through the getFields()
 * method. TODO: figure out a way to make this more generic.
 */
private void setRepositoryOnMappingSteps() {
    for (StepMeta step : steps) {
        if (step.getStepMetaInterface() instanceof MappingMeta) {
            ((MappingMeta) step.getStepMetaInterface()).setRepository(repository);
            ((MappingMeta) step.getStepMetaInterface()).setMetaStore(metaStore);
        }
        if (step.getStepMetaInterface() instanceof SingleThreaderMeta) {
            ((SingleThreaderMeta) step.getStepMetaInterface()).setRepository(repository);
            ((SingleThreaderMeta) step.getStepMetaInterface()).setMetaStore(metaStore);
        }
        if (step.getStepMetaInterface() instanceof JobExecutorMeta) {
            ((JobExecutorMeta) step.getStepMetaInterface()).setRepository(repository);
            ((JobExecutorMeta) step.getStepMetaInterface()).setMetaStore(metaStore);
        }
        if (step.getStepMetaInterface() instanceof TransExecutorMeta) {
            ((TransExecutorMeta) step.getStepMetaInterface()).setRepository(repository);
            ((TransExecutorMeta) step.getStepMetaInterface()).setMetaStore(metaStore);
        }
    }
}
Also used : JobExecutorMeta(org.pentaho.di.trans.steps.jobexecutor.JobExecutorMeta) TransExecutorMeta(org.pentaho.di.trans.steps.transexecutor.TransExecutorMeta) MappingMeta(org.pentaho.di.trans.steps.mapping.MappingMeta) SingleThreaderMeta(org.pentaho.di.trans.steps.singlethreader.SingleThreaderMeta) StepMeta(org.pentaho.di.trans.step.StepMeta)

Example 2 with SingleThreaderMeta

use of org.pentaho.di.trans.steps.singlethreader.SingleThreaderMeta in project pentaho-kettle by pentaho.

the class SingleThreaderDialog method getParameters.

protected void getParameters(TransMeta mappingTransMeta) {
    try {
        if (mappingTransMeta == null) {
            SingleThreaderMeta jet = new SingleThreaderMeta();
            getInfo(jet);
            mappingTransMeta = SingleThreaderMeta.loadSingleThreadedTransMeta(jet, repository, transMeta);
        }
        String[] parameters = mappingTransMeta.listParameters();
        String[] existing = wParameters.getItems(1);
        for (int i = 0; i < parameters.length; i++) {
            if (Const.indexOfString(parameters[i], existing) < 0) {
                TableItem item = new TableItem(wParameters.table, SWT.NONE);
                item.setText(1, parameters[i]);
            }
        }
        wParameters.removeEmptyRows();
        wParameters.setRowNums();
        wParameters.optWidth(true);
    } catch (Exception e) {
        new ErrorDialog(shell, BaseMessages.getString(PKG, "SingleThreaderDialog.Exception.UnableToLoadTransformation.Title"), BaseMessages.getString(PKG, "SingleThreaderDialog.Exception.UnableToLoadTransformation.Message"), e);
    }
}
Also used : TableItem(org.eclipse.swt.widgets.TableItem) SingleThreaderMeta(org.pentaho.di.trans.steps.singlethreader.SingleThreaderMeta) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) KettleException(org.pentaho.di.core.exception.KettleException) IOException(java.io.IOException)

Aggregations

SingleThreaderMeta (org.pentaho.di.trans.steps.singlethreader.SingleThreaderMeta)2 IOException (java.io.IOException)1 TableItem (org.eclipse.swt.widgets.TableItem)1 KettleException (org.pentaho.di.core.exception.KettleException)1 StepMeta (org.pentaho.di.trans.step.StepMeta)1 JobExecutorMeta (org.pentaho.di.trans.steps.jobexecutor.JobExecutorMeta)1 MappingMeta (org.pentaho.di.trans.steps.mapping.MappingMeta)1 TransExecutorMeta (org.pentaho.di.trans.steps.transexecutor.TransExecutorMeta)1 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)1