org.knime.core.node.workflow
Class NodeContainer

java.lang.Object
  extended by org.knime.core.node.workflow.NodeContainer
All Implemented Interfaces:
EventListener, NodeProgressListener
Direct Known Subclasses:
SingleNodeContainer, WorkflowManager

public abstract class NodeContainer
extends Object
implements NodeProgressListener

Abstract super class for containers holding node or just structural information of a meta node. Also stores additional (optional) information such as coordinates on a workflow layout.

Author:
M. Berthold/B. Wiswedel, University of Konstanz

Nested Class Summary
static class NodeContainer.NodeContainerSettings
          Helper class that defines load/save routines for general NodeContainer properties.
static class NodeContainer.State
          possible status values of a NodeContainer.
 
Field Summary
protected  Object m_nodeMutex
          semaphore to make sure never try to work on inconsistent internal node states.
 
Constructor Summary
NodeContainer(WorkflowManager parent, NodeID id)
          Create new NodeContainer with IDLE state.
NodeContainer(WorkflowManager parent, NodeID id, NodeContainerMetaPersistor persistor)
           
 
Method Summary
 boolean addJobManagerChangedListener(JobManagerChangedListener l)
           
 boolean addNodeMessageListener(NodeMessageListener listener)
           
 boolean addNodeStateChangeListener(NodeStateChangeListener listener)
           
 boolean addProgressListener(NodeProgressListener listener)
           
 void addUIInformationListener(NodeUIInformationListener l)
           
 void addWaitingLoop(FlowLoopContext slc)
          add a loop to the list of waiting loops.
 void applySettingsFromDialog()
          Take settings from the node's dialog and apply them to the model.
abstract  boolean areDialogAndNodeSettingsEqual()
           
 boolean areDialogSettingsValid()
           
(package private)  boolean areSettingsValid(NodeSettingsRO settings)
           
(package private) abstract  void cancelExecution()
          Cancel execution of a marked, queued, or executing node.
(package private)  void cleanup()
          Method that's called when the node is discarded.
 void clearWaitingLoopList()
          clears the list of waiting loops.
protected  void closeAllJobManagerViews()
           
(package private)  void continueExecutionOnLoad(PortObject[] inData, NodeSettingsRO settings)
          Called upon load when the node has been saved as remotely executing.
abstract  NodeContainerExecutionResult createExecutionResult(ExecutionMonitor exec)
          Saves all internals that are necessary to mimic the computed result into a new execution result object.
 NodeExecutionJobManager findJobManager()
           
protected abstract  NodeContainerPersistor getCopyPersistor(HashMap<Integer,ContainerTable> tableRep, boolean preserveDeletableFlags)
          Get a new persistor that is used to copy this node (copy&paste action).
 String getCustomDescription()
           
 String getCustomName()
           
(package private) abstract  NodeDialogPane getDialogPane()
           
 NodeDialogPane getDialogPaneWithSettings()
          Return a NodeDialogPane for a node which can be embedded into a JFrame oder another GUI element.
(package private) abstract  NodeDialogPane getDialogPaneWithSettings(PortObjectSpec[] inSpecs)
           
 String getDisplayLabel()
           
(package private)  NodeExecutionJob getExecutionJob()
           
abstract  URL getIcon()
           
 NodeID getID()
           
abstract  NodeInPort getInPort(int index)
           
 NodeExecutionJobManager getJobManager()
           
abstract  String getName()
           
 String getNameWithID()
           
protected  ReferencedFile getNodeContainerDirectory()
           
 NodeMessage getNodeMessage()
          Get the message to be displayed to the user.
abstract  AbstractNodeView<NodeModel> getNodeView(int i)
          Return the view with the specified index provided by the node.
abstract  String getNodeViewName(int i)
           
abstract  int getNrInPorts()
           
abstract  int getNrNodeViews()
          Returns the number of views provided by the node implementation.
abstract  int getNrOutPorts()
           
 int getNrViews()
           
abstract  NodeOutPort getOutPort(int index)
           
 WorkflowManager getParent()
           
(package private)  NodeProgressMonitor getProgressMonitor()
           
(package private)  NodeContainer.NodeContainerSettings.SplitType getSplitType()
           
 NodeContainer.State getState()
           
abstract  NodeFactory.NodeType getType()
           
 UIInformation getUIInformation()
          Returns the UI information.
 AbstractNodeView<NodeModel> getView(int i)
           
 String getViewName(int i)
           
 List<FlowLoopContext> getWaitingLoops()
           
abstract  boolean hasDialog()
           
 boolean isDeletable()
           
 boolean isDirty()
           
protected abstract  boolean isLocalWFM()
          Is this node a to be locally executed workflow.
(package private) abstract  boolean isResetable()
           
(package private) abstract  NodeID[] loadContent(NodeContainerPersistor persistor, Map<Integer,BufferedDataTable> tblRep, FlowObjectStack inStack, ExecutionMonitor exec, WorkflowPersistor.LoadResult loadResult, boolean preserveNodeMessage)
          Restore content from persistor.
 void loadExecutionResult(NodeContainerExecutionResult result, ExecutionMonitor exec, WorkflowPersistor.LoadResult loadResult)
          Load information from execution result.
(package private)  void loadSettings(NodeSettingsRO settings)
           
(package private) abstract  void markForExecution(boolean flag)
          Enable (or disable) queuing of underlying node for execution.
(package private) abstract  void mimicRemoteExecuted(NodeContainerExecutionStatus status)
          Put this node into either the NodeContainer.State.EXECUTED or NodeContainer.State.IDLE state depending on the argument.
(package private) abstract  void mimicRemoteExecuting()
          Marks this node as remotely executing.
(package private) abstract  void mimicRemotePostExecute()
          Puts this node (and all its children) into the NodeContainer.State.POSTEXECUTE state.
(package private) abstract  void mimicRemotePreExecute()
          Puts this node (and all its children) into the NodeContainer.State.PREEXECUTE state.
protected  void notifyJobManagerChangedListener()
           
protected  void notifyMessageListeners(NodeMessageEvent e)
          Notifies all registered NodeMessageListeners about the new message.
(package private)  void notifyParentExecuteFinished(NodeContainerExecutionStatus status)
          Called immediately after the execution took place in the job executor.
(package private)  void notifyParentExecuteStart()
          Invoked by the job executor immediately before the execution is triggered.
(package private)  void notifyParentPostExecuteStart()
          Invoked by job manager when the execution is finishing.
(package private)  boolean notifyParentPreExecuteStart()
          Invoked by job manager when the execution starts.
protected  void notifyProgressListeners(NodeProgressEvent e)
          Notifies all registered NodeProgressListeners about the new progress.
protected  void notifyStateChangeListeners(NodeStateEvent e)
          Notifies all registered NodeStateChangeListeners about the new state.
protected  void notifyUIListeners(NodeUIInformationEvent evt)
           
 void openDialogInJFrame()
          Launch a node dialog in its own JFrame (a JDialog).
(package private) abstract  void performShutdown()
          Called when the workflow is to be disposed.
(package private) abstract  void performStateTransitionEXECUTED(NodeContainerExecutionStatus status)
          This should be used to change the nodes states correctly (and likely needs to be synchronized with other changes visible to successors of this node as well!) AFTER the actual execution.
(package private) abstract  void performStateTransitionEXECUTING()
          This should be used to change the nodes states correctly (and likely needs to be synchronized with other changes visible to successors of this node as well!) BEFORE the actual execution.
(package private) abstract  void performStateTransitionPOSTEXECUTE()
          Called when the state of a node should switch from NodeContainer.State.EXECUTING (or NodeContainer.State.EXECUTINGREMOTELY) to NodeContainer.State.POSTEXECUTE.
(package private) abstract  boolean performStateTransitionPREEXECUTE()
          Called when the state of a node should switch from NodeContainer.State.QUEUED to NodeContainer.State.PREEXECUTE.
 void progressChanged(NodeProgressEvent pe)
          Invoked when the progress has changed.
(package private)  void queue(PortObject[] inData)
          Change state of marked (for execution) node to queued once it has been assigned to a NodeExecutionJobManager.
 boolean removeJobManagerChangedListener(JobManagerChangedListener l)
           
 boolean removeNodeMessageListener(NodeMessageListener listener)
           
 boolean removeNodeProgressListener(NodeProgressListener listener)
           
 boolean removeNodeStateChangeListener(NodeStateChangeListener listener)
           
 void removeUIInformationListener(NodeUIInformationListener l)
           
 void removeWaitingLoopHeadNode(FlowObject so)
          Remove element from list of waiting loops.
protected  void resetJobManagerViews()
          Must be called when the node is reset.
protected  void saveExecutionResult(NodeContainerExecutionResult result)
          Saves all information that is held in this abstract NodeContainer into the argument.
(package private)  void saveNodeExecutionJobReconnectInfo(NodeSettingsWO settings)
           
(package private)  void saveSettings(NodeSettingsWO settings)
           
 void setCustomDescription(String customDescription)
           
 void setCustomName(String customName)
           
 void setDirty()
          Mark this node container to be changed, that is, it needs to be saved.
(package private)  void setExecutionJob(NodeExecutionJob executionJob)
           
(package private)  void setJobManager(NodeExecutionJobManager je)
          Set a new NodeExecutionJobManager for this node.
protected  void setNodeContainerDirectory(ReferencedFile directory)
           
 void setNodeMessage(NodeMessage newMessage)
           
protected  void setState(NodeContainer.State state)
          Set new status and notify listeners.
protected  boolean setState(NodeContainer.State state, boolean setDirty)
          Set new status and notify listeners.
 void setUIInformation(UIInformation uiInformation)
           
protected  void throwIllegalStateException()
          Throws a new IllegalStateException with a meaningful error message containing node name, current state and method name.
 String toString()
           
(package private)  void unsetDirty()
          Called from persistor when node has been saved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_nodeMutex

protected final Object m_nodeMutex
semaphore to make sure never try to work on inconsistent internal node states. This semaphore will be used by a node alone to synchronize internal changes of status etc.

Constructor Detail

NodeContainer

NodeContainer(WorkflowManager parent,
              NodeID id)
Create new NodeContainer with IDLE state.

Parameters:
parent - the workflowmanager holding this node
id - the nodes identifier

NodeContainer

NodeContainer(WorkflowManager parent,
              NodeID id,
              NodeContainerMetaPersistor persistor)
Method Detail

getParent

public final WorkflowManager getParent()
Returns:
parent workflowmanager holding this node (or null if root).

setJobManager

void setJobManager(NodeExecutionJobManager je)
Set a new NodeExecutionJobManager for this node. This also includes all child nodes unless they have their own dedicated job manager.

Parameters:
je - the new job manager.

getJobManager

public final NodeExecutionJobManager getJobManager()
Returns:
The job manager associated with this node or null if this node will use the job manager of the parent (or the parent of ...)
See Also:
findJobManager()

findJobManager

public final NodeExecutionJobManager findJobManager()
Returns:
NodeExecutionJobManager responsible for this node and all its children.

setExecutionJob

void setExecutionJob(NodeExecutionJob executionJob)
Parameters:
executionJob - the executionJob to set

getExecutionJob

NodeExecutionJob getExecutionJob()
Returns:
the executionJob

addJobManagerChangedListener

public boolean addJobManagerChangedListener(JobManagerChangedListener l)

removeJobManagerChangedListener

public boolean removeJobManagerChangedListener(JobManagerChangedListener l)

notifyJobManagerChangedListener

protected void notifyJobManagerChangedListener()

isResetable

abstract boolean isResetable()
Returns:
true of this node (or all nodes in this container) are resetable.

markForExecution

abstract void markForExecution(boolean flag)
Enable (or disable) queuing of underlying node for execution. This really only changes the state of the node and once all pre-conditions for execution are fulfilled (e.g. configuration succeeded and all ingoing objects are available) the node will be actually queued.

Parameters:
flag - determines if node is marked or unmarked for execution
Throws:
IllegalStateException - in case of illegal entry state.

queue

void queue(PortObject[] inData)
Change state of marked (for execution) node to queued once it has been assigned to a NodeExecutionJobManager.

Parameters:
inData - the incoming data for the execution
Throws:
IllegalStateException - in case of illegal entry state.

mimicRemoteExecuting

abstract void mimicRemoteExecuting()
Marks this node as remotely executing. This is necessary if the entire (sub-) flow that this node is part of is executed remotely.

Throws:
IllegalStateException - In case of an illegal state transition.

mimicRemotePreExecute

abstract void mimicRemotePreExecute()
Puts this node (and all its children) into the NodeContainer.State.PREEXECUTE state. This method is used when a workflow is executed remotely.

Throws:
IllegalStateException - In case of an illegal state (e.g. a node is already executing).

mimicRemotePostExecute

abstract void mimicRemotePostExecute()
Puts this node (and all its children) into the NodeContainer.State.POSTEXECUTE state. This method is used when a workflow is executed remotely.

Throws:
IllegalStateException - In case of an illegal state.

mimicRemoteExecuted

abstract void mimicRemoteExecuted(NodeContainerExecutionStatus status)
Put this node into either the NodeContainer.State.EXECUTED or NodeContainer.State.IDLE state depending on the argument. This method is applied recursively on all of this node's children (if a meta node).

Parameters:
status - Where to get the success flag from.
Throws:
IllegalStateException - In case of an illegal state.

continueExecutionOnLoad

void continueExecutionOnLoad(PortObject[] inData,
                             NodeSettingsRO settings)
                       throws InvalidSettingsException,
                              NodeExecutionJobReconnectException
Called upon load when the node has been saved as remotely executing.

Parameters:
inData - The input data for continued execution.
settings - the reconnect settings.
Throws:
InvalidSettingsException - If the settings are invalid
NodeExecutionJobReconnectException - If that fails for any reason.

performShutdown

abstract void performShutdown()
Called when the workflow is to be disposed. It will cancel this node if it is still running. If this node is being executed remotely (cluster execution) and has been saved, it will just disconnect it.


cancelExecution

abstract void cancelExecution()
Cancel execution of a marked, queued, or executing node. (Tolerate execute as this may happen throughout cancelation).

Throws:
IllegalStateException

saveNodeExecutionJobReconnectInfo

void saveNodeExecutionJobReconnectInfo(NodeSettingsWO settings)

notifyParentPreExecuteStart

boolean notifyParentPreExecuteStart()
Invoked by job manager when the execution starts. This method will invoke the WorkflowManager.doBeforePreExecution(NodeContainer) method in this node's parent. It will then call back on performStateTransitionPREEXECUTE() to allow for a synchronized state transition.

Returns:
true if the node did an actual state transition. It may abort the state change if the job was cancel (cancel checking is to be done in the synchronized block -- therefore the return value)

notifyParentExecuteStart

void notifyParentExecuteStart()
Invoked by the job executor immediately before the execution is triggered. It invokes doBeforeExecution on the parent.

Throws:
IllegalFlowObjectStackException - in case of wrongly connected loops, for instance.

notifyParentPostExecuteStart

void notifyParentPostExecuteStart()
Invoked by job manager when the execution is finishing. This method will invoke the WorkflowManager.doBeforePostExecution(NodeContainer) method in this node's parent. It will then call back on performStateTransitionPOSTEXECUTE() to allow for a synchronized state transition.


notifyParentExecuteFinished

final void notifyParentExecuteFinished(NodeContainerExecutionStatus status)
Called immediately after the execution took place in the job executor. It will trigger an doAfterExecution on the parent wfm.

Parameters:
status - Whether the execution was successful.

performStateTransitionPREEXECUTE

abstract boolean performStateTransitionPREEXECUTE()
Called when the state of a node should switch from NodeContainer.State.QUEUED to NodeContainer.State.PREEXECUTE. The method is to be called from the node's parent in a synchronized environment.

Returns:
whether there was an actual state transition, false if the execution was canceled (cancel checking to be done in synchronized block)

performStateTransitionEXECUTING

abstract void performStateTransitionEXECUTING()
This should be used to change the nodes states correctly (and likely needs to be synchronized with other changes visible to successors of this node as well!) BEFORE the actual execution. The main reason is that the actual execution should be performed unsynchronized!


performStateTransitionPOSTEXECUTE

abstract void performStateTransitionPOSTEXECUTE()
Called when the state of a node should switch from NodeContainer.State.EXECUTING (or NodeContainer.State.EXECUTINGREMOTELY) to NodeContainer.State.POSTEXECUTE. The method is to be called from the node's parent in a synchronized environment.


performStateTransitionEXECUTED

abstract void performStateTransitionEXECUTED(NodeContainerExecutionStatus status)
This should be used to change the nodes states correctly (and likely needs to be synchronized with other changes visible to successors of this node as well!) AFTER the actual execution. The main reason is that the actual execution should be performed unsynchronized!

Parameters:
status - indicates if execution was successful

addWaitingLoop

public void addWaitingLoop(FlowLoopContext slc)
add a loop to the list of waiting loops.

Parameters:
slc - FlowLoopContext object of the loop.

getWaitingLoops

public List<FlowLoopContext> getWaitingLoops()
Returns:
a list of waiting loops (well: their FlowLoopContext objects)

clearWaitingLoopList

public void clearWaitingLoopList()
clears the list of waiting loops.


removeWaitingLoopHeadNode

public void removeWaitingLoopHeadNode(FlowObject so)
Remove element from list of waiting loops.

Parameters:
so - loop to be removed.

getProgressMonitor

NodeProgressMonitor getProgressMonitor()
Returns:
the progressMonitor

progressChanged

public void progressChanged(NodeProgressEvent pe)
Invoked when the progress has changed.

Specified by:
progressChanged in interface NodeProgressListener
Parameters:
pe - The progress event holding the progress information.

addProgressListener

public boolean addProgressListener(NodeProgressListener listener)
Parameters:
listener - listener to the node progress
Returns:
true if the listener was not already registered before, false otherwise

removeNodeProgressListener

public boolean removeNodeProgressListener(NodeProgressListener listener)
Parameters:
listener - existing listener to the node progress
Returns:
true if the listener was successfully removed, false if it was not registered

notifyProgressListeners

protected void notifyProgressListeners(NodeProgressEvent e)
Notifies all registered NodeProgressListeners about the new progress.

Parameters:
e - the new progress event

addNodeMessageListener

public boolean addNodeMessageListener(NodeMessageListener listener)
Parameters:
listener - listener to the node messages (warnings and errors)
Returns:
true if the listener was not already registered, false otherwise

removeNodeMessageListener

public boolean removeNodeMessageListener(NodeMessageListener listener)
Parameters:
listener - listener to the node messages
Returns:
true if the listener was successfully removed, false if it was not registered

getNodeMessage

public final NodeMessage getNodeMessage()
Get the message to be displayed to the user.

Returns:
the node message consisting of type and message, never null.

setNodeMessage

public final void setNodeMessage(NodeMessage newMessage)
Parameters:
newMessage - the nodeMessage to set

notifyMessageListeners

protected final void notifyMessageListeners(NodeMessageEvent e)
Notifies all registered NodeMessageListeners about the new message.

Parameters:
e - the new message event

addUIInformationListener

public void addUIInformationListener(NodeUIInformationListener l)

removeUIInformationListener

public void removeUIInformationListener(NodeUIInformationListener l)

notifyUIListeners

protected void notifyUIListeners(NodeUIInformationEvent evt)

getUIInformation

public UIInformation getUIInformation()
Returns the UI information.

Returns:
a the node information

setUIInformation

public void setUIInformation(UIInformation uiInformation)
Parameters:
uiInformation - new user interface information of the node such as coordinates on workbench and custom name.

notifyStateChangeListeners

protected void notifyStateChangeListeners(NodeStateEvent e)
Notifies all registered NodeStateChangeListeners about the new state.

Parameters:
e - the new state change event

addNodeStateChangeListener

public boolean addNodeStateChangeListener(NodeStateChangeListener listener)
Parameters:
listener - listener to the node's state
Returns:
true if the listener was not already registered, false otherwise

removeNodeStateChangeListener

public boolean removeNodeStateChangeListener(NodeStateChangeListener listener)
Parameters:
listener - listener to the node's state.
Returns:
true if the listener was successfully removed, false if the listener was not registered

getState

public NodeContainer.State getState()
Returns:
the status of this node

setState

protected void setState(NodeContainer.State state)
Set new status and notify listeners.

Parameters:
state - the new state

setState

protected boolean setState(NodeContainer.State state,
                           boolean setDirty)
Set new status and notify listeners.

Parameters:
state - the new state
setDirty - whether to set this node "dirty" (needs save).
Returns:
true if change was changed.

throwIllegalStateException

protected void throwIllegalStateException()
Throws a new IllegalStateException with a meaningful error message containing node name, current state and method name. This method is used from the different state transition methods in SingleNodeContainer and WorkflowManager.


getDialogPaneWithSettings

public NodeDialogPane getDialogPaneWithSettings()
                                         throws NotConfigurableException
Return a NodeDialogPane for a node which can be embedded into a JFrame oder another GUI element.

Returns:
A dialog pane for the corresponding node.
Throws:
NotConfigurableException - if node can not be configured

openDialogInJFrame

public void openDialogInJFrame()
                        throws NotConfigurableException
Launch a node dialog in its own JFrame (a JDialog).

Throws:
NotConfigurableException - if node can not be configured

applySettingsFromDialog

public void applySettingsFromDialog()
                             throws InvalidSettingsException
Take settings from the node's dialog and apply them to the model. Throws an exception if the apply fails.

Throws:
InvalidSettingsException - if settings are not applicable.

areDialogSettingsValid

public boolean areDialogSettingsValid()

hasDialog

public abstract boolean hasDialog()

getDialogPaneWithSettings

abstract NodeDialogPane getDialogPaneWithSettings(PortObjectSpec[] inSpecs)
                                           throws NotConfigurableException
Throws:
NotConfigurableException

getDialogPane

abstract NodeDialogPane getDialogPane()

areDialogAndNodeSettingsEqual

public abstract boolean areDialogAndNodeSettingsEqual()

loadSettings

void loadSettings(NodeSettingsRO settings)
            throws InvalidSettingsException
Throws:
InvalidSettingsException

saveSettings

void saveSettings(NodeSettingsWO settings)

areSettingsValid

boolean areSettingsValid(NodeSettingsRO settings)

getSplitType

NodeContainer.NodeContainerSettings.SplitType getSplitType()

getNrInPorts

public abstract int getNrInPorts()

getInPort

public abstract NodeInPort getInPort(int index)

getOutPort

public abstract NodeOutPort getOutPort(int index)

getNrOutPorts

public abstract int getNrOutPorts()

getNrViews

public int getNrViews()

getNrNodeViews

public abstract int getNrNodeViews()
Returns the number of views provided by the node implementation.

Returns:
the number of views provided by the node implementation

getViewName

public String getViewName(int i)

getNodeViewName

public abstract String getNodeViewName(int i)

getView

public AbstractNodeView<NodeModel> getView(int i)

getNodeView

public abstract AbstractNodeView<NodeModel> getNodeView(int i)
Return the view with the specified index provided by the node.

Parameters:
i - the view to create
Returns:
a new view instance with index i provided by the node

resetJobManagerViews

protected void resetJobManagerViews()
Must be called when the node is reset.


closeAllJobManagerViews

protected void closeAllJobManagerViews()

getIcon

public abstract URL getIcon()

getType

public abstract NodeFactory.NodeType getType()

getID

public final NodeID getID()

getName

public abstract String getName()

getNameWithID

public final String getNameWithID()

toString

public String toString()
Overrides:
toString in class Object
Returns:
Node name with status information.

getDisplayLabel

public String getDisplayLabel()
Returns:
the display label for NodeView, OutPortView and NodeDialog

getCustomName

public String getCustomName()

setCustomName

public void setCustomName(String customName)

getCustomDescription

public String getCustomDescription()

setCustomDescription

public void setCustomDescription(String customDescription)

isLocalWFM

protected abstract boolean isLocalWFM()
Is this node a to be locally executed workflow. In contrast to remotely executed workflows, the nodes in the encapsulated workflow will be executed independently (each represented by an own job), whereas remote execution means that the entire workflow execution is one single job.

This method returns false for all single node container.

Returns:
The above described property.

isDeletable

public boolean isDeletable()
Returns:
the isDeletable

cleanup

void cleanup()
Method that's called when the node is discarded. The single node container overwrites this method and cleans the outport data of the node (deletes temp files).


isDirty

public final boolean isDirty()
Returns:
the isDirty

setDirty

public void setDirty()
Mark this node container to be changed, that is, it needs to be saved.


unsetDirty

void unsetDirty()
Called from persistor when node has been saved.


getCopyPersistor

protected abstract NodeContainerPersistor getCopyPersistor(HashMap<Integer,ContainerTable> tableRep,
                                                           boolean preserveDeletableFlags)
Get a new persistor that is used to copy this node (copy&paste action).

Parameters:
tableRep - Table repository of the destination.
preserveDeletableFlags - Whether the "isdeleteable" annotation should be copied also (false when individual nodes are copied but true when an entire meta node is copied).
Returns:
A new persistor for copying.

setNodeContainerDirectory

protected final void setNodeContainerDirectory(ReferencedFile directory)
Parameters:
directory - the nodeContainerDirectory to set

getNodeContainerDirectory

protected final ReferencedFile getNodeContainerDirectory()
Returns:
the nodeContainerDirectory

loadContent

abstract NodeID[] loadContent(NodeContainerPersistor persistor,
                              Map<Integer,BufferedDataTable> tblRep,
                              FlowObjectStack inStack,
                              ExecutionMonitor exec,
                              WorkflowPersistor.LoadResult loadResult,
                              boolean preserveNodeMessage)
                       throws CanceledExecutionException
Restore content from persistor. This represents the second step when loading a workflow.

Parameters:
persistor - To load from.
tblRep - A table repository to restore BufferedDatTables
inStack - Incoming FlowObjectStack.
exec - For progress
loadResult - Where to report errors/warnings to
preserveNodeMessage - Whether possible node messages in the persistor are to be preserved (parameter to configure method that is called during load).
Returns:
The list of nodes that were inserted, for single node containers the result is an empty array.
Throws:
CanceledExecutionException - If canceled.

loadExecutionResult

public void loadExecutionResult(NodeContainerExecutionResult result,
                                ExecutionMonitor exec,
                                WorkflowPersistor.LoadResult loadResult)
Load information from execution result. Subclasses will override this method and will call this implementation as super.loadEx....

Parameters:
result - The execution result (contains port objects, messages, etc)
exec - For progress information (no cancelation supported)
loadResult - A load result that contains, e.g. error messages.

createExecutionResult

public abstract NodeContainerExecutionResult createExecutionResult(ExecutionMonitor exec)
                                                            throws CanceledExecutionException
Saves all internals that are necessary to mimic the computed result into a new execution result object. This method is called on node instances, which are, e.g. executed on a server and later on read back into a true KNIME instance (upon which #loadExecutionResult(NodeContainerExecutionResult, ExecutionMonitor, LoadResult) is called).

Parameters:
exec - For progress information (this method will copy port objects).
Returns:
A new execution result instance.
Throws:
CanceledExecutionException - If canceled.

saveExecutionResult

protected void saveExecutionResult(NodeContainerExecutionResult result)
Saves all information that is held in this abstract NodeContainer into the argument.

Parameters:
result - Where to save to.


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.