Search in sources :

Example 31 with StreamInterface

use of org.pentaho.di.trans.step.errorhandling.StreamInterface in project pentaho-kettle by pentaho.

the class ValidatorMeta method searchInfoAndTargetSteps.

@Override
public void searchInfoAndTargetSteps(List<StepMeta> steps) {
    for (StreamInterface stream : getStepIOMeta().getInfoStreams()) {
        Validation validation = (Validation) stream.getSubject();
        StepMeta stepMeta = StepMeta.findStep(steps, validation.getSourcingStepName());
        validation.setSourcingStep(stepMeta);
    }
    resetStepIoMeta();
}
Also used : StepMeta(org.pentaho.di.trans.step.StepMeta) BaseStepMeta(org.pentaho.di.trans.step.BaseStepMeta) StreamInterface(org.pentaho.di.trans.step.errorhandling.StreamInterface)

Example 32 with StreamInterface

use of org.pentaho.di.trans.step.errorhandling.StreamInterface in project pentaho-kettle by pentaho.

the class ValidatorMeta method getStepIOMeta.

/**
 * Returns the Input/Output metadata for this step.
 */
public StepIOMetaInterface getStepIOMeta() {
    if (ioMeta == null) {
        ioMeta = new StepIOMeta(true, true, false, false, true, false);
        // 
        for (Validation validation : validations) {
            StreamInterface stream = new Stream(StreamType.INFO, validation.getSourcingStep(), BaseMessages.getString(PKG, "ValidatorMeta.InfoStream.ValidationInput.Description", Const.NVL(validation.getName(), "")), StreamIcon.INFO, validation);
            ioMeta.addStream(stream);
        }
    }
    return ioMeta;
}
Also used : StepIOMeta(org.pentaho.di.trans.step.StepIOMeta) Stream(org.pentaho.di.trans.step.errorhandling.Stream) StreamInterface(org.pentaho.di.trans.step.errorhandling.StreamInterface)

Example 33 with StreamInterface

use of org.pentaho.di.trans.step.errorhandling.StreamInterface in project pentaho-kettle by pentaho.

the class StreamLookupMeta method getStepIOMeta.

/**
 * Returns the Input/Output metadata for this step. The generator step only produces output, does not accept input!
 */
@Override
public StepIOMetaInterface getStepIOMeta() {
    if (ioMeta == null) {
        ioMeta = new StepIOMeta(true, true, false, false, false, false);
        StreamInterface stream = new Stream(StreamType.INFO, null, BaseMessages.getString(PKG, "StreamLookupMeta.InfoStream.Description"), StreamIcon.INFO, null);
        ioMeta.addStream(stream);
    }
    return ioMeta;
}
Also used : StepIOMeta(org.pentaho.di.trans.step.StepIOMeta) Stream(org.pentaho.di.trans.step.errorhandling.Stream) StreamInterface(org.pentaho.di.trans.step.errorhandling.StreamInterface)

Example 34 with StreamInterface

use of org.pentaho.di.trans.step.errorhandling.StreamInterface in project pentaho-kettle by pentaho.

the class SwitchCaseMeta method check.

public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
    CheckResult cr;
    StepIOMetaInterface ioMeta = getStepIOMeta();
    for (StreamInterface stream : ioMeta.getTargetStreams()) {
        SwitchCaseTarget target = (SwitchCaseTarget) stream.getSubject();
        if (target != null && target.caseTargetStep == null) {
            cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "SwitchCaseMeta.CheckResult.TargetStepInvalid", "false", target.caseTargetStepname), stepMeta);
            remarks.add(cr);
        }
    }
    if (Utils.isEmpty(fieldname)) {
        cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "SwitchCaseMeta.CheckResult.NoFieldSpecified"), stepMeta);
    } else {
        cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "SwitchCaseMeta.CheckResult.FieldSpecified"), stepMeta);
    }
    remarks.add(cr);
    // See if we have input streams leading to this step!
    if (input.length > 0) {
        cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "SwitchCaseMeta.CheckResult.StepReceivingInfoFromOtherSteps"), stepMeta);
        remarks.add(cr);
    } else {
        cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "SwitchCaseMeta.CheckResult.NoInputReceivedFromOtherSteps"), stepMeta);
        remarks.add(cr);
    }
}
Also used : CheckResult(org.pentaho.di.core.CheckResult) StepIOMetaInterface(org.pentaho.di.trans.step.StepIOMetaInterface) StreamInterface(org.pentaho.di.trans.step.errorhandling.StreamInterface)

Example 35 with StreamInterface

use of org.pentaho.di.trans.step.errorhandling.StreamInterface in project pentaho-kettle by pentaho.

the class SwitchCaseMeta method searchInfoAndTargetSteps.

@Override
public void searchInfoAndTargetSteps(List<StepMeta> steps) {
    for (StreamInterface stream : getStepIOMeta().getTargetStreams()) {
        SwitchCaseTarget target = (SwitchCaseTarget) stream.getSubject();
        if (target != null) {
            StepMeta stepMeta = StepMeta.findStep(steps, target.caseTargetStepname);
            target.caseTargetStep = stepMeta;
        }
    }
    defaultTargetStep = StepMeta.findStep(steps, defaultTargetStepname);
    resetStepIoMeta();
}
Also used : StepMeta(org.pentaho.di.trans.step.StepMeta) BaseStepMeta(org.pentaho.di.trans.step.BaseStepMeta) StreamInterface(org.pentaho.di.trans.step.errorhandling.StreamInterface)

Aggregations

StreamInterface (org.pentaho.di.trans.step.errorhandling.StreamInterface)84 KettleException (org.pentaho.di.core.exception.KettleException)31 KettleStepException (org.pentaho.di.core.exception.KettleStepException)26 KettleXMLException (org.pentaho.di.core.exception.KettleXMLException)19 StepIOMetaInterface (org.pentaho.di.trans.step.StepIOMetaInterface)19 StepMeta (org.pentaho.di.trans.step.StepMeta)19 Stream (org.pentaho.di.trans.step.errorhandling.Stream)10 TableItem (org.eclipse.swt.widgets.TableItem)8 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)8 Test (org.junit.Test)7 CheckResult (org.pentaho.di.core.CheckResult)7 KettleRowException (org.pentaho.di.core.exception.KettleRowException)7 BaseStepMeta (org.pentaho.di.trans.step.BaseStepMeta)7 ArrayList (java.util.ArrayList)6 TransHopMeta (org.pentaho.di.trans.TransHopMeta)6 StepIOMeta (org.pentaho.di.trans.step.StepIOMeta)6 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)5 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)5 Point (org.pentaho.di.core.gui.Point)5 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)5