use of org.knime.core.node.streamable.PortObjectOutput in project knime-core by knime.
the class BinnerNodeModel method createStreamableOperator.
/**
* {@inheritDoc}
*/
@Override
public StreamableOperator createStreamableOperator(final PartitionInfo partitionInfo, final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
return new StreamableOperator() {
@Override
public void runFinal(final PortInput[] inputs, final PortOutput[] outputs, final ExecutionContext exec) throws Exception {
ColumnRearranger colre = createColumnRearranger((DataTableSpec) inSpecs[0]);
colre.createStreamableFunction(0, 0).runFinal(inputs, outputs, exec);
if (m_pmmlOutEnabled) {
// handle the optional PMML in port (can be null)
PMMLPortObject inPMMLPort = m_pmmlInEnabled ? (PMMLPortObject) ((PortObjectInput) inputs[1]).getPortObject() : null;
PMMLPortObject outPMMLPort = createPMMLModel(inPMMLPort, (DataTableSpec) inSpecs[0], colre.createSpec());
((PortObjectOutput) outputs[1]).setPortObject(outPMMLPort);
}
}
};
}
Aggregations