Search in sources :

Example 1 with DummyTrans

use of org.pentaho.di.trans.steps.dummytrans.DummyTrans in project pdi-dataservice-server-plugin by pentaho.

the class AnnotationsQueryServiceTest method createPseudoAnnotate.

private DummyTransMeta createPseudoAnnotate(final ModelAnnotationGroup mag) {
    final String magicKey = "KEY_MODEL_ANNOTATIONS";
    DummyTransMeta annot1Meta = new DummyTransMeta() {

        @Override
        public StepInterface getStep(StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr, final Trans trans) {
            return new DummyTrans(stepMeta, stepDataInterface, cnr, tr, trans) {

                @Override
                public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
                    ModelAnnotationGroup existing = (ModelAnnotationGroup) trans.getExtensionDataMap().get(magicKey);
                    if (existing == null) {
                        trans.getExtensionDataMap().put(magicKey, mag);
                    } else {
                        existing.addAll(mag);
                    }
                    return true;
                }
            };
        }
    };
    return annot1Meta;
}
Also used : ModelAnnotationGroup(org.pentaho.agilebi.modeler.models.annotations.ModelAnnotationGroup) TransMeta(org.pentaho.di.trans.TransMeta) DummyTransMeta(org.pentaho.di.trans.steps.dummytrans.DummyTransMeta) StepMetaInterface(org.pentaho.di.trans.step.StepMetaInterface) StepMeta(org.pentaho.di.trans.step.StepMeta) StepDataInterface(org.pentaho.di.trans.step.StepDataInterface) Trans(org.pentaho.di.trans.Trans) DummyTrans(org.pentaho.di.trans.steps.dummytrans.DummyTrans) DummyTransMeta(org.pentaho.di.trans.steps.dummytrans.DummyTransMeta) DummyTrans(org.pentaho.di.trans.steps.dummytrans.DummyTrans)

Aggregations

ModelAnnotationGroup (org.pentaho.agilebi.modeler.models.annotations.ModelAnnotationGroup)1 Trans (org.pentaho.di.trans.Trans)1 TransMeta (org.pentaho.di.trans.TransMeta)1 StepDataInterface (org.pentaho.di.trans.step.StepDataInterface)1 StepMeta (org.pentaho.di.trans.step.StepMeta)1 StepMetaInterface (org.pentaho.di.trans.step.StepMetaInterface)1 DummyTrans (org.pentaho.di.trans.steps.dummytrans.DummyTrans)1 DummyTransMeta (org.pentaho.di.trans.steps.dummytrans.DummyTransMeta)1