use of org.pentaho.di.trans.step.errorhandling.Stream in project pentaho-kettle by pentaho.
the class FuzzyMatchMeta method getStepIOMeta.
/**
* Returns the Input/Output metadata for this step. The generator step only produces output, does not accept input!
*/
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, "FuzzyMatchMeta.InfoStream.Description"), StreamIcon.INFO, null);
ioMeta.addStream(stream);
}
return ioMeta;
}
use of org.pentaho.di.trans.step.errorhandling.Stream in project pentaho-kettle by pentaho.
the class JavaFilterMeta method getStepIOMeta.
/**
* Returns the Input/Output metadata for this step.
*/
public StepIOMetaInterface getStepIOMeta() {
if (ioMeta == null) {
ioMeta = new StepIOMeta(true, true, false, false, false, false);
ioMeta.addStream(new Stream(StreamType.TARGET, null, BaseMessages.getString(PKG, "JavaFilterMeta.InfoStream.True.Description"), StreamIcon.TRUE, null));
ioMeta.addStream(new Stream(StreamType.TARGET, null, BaseMessages.getString(PKG, "JavaFilterMeta.InfoStream.False.Description"), StreamIcon.FALSE, null));
}
return ioMeta;
}
use of org.pentaho.di.trans.step.errorhandling.Stream in project pentaho-kettle by pentaho.
the class JobExecutorMeta method getStepIOMeta.
@Override
public StepIOMetaInterface getStepIOMeta() {
if (ioMeta == null) {
ioMeta = new StepIOMeta(true, true, true, false, true, false);
ioMeta.addStream(new Stream(StreamType.TARGET, executionResultTargetStepMeta, BaseMessages.getString(PKG, "JobExecutorMeta.ResultStream.Description"), StreamIcon.TARGET, null));
ioMeta.addStream(new Stream(StreamType.TARGET, resultRowsTargetStepMeta, BaseMessages.getString(PKG, "JobExecutorMeta.ResultRowsStream.Description"), StreamIcon.TARGET, null));
ioMeta.addStream(new Stream(StreamType.TARGET, resultFilesTargetStepMeta, BaseMessages.getString(PKG, "JobExecutorMeta.ResultFilesStream.Description"), StreamIcon.TARGET, null));
}
return ioMeta;
}
use of org.pentaho.di.trans.step.errorhandling.Stream in project pentaho-kettle by pentaho.
the class TransGraph method addCandidateAsHop.
private void addCandidateAsHop(int mouseX, int mouseY) {
boolean forward = startHopStep != null;
StepMeta fromStep = candidate.getFromStep();
StepMeta toStep = candidate.getToStep();
// See what the options are.
// - Does the source step has multiple stream options?
// - Does the target step have multiple input stream options?
//
List<StreamInterface> streams = new ArrayList<>();
StepIOMetaInterface fromIoMeta = fromStep.getStepMetaInterface().getStepIOMeta();
List<StreamInterface> targetStreams = fromIoMeta.getTargetStreams();
if (forward) {
streams.addAll(targetStreams);
}
StepIOMetaInterface toIoMeta = toStep.getStepMetaInterface().getStepIOMeta();
List<StreamInterface> infoStreams = toIoMeta.getInfoStreams();
if (!forward) {
streams.addAll(infoStreams);
}
if (forward) {
if (fromIoMeta.isOutputProducer() && toStep.equals(currentStep)) {
streams.add(new Stream(StreamType.OUTPUT, fromStep, BaseMessages.getString(PKG, "Spoon.Hop.MainOutputOfStep"), StreamIcon.OUTPUT, null));
}
if (fromStep.supportsErrorHandling() && toStep.equals(currentStep)) {
streams.add(new Stream(StreamType.ERROR, fromStep, BaseMessages.getString(PKG, "Spoon.Hop.ErrorHandlingOfStep"), StreamIcon.ERROR, null));
}
} else {
if (toIoMeta.isInputAcceptor() && fromStep.equals(currentStep)) {
streams.add(new Stream(StreamType.INPUT, toStep, BaseMessages.getString(PKG, "Spoon.Hop.MainInputOfStep"), StreamIcon.INPUT, null));
}
if (fromStep.supportsErrorHandling() && fromStep.equals(currentStep)) {
streams.add(new Stream(StreamType.ERROR, fromStep, BaseMessages.getString(PKG, "Spoon.Hop.ErrorHandlingOfStep"), StreamIcon.ERROR, null));
}
}
//
if (forward) {
streams.addAll(fromStep.getStepMetaInterface().getOptionalStreams());
} else {
streams.addAll(toStep.getStepMetaInterface().getOptionalStreams());
}
//
if (streams.size() > 1) {
// Show a pop-up menu with all the possible options...
//
Menu menu = new Menu(canvas);
for (final StreamInterface stream : streams) {
MenuItem item = new MenuItem(menu, SWT.NONE);
item.setText(Const.NVL(stream.getDescription(), ""));
item.setImage(getImageFor(stream));
item.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
addHop(stream);
}
});
}
menu.setLocation(canvas.toDisplay(mouseX, mouseY));
menu.setVisible(true);
return;
}
if (streams.size() == 1) {
addHop(streams.get(0));
} else {
return;
}
/*
*
* if (transMeta.findTransHop(candidate) == null) { spoon.newHop(transMeta, candidate); } if (startErrorHopStep) {
* addErrorHop(); } if (startTargetHopStream != null) { // Auto-configure the target in the source step... //
* startTargetHopStream.setStepMeta(candidate.getToStep());
* startTargetHopStream.setStepname(candidate.getToStep().getName()); startTargetHopStream = null; }
*/
candidate = null;
selectedSteps = null;
startHopStep = null;
endHopLocation = null;
startErrorHopStep = false;
// redraw();
}
use of org.pentaho.di.trans.step.errorhandling.Stream in project pentaho-kettle by pentaho.
the class StreamLookupTest method mockProcessRowMeta.
private StreamLookupMeta mockProcessRowMeta(boolean memoryPreservationActive) throws KettleStepException {
StreamLookupMeta meta = smh.processRowsStepMetaInterface;
StepMeta lookupStepMeta = when(mock(StepMeta.class).getName()).thenReturn("Lookup").getMock();
doReturn(lookupStepMeta).when(smh.transMeta).findStep("Lookup");
StepIOMeta stepIOMeta = new StepIOMeta(true, true, false, false, false, false);
stepIOMeta.addStream(new Stream(StreamInterface.StreamType.INFO, lookupStepMeta, null, StreamIcon.INFO, null));
doReturn(stepIOMeta).when(meta).getStepIOMeta();
doReturn(new String[] { "Id" }).when(meta).getKeylookup();
doReturn(new String[] { "Id" }).when(meta).getKeystream();
doReturn(new String[] { "Value" }).when(meta).getValue();
doReturn(memoryPreservationActive).when(meta).isMemoryPreservationActive();
doReturn(false).when(meta).isUsingSortedList();
doReturn(false).when(meta).isUsingIntegerPair();
doReturn(new int[] { -1 }).when(meta).getValueDefaultType();
doReturn(new String[] { "" }).when(meta).getValueDefault();
doReturn(new String[] { "Value" }).when(meta).getValueName();
doReturn(new String[] { "Value" }).when(meta).getValue();
doCallRealMethod().when(meta).getFields(any(RowMetaInterface.class), anyString(), any(RowMetaInterface[].class), any(StepMeta.class), any(VariableSpace.class), any(Repository.class), any(IMetaStore.class));
return meta;
}
Aggregations