use of org.knime.core.node.port.PortObjectSpec in project knime-core by knime.
the class RuleEngineVariable2PortsNodeModel method configure.
/**
* {@inheritDoc}
*/
@Override
protected PortObjectSpec[] configure(final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
String warning = RuleEngine2PortsNodeModel.autoGuessRuleColumnName(inSpecs, m_settings);
if (warning != null) {
setWarningMessage(warning);
}
DataTableSpec ruleTableSpec = (DataTableSpec) inSpecs[RuleEngine2PortsNodeModel.RULE_PORT];
// unknown table structure
if (ruleTableSpec == null) {
return null;
}
CheckUtils.checkSettingNotNull(ruleTableSpec.getColumnSpec(m_settings.getRuleColumn()), "No rule column in the rules table with name: " + m_settings.getRuleColumn());
return new PortObjectSpec[] { FlowVariablePortObjectSpec.INSTANCE };
}
use of org.knime.core.node.port.PortObjectSpec in project knime-core by knime.
the class RuleEngineVariableNodeModel method configure.
/**
* {@inheritDoc}
*/
@Override
protected PortObjectSpec[] configure(final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
try {
List<Rule> rules = parseRules();
performExecute(rules);
return new PortObjectSpec[] { FlowVariablePortObjectSpec.INSTANCE };
} catch (ParseException ex) {
throw new InvalidSettingsException(ex.getMessage(), ex);
}
}
use of org.knime.core.node.port.PortObjectSpec in project knime-core by knime.
the class PMMLRuleEditorNodeModel method computeFinalOutputSpecs.
/**
* {@inheritDoc}
*/
@Override
public PortObjectSpec[] computeFinalOutputSpecs(final StreamableOperatorInternals internals, final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
final PortObjectSpec[] computeFinalOutputSpecs = super.computeFinalOutputSpecs(internals, inSpecs);
// TODO should this be done some place else (finish)?
StreamInternalForPMMLPortObject poInternals = (StreamInternalForPMMLPortObject) internals;
try {
DataTableSpec tableSpec = (DataTableSpec) inSpecs[0];
RearrangerAndPMMLModel m = createRearrangerAndPMMLModel(tableSpec);
poInternals.setObject(m.getPMMLPortObject());
} catch (ParseException e) {
throw new InvalidSettingsException(e);
}
return computeFinalOutputSpecs;
}
use of org.knime.core.node.port.PortObjectSpec in project knime-core by knime.
the class RankCorrelationComputeNodeModel method configure.
/**
* {@inheritDoc}
*/
@Override
protected PortObjectSpec[] configure(final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
DataTableSpec in = (DataTableSpec) inSpecs[0];
final String[] includes;
if (m_columnFilterModel == null) {
m_columnFilterModel = createColumnFilterModel();
// auto-configure, no previous configuration
m_columnFilterModel.loadDefaults(in);
includes = m_columnFilterModel.applyTo(in).getIncludes();
setWarningMessage("Auto configuration: Using all suitable columns (in total " + includes.length + ")");
} else {
FilterResult applyTo = m_columnFilterModel.applyTo(in);
includes = applyTo.getIncludes();
}
if (includes.length == 0) {
throw new InvalidSettingsException("No columns selected");
}
return new PortObjectSpec[] { PMCCPortObjectAndSpec.createOutSpec(includes), new PMCCPortObjectAndSpec(includes), null };
}
use of org.knime.core.node.port.PortObjectSpec in project knime-core by knime.
the class CronbachNodeModel method configure.
/**
* {@inheritDoc}
*/
@Override
protected PortObjectSpec[] configure(final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
DataTableSpec in = (DataTableSpec) inSpecs[0];
if (!in.containsCompatibleType(DoubleValue.class)) {
throw new InvalidSettingsException("No double compatible columns in input");
}
final String[] includes;
if (m_columnFilterModel == null) {
m_columnFilterModel = createColumnFilterModel();
// auto-configure, no previous configuration
m_columnFilterModel.loadDefaults(in);
includes = m_columnFilterModel.applyTo(in).getIncludes();
setWarningMessage("Auto configuration: Using all suitable columns (in total " + includes.length + ")");
} else {
FilterResult applyTo = m_columnFilterModel.applyTo(in);
includes = applyTo.getIncludes();
}
if (includes.length == 0) {
throw new InvalidSettingsException("Please include at least two numerical columns!");
}
return new PortObjectSpec[] { getDataTableSpec() };
}
Aggregations