org.knime.core.node
Class NodeModel

java.lang.Object
  extended by org.knime.core.node.NodeModel
Direct Known Subclasses:
AbstractHistogramNodeModel, AbstractParallelNodeModel, AbstractSamplingNodeModel, AccuracyScorerNodeModel, AggregateOutputNodeModel, AppendedRowsNodeModel, AppendVariableToTableNodeModel, ARFFReaderNodeModel, ARFFWriterNodeModel, BasisFunctionLearnerNodeModel, BasisFunctionPredictorNodeModel, BinnerNodeModel, BitVectorGeneratorNodeModel, BoxPlotNodeModel, BWElimFilterNodeModel, BWElimLoopEndNodeModel, BWElimLoopStartNodeModel, CacheNodeModel, CAIMDiscretizationNodeModel, CaseConvertNodeModel, CellSplitterByPosNodeModel, CellSplitterNodeModel, ClusterAssignerNodeModel, ClusterNodeModel, ColCombineNodeModel, ColConvertNodeModel, CollectionCreateNodeModel, CollectionSplitNodeModel, ColorAppender2NodeModel, ColorManager2NodeModel, ColumnComparatorNodeModel, ColumnFilterRefNodeModel, ColumnResorterNodeModel, ConditionalBoxPlotNodeModel, CSVWriterNodeModel, DBConnectionNodeModel, DBConnectionWriterNodeModel, DBNodeModel, DBReaderNodeModel, DBWriterNodeModel, DecisionTreeLearnerNodeModel, DecTreePredictorNodeModel, DefaultTableNodeModel, DefaultVisualizationNodeModel, DiscretizationApplyNodeModel, DomainNodeModel, DoubleToIntNodeModel, EnrichmentPlotterModel, EntropyNodeModel, ExtractVariablesNodeModel, ExtToolOutputNodeModel, FileReaderNodeModel, FilterColumnNodeModel, FuzzyClusterNodeModel, GroupByNodeModel, HierarchicalClusterNodeModel, HiLiteCollectorNodeModel, HiliteFilterNodeModel, InjectVariablesNodeModel, InterruptibleNodeModel, KnnNodeModel, LiftChartNodeModel, LinRegLearnerNodeModel, LoopEndConditionNodeModel, LoopEndNodeModel, LoopStartCountNodeModel, LoopStartGenericNodeModel, LoopStartIntervalNodeModel, LowVarFilterNodeModel, Many2OneColNodeModel, MDSNodeModel, MDSProjectionNodeModel, MissingValueHandlingNodeModel, MLPPredictorNodeModel, NaiveBayesLearnerNodeModel, NaiveBayesPredictorNodeModel, NewJoinerNodeModel, NominalValueRowFilterNodeModel, NormalizerApplyNodeModel, NormalizerNodeModel, NoSettingsNodeModel, NumberToStringNodeModel, NumericRowSplitterNodeModel, One2ManyColNodeModel, PCAApplyNodeModel, PCAComputeNodeModel, PCANodeModel, PCAReverseNodeModel, PieNodeModel, PivotNodeModel, PMCCFilterNodeModel, PMCCNodeModel, PMMLReaderNodeModel, PMMLWriterNodeModel, PolyRegLearnerNodeModel, PortObjectReaderNodeModel, PortObjectWriterNodeModel, ReadTableNodeModel, RegexSplitNodeModel, RegressionPredictorNodeModel, RenameNodeModel, ROCNodeModel, RowFilter2PortNodeModel, RowFilterNodeModel, RowFilterRefNodeModel, RowKeyNodeModel, RPropNodeModel, RuleEngineNodeModel, SampleDataNodeModel, SearchReplaceDictNodeModel, SetOperatorNodeModel, ShapeAppenderNodeModel, ShapeManagerNodeModel, ShuffleNodeModel, SizeAppenderNodeModel, SizeManager2NodeModel, SmoteNodeModel, SorterNodeModel, SotaNodeModel, SotaPredictorNodeModel, SplitNodeModel, Statistics2NodeModel, StringReplacerNodeModel, StringToNumberNodeModel, SubgroupMinerModel, SVMLearnerNodeModel, SVMPredictorNodeModel, TableNodeModel, TableToVariableNodeModel, ThreadedColAppenderNodeModel, ThreadedTableBuilderNodeModel, TransposeTableNodeModel, UnpivotNodeModel, ValueCounterNodeModel, VariableFileReaderNodeModel, VariableToTableNodeModel, WriteTableNodeModel, XValidatePartitionModel

public abstract class NodeModel
extends Object

Abstract class defining a node's configuration and execution (among others). More specifically, it defines:

Derived classes must overwrite one of two execute methods and one of two configure methods (depending on their port types):
  1. The execute(PortObject[], ExecutionContext) and configure(PortObjectSpec[]) methods for general port definitions (rarely used) or
  2. the execute(BufferedDataTable[], ExecutionContext) and configure(DataTableSpec[]) methods for standard data ports (on both in- and outports).
None of these methods is declared abstract, though one pair of execute/configure must be overridden (if none is overwritten a runtime exception will be thrown upon the node's configuration or execution, resp.).

For a detailed description of this class refer to KNIME's extension guide and the various node implementations.

Author:
Thomas Gabriel, University of Konstanz

Constructor Summary
protected NodeModel(int nrInDataPorts, int nrOutDataPorts)
          Creates a new model with the given number of input and output data ports.
protected NodeModel(PortType[] inPortTypes, PortType[] outPortTypes)
          Creates a new model with the given number (and types!) of input and output types.
 
Method Summary
 void addWarningListener(NodeModelWarningListener listener)
          Adds a warning listener to this node.
(package private)  void clearLoopStatus()
           
protected  DataTableSpec[] configure(DataTableSpec[] inSpecs)
          This function is called whenever the derived model should re-configure its output DataTableSpecs.
protected  PortObjectSpec[] configure(PortObjectSpec[] inSpecs)
          Configure method for general port types.
(package private)  PortObjectSpec[] configureModel(PortObjectSpec[] inSpecs)
          This function is called when something changes that could affect the output DataTableSpec elements.
protected  void continueLoop()
          Informs WorkflowManager after execute to continue the loop.
protected  BufferedDataTable[] execute(BufferedDataTable[] inData, ExecutionContext exec)
          This function is invoked by the Node#executeNode() method of the node (through the #executeModel(BufferedDataTable[],ExecutionMonitor) method)only after all predecessor nodes have been successfully executed and all data is therefore available at the input ports.
protected  PortObject[] execute(PortObject[] inObjects, ExecutionContext exec)
          Execute method for general port types.
protected  PortObject[] executeModel(PortObject[] data, ExecutionContext exec)
          Invokes the abstract #execute() method of this model.
(package private)  FlowObjectStack getFlowObjectStack()
           
 HiLiteHandler getInHiLiteHandler(int inIndex)
          Returns the HiLiteHandler for the given input index, if the current in-port hilite handler is null an HiLiteHandlerAdapter is created and returned.
(package private)  PortType getInPortType(int index)
           
protected  LoopEndNode getLoopEndNode()
          Access method for loop start nodes to access their respective loop end.
protected  LoopStartNode getLoopStartNode()
          Access method for loop end nodes to access their respective loop start.
(package private)  FlowLoopContext getLoopStatus()
           
protected  int getNrInPorts()
          Returns the overall number of inputs.
protected  int getNrOutPorts()
          Returns the overall number of outputs.
protected  HiLiteHandler getOutHiLiteHandler(int outIndex)
          Returns the HiLiteHandler for the given output index.
(package private)  PortType getOutPortType(int index)
           
(package private)  int getSimulatedHiliteHandlerPortIndex(int portIndex)
          Returns the argument.
(package private)  int getTrueHiliteHandlerPortIndex(int portIndex)
          Returns the argument.
(package private)  Collection<AbstractNodeView<?>> getViews()
           
protected  String getWarningMessage()
          Get the most recently set warning message.
(package private)  boolean hasContent()
           
protected abstract  void loadInternals(File nodeInternDir, ExecutionMonitor exec)
          Load internals into the derived NodeModel.
(package private)  void loadSettingsFrom(NodeSettingsRO settings)
          Validates the specified settings in the model and then loads them into it.
protected abstract  void loadValidatedSettingsFrom(NodeSettingsRO settings)
          Sets new settings from the passed object in the model.
protected  void notifyViews(Object arg)
          This method can be called from the derived model in order to inform the views about changes of the settings or during execution, if you want the views to show the progress, and if they can display models half way through the execution.
 void notifyWarningListeners(String warning)
          Notifies all listeners that the warning of this node has changed.
protected  double peekFlowVariableDouble(String name)
          Get the value of the double variable with the given name leaving the variable stack unmodified.
protected  int peekFlowVariableInt(String name)
          Get the value of the integer variable with the given name leaving the variable stack unmodified.
protected  String peekFlowVariableString(String name)
          Get the value of the String variable with the given name leaving the flow variable stack unmodified.
protected  double peekScopeVariableDouble(String name)
          Deprecated. This method has been replaced by peekFlowVariableDouble(String). It will be removed in future versions.
protected  int peekScopeVariableInt(String name)
          Deprecated. This method has been replaced by peekFlowVariableInt(String). It will be removed in future versions.
protected  String peekScopeVariableString(String name)
          Deprecated. This method has been replaced by peekFlowVariableString(String). It will be removed in future versions.
protected  void pushFlowVariableDouble(String name, double value)
          Put a new variable of type double onto the stack.
protected  void pushFlowVariableInt(String name, int value)
          Put a new variable of type integer onto the stack.
protected  void pushFlowVariableString(String name, String value)
          Put a new variable of type String onto the stack.
protected  void pushScopeVariableDouble(String name, double value)
          Deprecated. This method has been replaced by pushFlowVariableDouble(String, double). It will be removed in future versions.
protected  void pushScopeVariableInt(String name, int value)
          Deprecated. This method has been replaced by pushFlowVariableInt(String, int). It will be removed in future versions.
protected  void pushScopeVariableString(String name, String value)
          Deprecated. This method has been replaced by pushFlowVariableString(String, String). It will be removed in future versions.
(package private)  void registerView(AbstractNodeView<?> view)
          Registers the given view at the model to receive change events of the underlying model.
 void removeWarningListener(NodeModelWarningListener listener)
          Removes a warning listener from this node.
protected abstract  void reset()
          Override this function in the derived model and reset your NodeModel.
(package private)  void resetModel()
          Invokes the abstract #reset() method of the derived model.
(package private)  void restoreWarningMessage(String warningMessage)
          Method being called when node is restored.
protected abstract  void saveInternals(File nodeInternDir, ExecutionMonitor exec)
          Save internals of the derived NodeModel.
protected abstract  void saveSettingsTo(NodeSettingsWO settings)
          Adds to the given NodeSettings the model specific settings.
(package private)  void setFlowObjectStack(FlowObjectStack scsc)
           
(package private)  void setHasContent(boolean hasContent)
          Sets the hasContent flag and fires a state change event.
protected  void setInHiLiteHandler(int inIndex, HiLiteHandler hiLiteHdl)
          This implementation is empty.
(package private)  void setLoopEndNode(LoopEndNode end)
          Setter used by framework to update loop end node.
(package private)  void setLoopStartNode(LoopStartNode start)
          Setter used by framework to update loop start node.
(package private)  void setNewInHiLiteHandler(int in, HiLiteHandler hdl)
          Sets a new HiLiteHandler for the given input.
protected  void setWarningMessage(String warningMessage)
          Sets an optional warning message by the implementing node model.
protected  void stateChanged()
          Notifies all registered views of a change of the underlying model.
(package private)  void unregisterAllViews()
          Unregisters all views from the model.
(package private)  void unregisterView(AbstractNodeView<?> view)
          Unregisters the given view.
protected abstract  void validateSettings(NodeSettingsRO settings)
          Validates the settings in the passed NodeSettings object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeModel

protected NodeModel(int nrInDataPorts,
                    int nrOutDataPorts)
Creates a new model with the given number of input and output data ports.

Parameters:
nrInDataPorts - number of input data ports
nrOutDataPorts - number of output data ports
Throws:
NegativeArraySizeException - If the number of in- or outputs is smaller than zero.

NodeModel

protected NodeModel(PortType[] inPortTypes,
                    PortType[] outPortTypes)
Creates a new model with the given number (and types!) of input and output types.

Parameters:
inPortTypes - an array of non-null in-port types
outPortTypes - an array of non-null out-port types
Method Detail

loadInternals

protected abstract void loadInternals(File nodeInternDir,
                                      ExecutionMonitor exec)
                               throws IOException,
                                      CanceledExecutionException
Load internals into the derived NodeModel. This method is only called if the Node was executed. Read all your internal structures from the given file directory to create your internal data structure which is necessary to provide all node functionalities after the workflow is loaded, e.g. view content and/or hilite mapping.

Parameters:
nodeInternDir - The directory to read from.
exec - Used to report progress and to cancel the load process.
Throws:
IOException - If an error occurs during reading from this dir.
CanceledExecutionException - If the loading has been canceled.
See Also:
saveInternals(File,ExecutionMonitor)

saveInternals

protected abstract void saveInternals(File nodeInternDir,
                                      ExecutionMonitor exec)
                               throws IOException,
                                      CanceledExecutionException
Save internals of the derived NodeModel. This method is only called if the Node is executed. Write all your internal structures into the given file directory which are necessary to recreate this model when the workflow is loaded, e.g. view content and/or hilite mapping.

Parameters:
nodeInternDir - The directory to write into.
exec - Used to report progress and to cancel the save process.
Throws:
IOException - If an error occurs during writing to this dir.
CanceledExecutionException - If the saving has been canceled.
See Also:
loadInternals(File,ExecutionMonitor)

registerView

final void registerView(AbstractNodeView<?> view)
Registers the given view at the model to receive change events of the underlying model. Note that no change event is fired.

Parameters:
view - The view to register.

unregisterView

final void unregisterView(AbstractNodeView<?> view)
Unregisters the given view.

Parameters:
view - The view to unregister.

unregisterAllViews

final void unregisterAllViews()
Unregisters all views from the model.


getViews

final Collection<AbstractNodeView<?>> getViews()
Returns:
All registered views.

getNrInPorts

protected final int getNrInPorts()
Returns the overall number of inputs.

Returns:
Number of inputs.

getNrOutPorts

protected final int getNrOutPorts()
Returns the overall number of outputs.

Returns:
Number of outputs.

getInPortType

final PortType getInPortType(int index)
Parameters:
index -
Returns:
Type of the specified input port

getOutPortType

final PortType getOutPortType(int index)
Parameters:
index -
Returns:
Type of the specified output port

loadSettingsFrom

final void loadSettingsFrom(NodeSettingsRO settings)
                     throws InvalidSettingsException
Validates the specified settings in the model and then loads them into it.

Parameters:
settings - the settings to read
Throws:
InvalidSettingsException - if the settings are not valid or cannot be loaded into the model

saveSettingsTo

protected abstract void saveSettingsTo(NodeSettingsWO settings)
Adds to the given NodeSettings the model specific settings. The settings don't need to be complete or consistent. If, right after startup, no valid settings are available this method can write either nothing or invalid settings.

Method is called by the Node if the current settings need to be saved or transfered to the node's dialog.

Parameters:
settings - The object to write settings into.
See Also:
loadValidatedSettingsFrom(NodeSettingsRO), validateSettings(NodeSettingsRO)

validateSettings

protected abstract void validateSettings(NodeSettingsRO settings)
                                  throws InvalidSettingsException
Validates the settings in the passed NodeSettings object. The specified settings should be checked for completeness and consistency. It must be possible to load a settings object validated here without any exception in the #loadValidatedSettings(NodeSettings) method. The method must not change the current settings in the model - it is supposed to just check them. If some settings are missing, invalid, inconsistent, or just not right throw an exception with a message useful to the user.

Parameters:
settings - The settings to validate.
Throws:
InvalidSettingsException - If the validation of the settings failed.
See Also:
saveSettingsTo(NodeSettingsWO), loadValidatedSettingsFrom(NodeSettingsRO)

loadValidatedSettingsFrom

protected abstract void loadValidatedSettingsFrom(NodeSettingsRO settings)
                                           throws InvalidSettingsException
Sets new settings from the passed object in the model. You can safely assume that the object passed has been successfully validated by the #validateSettings(NodeSettings) method. The model must set its internal configuration according to the settings object passed.

Parameters:
settings - The settings to read.
Throws:
InvalidSettingsException - If a property is not available.
See Also:
saveSettingsTo(NodeSettingsWO), validateSettings(NodeSettingsRO)

executeModel

protected final PortObject[] executeModel(PortObject[] data,
                                          ExecutionContext exec)
                                   throws Exception
Invokes the abstract #execute() method of this model. In addition, this method notifies all assigned views of the model about the changes.

Parameters:
data - An array of DataTable objects holding the data from the inputs.
exec - The execution monitor which is passed to the execute method of this model.
Returns:
The result of the execution in form of an array with DataTable elements, as many as the node has outputs.
Throws:
Exception - any exception or error that is fired in the derived model will be just forwarded. It may throw an CanceledExecutionException if the user pressed cancel during execution. Even if the derived model doesn't check, the result will be discarded and the exception thrown.
IllegalStateException - If the number of PortObject objects returned by the derived NodeModel does not match the number of outputs. Or if any of them is null.
See Also:
execute(PortObject[],ExecutionContext)

setHasContent

final void setHasContent(boolean hasContent)
Sets the hasContent flag and fires a state change event.

Parameters:
hasContent - Flag if this node is configured be executed or not.

hasContent

final boolean hasContent()
Returns:
true if this model has been executed and therefore possibly has content that can be displayed in a view, false otherwise.

execute

protected PortObject[] execute(PortObject[] inObjects,
                               ExecutionContext exec)
                        throws Exception
Execute method for general port types. The argument objects represent the input objects and are guaranteed to be subclasses of the PortObject classes that are defined through the PortTypes given in the constructor. Similarly, the returned output objects need to comply with their port types object class (otherwise an error is reported by the framework).

For a general description of the execute method refer to the description of the specialized execute(BufferedDataTable[], ExecutionContext) methods as it addresses more use cases.

Parameters:
inObjects - The input objects.
exec - For BufferedDataTable creation and progress.
Returns:
The output objects.
Throws:
Exception - If the node execution fails for any reason.

execute

protected BufferedDataTable[] execute(BufferedDataTable[] inData,
                                      ExecutionContext exec)
                               throws Exception
This function is invoked by the Node#executeNode() method of the node (through the #executeModel(BufferedDataTable[],ExecutionMonitor) method)only after all predecessor nodes have been successfully executed and all data is therefore available at the input ports. Implement this function with your task in the derived model.

The input data is available in the given array argument inData and is ensured to be neither null nor contain null elements.

In order to create output data, you need to create objects of class BufferedDataTable. Use the execution context argument to create BufferedDataTable.

Parameters:
inData - An array holding DataTable elements, one for each input.
exec - The execution monitor for this execute method. It provides us with means to create new BufferedDataTable. Additionally, it should be asked frequently if the execution should be interrupted and throws an exception then. This exception might me caught, and then after closing all data streams, been thrown again. Also, if you can tell the progress of your task, just set it in this monitor.
Returns:
An array of non- null DataTable elements with the size of the number of outputs. The result of this execution.
Throws:
Exception - If you must fail the execution. Try to provide a meaningful error message in the exception as it will be displayed to the user.Please be advised to check frequently the canceled status by invoking ExecutionMonitor#checkCanceled which will throw an CanceledExcecutionException and abort the execution.

resetModel

final void resetModel()
Invokes the abstract #reset() method of the derived model. In addition, this method resets all hilite handlers, and notifies all views about the changes.


reset

protected abstract void reset()
Override this function in the derived model and reset your NodeModel. All components should unregister themselves from any observables (at least from the hilite handler right now). All internally stored data structures should be released. User settings should not be deleted/reset though.


stateChanged

protected final void stateChanged()
Notifies all registered views of a change of the underlying model. It is called by functions of the abstract class that modify the model (like #executeModel() and #resetModel() ).


notifyViews

protected final void notifyViews(Object arg)
This method can be called from the derived model in order to inform the views about changes of the settings or during execution, if you want the views to show the progress, and if they can display models half way through the execution. In the view NodeView#updateModel(Object) is called and needs to be overridden.

Parameters:
arg - The argument you want to pass.

setInHiLiteHandler

protected void setInHiLiteHandler(int inIndex,
                                  HiLiteHandler hiLiteHdl)
This implementation is empty. Subclasses may override this method in order to be informed when the hilite handler changes at the inport, e.g. when the node (or an preceding node) is newly connected.

Parameters:
inIndex - The index of the input.
hiLiteHdl - The HiLiteHandler at input index. May be null when not available, i.e. not properly connected.
Throws:
IndexOutOfBoundsException - If the inIndex is not in the range of inputs.

setNewInHiLiteHandler

final void setNewInHiLiteHandler(int in,
                                 HiLiteHandler hdl)
Sets a new HiLiteHandler for the given input. This method is called by the corresponding Node in order to set the HiLiteHandler for the given input port.

Parameters:
in - The input index.
hdl - The new HiLiteHandler.
See Also:
setInHiLiteHandler(int, HiLiteHandler)

getInHiLiteHandler

public final HiLiteHandler getInHiLiteHandler(int inIndex)
Returns the HiLiteHandler for the given input index, if the current in-port hilite handler is null an HiLiteHandlerAdapter is created and returned.

Parameters:
inIndex - in-port index
Returns:
HiLiteHandler for the given input index
Throws:
IndexOutOfBoundsException - if the inIndex is not in the range of inputs

getTrueHiliteHandlerPortIndex

int getTrueHiliteHandlerPortIndex(int portIndex)
Returns the argument. This method is overridden in class NodeModel to handle incoming model ports appropriately (no hilite handlers at deprecated model ports).

Parameters:
portIndex - The simulated port index
Returns:
The true port index

getSimulatedHiliteHandlerPortIndex

int getSimulatedHiliteHandlerPortIndex(int portIndex)
Returns the argument. This method is overridden in class NodeModel to handle incoming model ports appropriately (no hilite handlers at deprecated model ports).

Parameters:
portIndex - The true port index
Returns:
The simulated port index

getOutHiLiteHandler

protected HiLiteHandler getOutHiLiteHandler(int outIndex)
Returns the HiLiteHandler for the given output index. This default implementation simply passes on the handler of input port 0 or generates a new one if this node has no inputs.

This method is intended to be overridden

Parameters:
outIndex - The output index.
Returns:
HiLiteHandler for the given output port.
Throws:
IndexOutOfBoundsException - If the index is not in output's range.

configureModel

final PortObjectSpec[] configureModel(PortObjectSpec[] inSpecs)
                               throws InvalidSettingsException
This function is called when something changes that could affect the output DataTableSpec elements. E.g. after a reset, execute, (dis-)connect, and object creation (model instantiation).

The function calls #configure() to receive the updated output DataTableSpecs, if the model is not executed yet. After execution the DataTableSpecs are simply taken from the output DataTables.

Parameters:
inSpecs - An array of input DataTableSpec elements, either the array or each of its elements can be null.
Returns:
An array where each element indicates if the outport has changed.
Throws:
InvalidSettingsException - if the current settings don't go along with the table specs

configure

protected PortObjectSpec[] configure(PortObjectSpec[] inSpecs)
                              throws InvalidSettingsException
Configure method for general port types. The argument specs represent the input object specs and are guaranteed to be subclasses of the PortObjectSpecs that are defined through the PortTypes given in the constructor. Similarly, the returned output specs need to comply with their port types spec class (otherwise an error is reported by the framework). They may also be null.

For a general description of the configure method refer to the description of the specialized configure(DataTableSpec[]) methods as it addresses more use cases.

Parameters:
inSpecs - The input object specs.
Returns:
The output objects specs or null.
Throws:
InvalidSettingsException - If this node can't be configured.

configure

protected DataTableSpec[] configure(DataTableSpec[] inSpecs)
                             throws InvalidSettingsException
This function is called whenever the derived model should re-configure its output DataTableSpecs. Based on the given input data table spec(s) and the current model's settings, the derived model has to calculate the output data table spec and return them.

The passed DataTableSpec elements are never null but can be empty. The model may return null data table spec(s) for the outputs. But still, the model may be in an executable state. Note, after the model has been executed this function will not be called anymore, as the output DataTableSpecs are then being pulled from the output DataTables. A derived NodeModel that cannot provide any DataTableSpecs at its outputs before execution (because the table structure is unknown at this point) can return an array containing just null elements.

Implementation note: This method is called from the configure(PortObjectSpec[]) method unless that method is overwritten.

Parameters:
inSpecs - An array of DataTableSpecs (as many as this model has inputs). Do NOT modify the contents of this array. None of the DataTableSpecs in the array can be null but empty. If the predecessor node is not yet connected, or doesn't provide a DataTableSpecs at its output port.
Returns:
An array of DataTableSpecs (as many as this model has outputs) They will be propagated to connected successor nodes. null DataTableSpec elements are changed to empty once.
Throws:
InvalidSettingsException - if the #configure() failed, that is, the settings are inconsistent with given DataTableSpec elements.

restoreWarningMessage

final void restoreWarningMessage(String warningMessage)
Method being called when node is restored. It does not notify listeners.

Parameters:
warningMessage - The message as written to the workflow file

setWarningMessage

protected final void setWarningMessage(String warningMessage)
Sets an optional warning message by the implementing node model.

Parameters:
warningMessage - the warning message to set

getWarningMessage

protected final String getWarningMessage()
Get the most recently set warning message.

Returns:
the warningMessage that is currently set (or null)

addWarningListener

public void addWarningListener(NodeModelWarningListener listener)
Adds a warning listener to this node. Ignored if the listener is already registered.

Parameters:
listener - The listener to add.

removeWarningListener

public void removeWarningListener(NodeModelWarningListener listener)
Removes a warning listener from this node. Ignored if the listener is not registered.

Parameters:
listener - The listener to remove.

notifyWarningListeners

public void notifyWarningListeners(String warning)
Notifies all listeners that the warning of this node has changed.

Parameters:
warning - message

peekFlowVariableString

protected final String peekFlowVariableString(String name)
Get the value of the String variable with the given name leaving the flow variable stack unmodified.

Parameters:
name - Name of the variable
Returns:
The value of the string variable
Throws:
NullPointerException - If the argument is null
NoSuchElementException - If no such variable with the correct type is available.

pushFlowVariableDouble

protected final void pushFlowVariableDouble(String name,
                                            double value)
Put a new variable of type double onto the stack. If such variable already exists, its value will be (virtually) overwritten.

Parameters:
name - The name of the variable.
value - The assignment value for the variable
Throws:
NullPointerException - If the name argument is null.

peekFlowVariableDouble

protected final double peekFlowVariableDouble(String name)
Get the value of the double variable with the given name leaving the variable stack unmodified.

Parameters:
name - Name of the variable
Returns:
The assignment value of the variable
Throws:
NullPointerException - If the argument is null
NoSuchElementException - If no such variable with the correct type is available.

pushFlowVariableInt

protected final void pushFlowVariableInt(String name,
                                         int value)
Put a new variable of type integer onto the stack. If such variable already exists, its value will be (virtually) overwritten.

Parameters:
name - The name of the variable.
value - The assignment value for the variable
Throws:
NullPointerException - If the name argument is null.

peekFlowVariableInt

protected final int peekFlowVariableInt(String name)
Get the value of the integer variable with the given name leaving the variable stack unmodified.

Parameters:
name - Name of the variable
Returns:
The value of the integer variable
Throws:
NullPointerException - If the argument is null
NoSuchElementException - If no such variable with the correct type is available.

pushFlowVariableString

protected final void pushFlowVariableString(String name,
                                            String value)
Put a new variable of type String onto the stack. If such variable already exists, its value will be (virtually) overwritten.

Parameters:
name - The name of the variable.
value - The assignment value for the variable
Throws:
NullPointerException - If the name argument is null.

continueLoop

protected final void continueLoop()
Informs WorkflowManager after execute to continue the loop. Call by the end of the loop! This will result in both this Node as well as the creator of the FlowLoopContext to be queued for execution once again. In this case the node can return an empty table after execution.


getLoopStatus

final FlowLoopContext getLoopStatus()

clearLoopStatus

final void clearLoopStatus()

getLoopEndNode

protected final LoopEndNode getLoopEndNode()
Access method for loop start nodes to access their respective loop end. This method returns null if this node is not a loop start or the loop is not correctly closed by the user.

Returns:
The loop end node or null. Clients typically test and cast to an expected loop end instance.
See Also:
getLoopStartNode()

setLoopEndNode

void setLoopEndNode(LoopEndNode end)
Setter used by framework to update loop end node.

Parameters:
end - The end node of the loop (if this is a start node).

getLoopStartNode

protected final LoopStartNode getLoopStartNode()
Access method for loop end nodes to access their respective loop start. This method returns null if this node is not a loop end or the loop is not correctly closed by the user.

Returns:
The loop start node or null. Clients typically test and cast to an expected loop start instance.
See Also:
getLoopEndNode()

setLoopStartNode

void setLoopStartNode(LoopStartNode start)
Setter used by framework to update loop start node.

Parameters:
start - The start node of the loop (if this is a end node).

getFlowObjectStack

FlowObjectStack getFlowObjectStack()

setFlowObjectStack

void setFlowObjectStack(FlowObjectStack scsc)

pushScopeVariableString

@Deprecated
protected final void pushScopeVariableString(String name,
                                                        String value)
Deprecated. This method has been replaced by pushFlowVariableString(String, String). It will be removed in future versions.


peekScopeVariableString

@Deprecated
protected final String peekScopeVariableString(String name)
Deprecated. This method has been replaced by peekFlowVariableString(String). It will be removed in future versions.


pushScopeVariableDouble

@Deprecated
protected final void pushScopeVariableDouble(String name,
                                                        double value)
Deprecated. This method has been replaced by pushFlowVariableDouble(String, double). It will be removed in future versions.


peekScopeVariableDouble

@Deprecated
protected final double peekScopeVariableDouble(String name)
Deprecated. This method has been replaced by peekFlowVariableDouble(String). It will be removed in future versions.


pushScopeVariableInt

@Deprecated
protected final void pushScopeVariableInt(String name,
                                                     int value)
Deprecated. This method has been replaced by pushFlowVariableInt(String, int). It will be removed in future versions.


peekScopeVariableInt

@Deprecated
protected final int peekScopeVariableInt(String name)
Deprecated. This method has been replaced by peekFlowVariableInt(String). It will be removed in future versions.



Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.