Search in sources :

Example 1 with CheckStepsExtension

use of org.pentaho.di.trans.CheckStepsExtension in project pdi-dataservice-server-plugin by pentaho.

the class StepValidationExtensionPointPlugin method callExtensionPoint.

@Override
public void callExtensionPoint(LogChannelInterface log, Object o) throws KettleException {
    if (!validInputs(o, log)) {
        return;
    }
    CheckStepsExtension checkStepExtension = (CheckStepsExtension) o;
    TransMeta transMeta = checkStepExtension.getTransMeta();
    for (StepValidation stepValidation : getStepValidations()) {
        StepMeta stepMeta = checkStepExtension.getStepMetas()[0];
        if (stepValidation.supportsStep(stepMeta, log)) {
            DataServiceMeta dataServiceMeta = metaStoreUtil.getDataServiceByStepName(transMeta, stepMeta.getName());
            if (dataServiceMeta == null) {
                // We won't validate Trans not associated with a DataService
                return;
            }
            stepValidation.checkStep(checkStepExtension, dataServiceMeta, log);
        }
    }
}
Also used : DataServiceMeta(org.pentaho.di.trans.dataservice.DataServiceMeta) CheckStepsExtension(org.pentaho.di.trans.CheckStepsExtension) TransMeta(org.pentaho.di.trans.TransMeta) StepMeta(org.pentaho.di.trans.step.StepMeta)

Example 2 with CheckStepsExtension

use of org.pentaho.di.trans.CheckStepsExtension in project pdi-dataservice-server-plugin by pentaho.

the class BaseStepValidationTest method before.

@Before
public void before() throws KettleStepException {
    stepMetas[0] = stepMeta;
    space = new Variables();
    checkStepsExtension = new CheckStepsExtension(remarks, space, transMeta, stepMetas, repository, metaStore);
    pushDownOptMetas = new ArrayList<PushDownOptimizationMeta>();
    when(dataServiceMeta.getPushDownOptimizationMeta()).thenReturn(pushDownOptMetas);
    init();
}
Also used : Variables(org.pentaho.di.core.variables.Variables) CheckStepsExtension(org.pentaho.di.trans.CheckStepsExtension) PushDownOptimizationMeta(org.pentaho.di.trans.dataservice.optimization.PushDownOptimizationMeta) Before(org.junit.Before)

Aggregations

CheckStepsExtension (org.pentaho.di.trans.CheckStepsExtension)2 Before (org.junit.Before)1 Variables (org.pentaho.di.core.variables.Variables)1 TransMeta (org.pentaho.di.trans.TransMeta)1 DataServiceMeta (org.pentaho.di.trans.dataservice.DataServiceMeta)1 PushDownOptimizationMeta (org.pentaho.di.trans.dataservice.optimization.PushDownOptimizationMeta)1 StepMeta (org.pentaho.di.trans.step.StepMeta)1