AnsweredAssumed Answered

Outgoing fields not showing in pentaho plugin

Question asked by Prabhakar Pandey on Aug 17, 2018

have created a step plugin for pentaho which gives some output fields. It gets 2 Input fields from previous steps add some metadata and output fields . Although output is being sent to next step but when i do right click and click on output fields it only show field and value from previous steps not from the step plugin i created. Below is the Java Code for Meta class.

import org.eclipse.swt.widgets.Shell;import org.pentaho.di.core.annotations.Step;import org.pentaho.di.core.exception.KettleStepException;import org.pentaho.di.core.row.RowMeta;import org.pentaho.di.core.row.RowMetaInterface;import org.pentaho.di.core.row.ValueMeta;import org.pentaho.di.core.row.ValueMetaInterface;import org.pentaho.di.core.variables.VariableSpace;import org.pentaho.di.repository.Repository;import org.pentaho.di.trans.Trans;import org.pentaho.di.trans.TransMeta;import org.pentaho.di.trans.step.*;import org.pentaho.metastore.api.IMetaStore; @Step(        id = "FlatJson",        image = "com/cxps/flatjson/steps/resources/demo.svg",        i18nPackageName = "com.cxps.flatjson",        name = "FlatJson.name",        description = "FlatJson.description",        categoryDescription = "i18n:org.pentaho.di.trans.step:BaseStep.Category.Transform")public class FlatJsonMeta extends BaseStepMeta implements StepMetaInterface {    public FlatJsonMeta() {        super();    }     @Override    public void setDefault() {     }     @Override    public StepInterface getStep(StepMeta stepMeta, StepDataInterface sdi, int i, TransMeta transMeta, Trans trans) {        return new FlatJson(stepMeta, sdi, i, transMeta, trans);    }     @Override    public StepDataInterface getStepData() {        return new FlatJsonData();    }     public StepDialogInterface getDialog(Shell shell, StepMetaInterface smi, TransMeta transMeta, String name) {        return new FlatJsonDialog(shell, smi, transMeta, name);    }     @Override    public void getFields(RowMetaInterface r, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {        //RowMetaInterface fields = new RowMeta();        //fields.addRowMeta(r);          super.getFields(r, origin, info, nextStep, space, repository, metaStore);    }     @Override    public Object clone() {        FlatJsonMeta retVal = (FlatJsonMeta) super.clone();        return retVal;    }}
import org.eclipse.swt.widgets.Shell;import org.pentaho.di.core.annotations.Step;import org.pentaho.di.core.exception.KettleStepException;import org.pentaho.di.core.row.RowMeta;import org.pentaho.di.core.row.RowMetaInterface;import org.pentaho.di.core.row.ValueMeta;import org.pentaho.di.core.row.ValueMetaInterface;import org.pentaho.di.core.variables.VariableSpace;import org.pentaho.di.repository.Repository;import org.pentaho.di.trans.Trans;import org.pentaho.di.trans.TransMeta;import org.pentaho.di.trans.step.*;import org.pentaho.metastore.api.IMetaStore; @Step(        id = "FlatJson",        image = "com/cxps/flatjson/steps/resources/demo.svg",        i18nPackageName = "com.cxps.flatjson",        name = "FlatJson.name",        description = "FlatJson.description",        categoryDescription = "i18n:org.pentaho.di.trans.step:BaseStep.Category.Transform")public class FlatJsonMeta extends BaseStepMeta implements StepMetaInterface {    public FlatJsonMeta() {        super();    }     @Override    public void setDefault() {     }     @Override    public StepInterface getStep(StepMeta stepMeta, StepDataInterface sdi, int i, TransMeta transMeta, Trans trans) {        return new FlatJson(stepMeta, sdi, i, transMeta, trans);    }     @Override    public StepDataInterface getStepData() {        return new FlatJsonData();    }     public StepDialogInterface getDialog(Shell shell, StepMetaInterface smi, TransMeta transMeta, String name) {        return new FlatJsonDialog(shell, smi, transMeta, name);    }     @Override    public void getFields(RowMetaInterface r, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {        //RowMetaInterface fields = new RowMeta();        //fields.addRowMeta(r);          super.getFields(r, origin, info, nextStep, space, repository, metaStore);    }     @Override    public Object clone() {        FlatJsonMeta retVal = (FlatJsonMeta) super.clone();        return retVal;    }}

This is the Spoon view of my plugin which doesn't show output fields.

https://i.stack.imgur.com/WJT0g.png

Outcomes