Class WorkflowManagerWrapper

java.lang.Object
org.knime.core.ui.wrapper.AbstractWrapper<W>
org.knime.core.ui.wrapper.NodeContainerWrapper<org.knime.core.node.workflow.WorkflowManager>
org.knime.core.ui.wrapper.WorkflowManagerWrapper
All Implemented Interfaces:
EventListener, org.knime.core.node.workflow.NodeContainerStateObservable, org.knime.core.node.workflow.NodeProgressListener, NodeContainerUI, WorkflowManagerUI, UI, Wrapper<org.knime.core.node.workflow.WorkflowManager>

public final class WorkflowManagerWrapper extends NodeContainerWrapper<org.knime.core.node.workflow.WorkflowManager> implements WorkflowManagerUI
Implements the WorkflowManagerUI interface by simply wrapping the WorkflowManager implementation. For all return types that implement an interface (from core.api), another wrapper instance is returned.
Author:
Martin Horn, University of Konstanz
  • Method Details

    • wrap

      public static final WorkflowManagerWrapper wrap(org.knime.core.node.workflow.WorkflowManager wfm)
      Parameters:
      wfm - the object to be wrapped
      Returns:
      a new wrapper or a already existing one
    • removeProject

      public void removeProject(org.knime.core.node.workflow.NodeID id)
      Description copied from interface: WorkflowManagerUI
      Remove a project - the same as remove node but we make sure it really looks like a project (i.e. has no in- or outports).
      Specified by:
      removeProject in interface WorkflowManagerUI
      Parameters:
      id - of the project to be removed.
    • createAndAddNode

      public org.knime.core.node.workflow.NodeID createAndAddNode(org.knime.core.node.NodeFactory<?> factory, org.knime.core.node.workflow.NodeUIInformation uiInfo)
      Description copied from interface: WorkflowManagerUI
      Uses given factory to create a new node and then adds new node to the workflow manager. We will automatically find the next available free index for the new node within the given prefix.
      Specified by:
      createAndAddNode in interface WorkflowManagerUI
      Parameters:
      factory - the factory representing the new node
      uiInfo - essentially the position of the new node
      Returns:
      newly created (unique) NodeID
    • createAndAddNode

      public org.knime.core.node.workflow.NodeID createAndAddNode(org.knime.core.node.NodeFactory<?> factory, org.knime.core.node.workflow.NodeUIInformation uiInfo, org.knime.core.node.context.ModifiableNodeCreationConfiguration creationConfig)
      Description copied from interface: WorkflowManagerUI
      Uses given factory to create a new node w.r.t. the creation configuration and then adds it to the workflow manager. We will automatically find the next available free index for the new node within the given prefix.
      Specified by:
      createAndAddNode in interface WorkflowManagerUI
      Parameters:
      factory - the factory representing the new node
      uiInfo - essentially the position of the new node
      creationConfig - the node creation configuration or null
      Returns:
      newly created (unique) NodeID
    • canReplaceNode

      public boolean canReplaceNode(org.knime.core.node.workflow.NodeID id)
      Description copied from interface: WorkflowManagerUI
      Checks whether a node can be replaced with another version of itself (i.e. whether WorkflowManagerUI.replaceNode(NodeID, ModifiableNodeCreationConfiguration) can be called subsequently).
      Specified by:
      canReplaceNode in interface WorkflowManagerUI
      Returns:
      true if node can be replaced, otherwise false
    • replaceNode

      public UndoableUI replaceNode(org.knime.core.node.workflow.NodeID id, org.knime.core.node.context.ModifiableNodeCreationConfiguration creationConfig)
      Description copied from interface: WorkflowManagerUI
      Replaces a node with same type of node but another NodeCreationConfiguration, e.g. in order to change the ports. Operation is only applicable for NativeNodeContainers. Otherwise an IllegalAccessException will be thrown. Node settings and annotation will be transfered to the new node. Incoming and outgoing connections will be kept as far as possible (if the respective input and output port is still there and compatible).
      Specified by:
      replaceNode in interface WorkflowManagerUI
      Parameters:
      id - the id of the node to replace
      creationConfig - node creation configuration to create the new node
      Returns:
      undo object
    • canRemoveNode

      public boolean canRemoveNode(org.knime.core.node.workflow.NodeID nodeID)
      Description copied from interface: WorkflowManagerUI
      Check if specific node can be removed (i.e. is not currently being executed or waiting to be).
      Specified by:
      canRemoveNode in interface WorkflowManagerUI
      Parameters:
      nodeID - id of node to be removed
      Returns:
      true if node can safely be removed.
    • remove

      public void remove(org.knime.core.node.workflow.NodeID[] nodeIDs, org.knime.core.node.workflow.ConnectionID[] connectionIDs, org.knime.core.node.workflow.WorkflowAnnotationID[] annotationIDs)
      Description copied from interface: WorkflowManagerUI
      Removes the given workflow parts. If there is no corresponding part for a given id, it will be ignored.
      Specified by:
      remove in interface WorkflowManagerUI
      Parameters:
      nodeIDs - the ids of the nodes to be removed or null.
      connectionIDs - the ids of the connections to be removed or null.
      annotationIDs - the ids of the workflow annotations to be removed or null.
    • isProject

      public boolean isProject()
      Description copied from interface: WorkflowManagerUI
      Returns true if this workflow manager is a project (which usually means that the parent is #ROOT). It returns false if this workflow is only a metanode in another metanode or project.
      Specified by:
      isProject in interface WorkflowManagerUI
      Returns:
      This property.
    • canAddConnection

      public boolean canAddConnection(org.knime.core.node.workflow.NodeID source, int sourcePort, org.knime.core.node.workflow.NodeID dest, int destPort)
      Description copied from interface: WorkflowManagerUI
      Check if a new connection can be added.
      Specified by:
      canAddConnection in interface WorkflowManagerUI
      Parameters:
      source - node id
      sourcePort - port index at source node
      dest - destination node id
      destPort - port index at destination node
      Returns:
      true if connection can be added.
    • canAddNewConnection

      public boolean canAddNewConnection(org.knime.core.node.workflow.NodeID source, int sourcePort, org.knime.core.node.workflow.NodeID dest, int destPort)
      Specified by:
      canAddNewConnection in interface WorkflowManagerUI
      Parameters:
      source - ID of the source node
      sourcePort - Index of the sources port
      dest - ID of the destination node
      destPort - Index of the destination port
      Returns:
      true if the connection can be added, false otherwise
    • canRemoveConnection

      public boolean canRemoveConnection(ConnectionContainerUI connection)
      Description copied from interface: WorkflowManagerUI
      Check if a connection can safely be removed.
      Specified by:
      canRemoveConnection in interface WorkflowManagerUI
      Returns:
      true if connection is removable.
    • addConnection

      public ConnectionContainerUI addConnection(org.knime.core.node.workflow.NodeID source, int sourcePort, org.knime.core.node.workflow.NodeID dest, int destPort, int[]... bendpoints)
      Description copied from interface: WorkflowManagerUI
      Add new connection - throw Exception if the same connection already exists.
      Specified by:
      addConnection in interface WorkflowManagerUI
      Parameters:
      source - node id
      sourcePort - port index at source node
      dest - destination node id
      destPort - port index at destination node
      bendpoints - the connection's bendpoints, or empty or null if none
      Returns:
      newly created Connection object
    • getOutgoingConnectionsFor

      public Set<ConnectionContainerUI> getOutgoingConnectionsFor(org.knime.core.node.workflow.NodeID id, int portIdx)
      Description copied from interface: WorkflowManagerUI
      Returns the set of outgoing connections for the node with the passed id at the specified port.
      Specified by:
      getOutgoingConnectionsFor in interface WorkflowManagerUI
      Parameters:
      id - id of the node of interest
      portIdx - port index of that node
      Returns:
      all outgoing connections for the passed node at the specified port
    • getOutgoingConnectionsFor

      public Set<ConnectionContainerUI> getOutgoingConnectionsFor(org.knime.core.node.workflow.NodeID id)
      Description copied from interface: WorkflowManagerUI
      Get all outgoing connections for a node.
      Specified by:
      getOutgoingConnectionsFor in interface WorkflowManagerUI
      Parameters:
      id - The requested node
      Returns:
      All current outgoing connections in a new set.
    • getIncomingConnectionFor

      public ConnectionContainerUI getIncomingConnectionFor(org.knime.core.node.workflow.NodeID id, int portIdx)
      Description copied from interface: WorkflowManagerUI
      Returns the incoming connection of the node with the passed node id at the specified port.
      Specified by:
      getIncomingConnectionFor in interface WorkflowManagerUI
      Parameters:
      id - id of the node of interest
      portIdx - port index
      Returns:
      incoming connection at that port of the given node or null if it doesn't exist
    • getIncomingConnectionsFor

      public Set<ConnectionContainerUI> getIncomingConnectionsFor(org.knime.core.node.workflow.NodeID id)
      Description copied from interface: WorkflowManagerUI
      Get all incoming connections for a node.
      Specified by:
      getIncomingConnectionsFor in interface WorkflowManagerUI
      Parameters:
      id - The requested node
      Returns:
      All current incoming connections in a new set.
    • getConnection

      public ConnectionContainerUI getConnection(org.knime.core.node.workflow.ConnectionID id)
      Description copied from interface: WorkflowManagerUI
      Gets a connection by id.
      Specified by:
      getConnection in interface WorkflowManagerUI
      Parameters:
      id - of the connection to return
      Returns:
      the connection with the specified id
    • getMetanodeInputPortInfo

      public org.knime.core.node.port.MetaPortInfo[] getMetanodeInputPortInfo(org.knime.core.node.workflow.NodeID metaNodeID)
      Description copied from interface: WorkflowManagerUI
      Get information on input ports of the argument (meta) node. It's used by the routines that allow the user to change the port information (add, delete, move).
      Specified by:
      getMetanodeInputPortInfo in interface WorkflowManagerUI
      Parameters:
      metaNodeID - The argument node
      Returns:
      the metanode's port info.
    • getMetanodeOutputPortInfo

      public org.knime.core.node.port.MetaPortInfo[] getMetanodeOutputPortInfo(org.knime.core.node.workflow.NodeID metaNodeID)
      Description copied from interface: WorkflowManagerUI
      Get information on output ports of the argument (meta) node. Similar to WorkflowManagerUI.getMetanodeInputPortInfo(NodeID).
      Specified by:
      getMetanodeOutputPortInfo in interface WorkflowManagerUI
      Parameters:
      metaNodeID - ...
      Returns:
      ...
    • resetAndConfigureAll

      public void resetAndConfigureAll()
      Description copied from interface: WorkflowManagerUI
      Resets and freshly configures all nodes in this workflow.
      Specified by:
      resetAndConfigureAll in interface WorkflowManagerUI
    • executeUpToHere

      public void executeUpToHere(org.knime.core.node.workflow.NodeID... ids)
      Description copied from interface: WorkflowManagerUI
      mark these nodes and all not-yet-executed predecessors for execution. They will be marked first, queued when all inputs are available and finally executed.
      Specified by:
      executeUpToHere in interface WorkflowManagerUI
      Parameters:
      ids - node ids to mark
    • canReExecuteNode

      public boolean canReExecuteNode(org.knime.core.node.workflow.NodeID id)
      Specified by:
      canReExecuteNode in interface WorkflowManagerUI
      Parameters:
      id - ...
      Returns:
      true if node can be re-executed.
    • saveNodeSettingsToDefault

      public void saveNodeSettingsToDefault(org.knime.core.node.workflow.NodeID id)
      Description copied from interface: WorkflowManagerUI
      Called by views of interactive nodes. It will take the settings of the NodeModel and save them in the SingleNodeContainer.SingleNodeContainerSettings so that they become the default for the next execution.
      Specified by:
      saveNodeSettingsToDefault in interface WorkflowManagerUI
      Parameters:
      id - The node in question.
    • executePredecessorsAndWait

      public void executePredecessorsAndWait(org.knime.core.node.workflow.NodeID id) throws InterruptedException
      Description copied from interface: WorkflowManagerUI
      Attempts to execute all nodes upstream of the argument node. The method waits (until either all predecessors are executed or there is no further chance to execute anything).
      Specified by:
      executePredecessorsAndWait in interface WorkflowManagerUI
      Parameters:
      id - The node whose upstream nodes need to be executed.
      Throws:
      InterruptedException - If thread is canceled during waiting (has no affect on the workflow execution).
    • canResetNode

      public boolean canResetNode(org.knime.core.node.workflow.NodeID nodeID)
      Description copied from interface: WorkflowManagerUI
      Check if a node can be reset, meaning that it is executed and all of its successors are idle or executed as well. We do not want to mess with executing chains.
      Specified by:
      canResetNode in interface WorkflowManagerUI
      Parameters:
      nodeID - the id of the node
      Returns:
      true if the node can safely be reset.
    • resetAndConfigureNode

      public void resetAndConfigureNode(org.knime.core.node.workflow.NodeID id)
      Description copied from interface: WorkflowManagerUI
      Reset node and all executed successors of a specific node and launch configure storm.
      Specified by:
      resetAndConfigureNode in interface WorkflowManagerUI
      Parameters:
      id - of first node in chain to be reset.
    • canExecuteNode

      public boolean canExecuteNode(org.knime.core.node.workflow.NodeID nodeID)
      Description copied from interface: WorkflowManagerUI
      Check if a node can be executed either directly or via chain of nodes that include an executable node.
      Specified by:
      canExecuteNode in interface WorkflowManagerUI
      Parameters:
      nodeID - id of node
      Returns:
      true if node can be executed.
    • canCancelNode

      public boolean canCancelNode(org.knime.core.node.workflow.NodeID nodeID)
      Description copied from interface: WorkflowManagerUI
      Check if a node can be cancelled individually.
      Specified by:
      canCancelNode in interface WorkflowManagerUI
      Parameters:
      nodeID - id of node
      Returns:
      true if node can be cancelled
    • canCancelAll

      public boolean canCancelAll()
      Specified by:
      canCancelAll in interface WorkflowManagerUI
      Returns:
      true if all nodes in this workflow / metanode can be canceled.
    • cancelExecution

      public void cancelExecution(NodeContainerUI nc)
      Description copied from interface: WorkflowManagerUI
      Cancel execution of the given NodeContainer.
      Specified by:
      cancelExecution in interface WorkflowManagerUI
      Parameters:
      nc - node to be canceled
      Since:
      3.6
    • shutdown

      public void shutdown()
      Description copied from interface: WorkflowManagerUI
      Attempts to cancel or running nodes in preparation for a removal of this node (or its parent) from the root. Executing nodes, which can be disconnected from the execution (e.g. remote cluster execution) are disconnected if their status has been saved before.
      Specified by:
      shutdown in interface WorkflowManagerUI
    • executeAllAndWaitUntilDone

      public boolean executeAllAndWaitUntilDone()
      Description copied from interface: WorkflowManagerUI
      Convenience method: execute all and wait for execution to be done. This method silently swallows InterruptedException and returns the state at the time of interrupt -- the interrupt state of the calling thread is reset then so use with caution.
      Specified by:
      executeAllAndWaitUntilDone in interface WorkflowManagerUI
      Returns:
      true if execution was successful
      See Also:
    • executeAllAndWaitUntilDoneInterruptibly

      public boolean executeAllAndWaitUntilDoneInterruptibly() throws InterruptedException
      Description copied from interface: WorkflowManagerUI
      Execute all nodes and wait until workflow reaches a stable state.
      Specified by:
      executeAllAndWaitUntilDoneInterruptibly in interface WorkflowManagerUI
      Returns:
      true if execution was successful
      Throws:
      InterruptedException - If the calling thread is interrupted. This will not cancel the execution of the workflow.
    • waitWhileInExecution

      public boolean waitWhileInExecution(long time, TimeUnit unit) throws InterruptedException
      Description copied from interface: WorkflowManagerUI
      Causes the current thread to wait until the the workflow has reached a non-executing state unless a given timeout elapsed.
      Specified by:
      waitWhileInExecution in interface WorkflowManagerUI
      Parameters:
      time - the maximum time to wait (0 or negative for waiting infinitely)
      unit - the time unit of the time argument
      Returns:
      false if the waiting time detectably elapsed before return from the method, else true. It returns true if the time argument is 0 or negative.
      Throws:
      InterruptedException - if the current thread is interrupted
    • canExecuteAll

      public boolean canExecuteAll()
      Description copied from interface: WorkflowManagerUI
      Called by execute-all action to (attempt to) execute all nodes in the workflow. This is true when there is at least one node that is executable (even though the state of the wfm is idle).
      Specified by:
      canExecuteAll in interface WorkflowManagerUI
      Returns:
      that property
    • executeAll

      public void executeAll()
      Description copied from interface: WorkflowManagerUI
      (Try to) Execute all nodes in the workflow. This method only marks the end nodes for execution and then returns immediately. If a job manager is set on the WFM this one will run the execution. In any case this method returns immediately and does not wait for the execution to finish.
      Specified by:
      executeAll in interface WorkflowManagerUI
      See Also:
    • printNodeSummary

      public String printNodeSummary(org.knime.core.node.workflow.NodeID prefix, int indent)
      Description copied from interface: WorkflowManagerUI
      Produce summary of node.
      Specified by:
      printNodeSummary in interface WorkflowManagerUI
      Parameters:
      prefix - if containing node/workflow
      indent - number of leading spaces
      Returns:
      string
    • getNodeContainers

      public Collection<NodeContainerUI> getNodeContainers()
      Specified by:
      getNodeContainers in interface WorkflowManagerUI
      Returns:
      all node containers within this workflow manager
    • getConnectionContainers

      public Collection<ConnectionContainerUI> getConnectionContainers()
      Specified by:
      getConnectionContainers in interface WorkflowManagerUI
      Returns:
      collection of ConnectionContainer in this WFM
    • getNodeContainer

      public NodeContainerUI getNodeContainer(org.knime.core.node.workflow.NodeID id)
      Specified by:
      getNodeContainer in interface WorkflowManagerUI
      Parameters:
      id - node ID
      Returns:
      NodeContainer for given ID
    • containsNodeContainer

      public boolean containsNodeContainer(org.knime.core.node.workflow.NodeID id)
      Description copied from interface: WorkflowManagerUI
      Does the workflow contain a node with the argument id?
      Specified by:
      containsNodeContainer in interface WorkflowManagerUI
      Parameters:
      id - The id in question.
      Returns:
      true if there is node with the given id, false otherwise.
    • getNodeContainer

      public <T> T getNodeContainer(org.knime.core.node.workflow.NodeID id, Class<T> subclass, boolean failOnError)
      Description copied from interface: WorkflowManagerUI
      Get contained node container and cast to argument class. Throws exception if it not exists or not implementing requested class unless the flag is false.
      Specified by:
      getNodeContainer in interface WorkflowManagerUI
      Type Parameters:
      T - The interface or subclass the NodeContainer is expected to implement.
      Parameters:
      id - The node to retrieve.
      subclass - the expected sub class, usually sub-classes of NodeContainer but could also be implementing interface.
      failOnError - Fails if node is not found or not of expected type. Otherwise it just prints a DEBUG message.
      Returns:
      The node..
    • getNodeErrorMessages

      @Deprecated public List<org.knime.core.node.workflow.NodeMessage> getNodeErrorMessages()
      Deprecated.
      Specified by:
      getNodeErrorMessages in interface WorkflowManagerUI
      Returns:
      list of errors messages (list empty if none exist).
    • getNodeMessages

      public List<org.knime.core.util.Pair<String,org.knime.core.node.workflow.NodeMessage>> getNodeMessages(org.knime.core.node.workflow.NodeMessage.Type... types)
      Description copied from interface: WorkflowManagerUI
      Get all node messages, recursively collected from all contained.
      Specified by:
      getNodeMessages in interface WorkflowManagerUI
      Parameters:
      types - A list of messge types (e.g. all errors and warnings). Argument must not be empty, null or contain null values
      Returns:
      list of errors messages (list empty if none exist).
    • isWriteProtected

      public boolean isWriteProtected()
      Specified by:
      isWriteProtected in interface WorkflowManagerUI
      Returns:
      Whether edit operations are not permitted.
    • getLinkedMetaNodes

      public List<org.knime.core.node.workflow.NodeID> getLinkedMetaNodes(boolean recurse)
      Description copied from interface: WorkflowManagerUI
      The list of contained metanodes that are linked metanodes. If recurse flag is set, each metanode is checked recursively.
      Specified by:
      getLinkedMetaNodes in interface WorkflowManagerUI
      Parameters:
      recurse - ...
      Returns:
      list of node ids, ids not necessarily direct childs of this WFM!
    • canUpdateMetaNodeLink

      public boolean canUpdateMetaNodeLink(org.knime.core.node.workflow.NodeID id)
      Description copied from interface: WorkflowManagerUI
      Returns true if the argument node is a valid metanode link and is not executing and has no successor in execution. Used from the GUI to enable or disable the update action. It does not test whether there is a newer version of the metanode available. It may also return true even if the metanode is executed or contains executed nodes.
      Specified by:
      canUpdateMetaNodeLink in interface WorkflowManagerUI
      Parameters:
      id - The metanode in question.
      Returns:
      The above described property.
    • hasUpdateableMetaNodeLink

      public boolean hasUpdateableMetaNodeLink(org.knime.core.node.workflow.NodeID id)
      Description copied from interface: WorkflowManagerUI
      Returns true when the metanode for the given ID is a link or contains links, which have the update status set (doesn't actually check on remote side but uses cached information). It assumes #checkUpdateMetaNodeLink(NodeID, WorkflowLoadHelper) has been called before.

      This method is used by an UI action and is not meant as public API.

      Specified by:
      hasUpdateableMetaNodeLink in interface WorkflowManagerUI
      Parameters:
      id - The id to the metanode.
      Returns:
      if the ID is unknown or there are no metanodes with the appropriate update flag.
    • isUnlocked

      public boolean isUnlocked()
      Specified by:
      isUnlocked in interface WorkflowManagerUI
      Returns:
      see WorkflowCipher#isUnlocked().
    • getPasswordHint

      public String getPasswordHint()
      Specified by:
      getPasswordHint in interface WorkflowManagerUI
      Returns:
      see WorkflowCipher#getPasswordHint().
    • isEncrypted

      public boolean isEncrypted()
      Specified by:
      isEncrypted in interface WorkflowManagerUI
      Returns:
      see WorkflowCipher#isEncrypted().
    • addListener

      public void addListener(org.knime.core.node.workflow.WorkflowListener listener)
      Description copied from interface: WorkflowManagerUI
      Add listener to list.
      Specified by:
      addListener in interface WorkflowManagerUI
      Parameters:
      listener - new listener
    • removeListener

      public void removeListener(org.knime.core.node.workflow.WorkflowListener listener)
      Description copied from interface: WorkflowManagerUI
      Remove listener.
      Specified by:
      removeListener in interface WorkflowManagerUI
      Parameters:
      listener - listener to be removed
    • copy

      public WorkflowCopyUI copy(org.knime.core.node.workflow.WorkflowCopyContent content)
      Copy the given content
      Specified by:
      copy in interface WorkflowManagerUI
      Parameters:
      content - The content to copy (must exist).
      Returns:
      An object representing the copied objects ready to be used in the WorkflowManagerUI.paste(WorkflowCopyUI) method.
    • cut

      public WorkflowCopyUI cut(org.knime.core.node.workflow.WorkflowCopyContent content)
      Cuts, i.e. copies and deletes, the given content.
      Specified by:
      cut in interface WorkflowManagerUI
      Parameters:
      content - The content to copy and delete (must exist).
      Returns:
      An object representing the copied objects ready to be used in the WorkflowManagerUI.paste(WorkflowCopyUI) method for undo.
    • paste

      public org.knime.core.node.workflow.WorkflowCopyContent paste(WorkflowCopyUI workflowCopy)
      Pastes the contents of the argument workflow copy into this wfm.
      Specified by:
      paste in interface WorkflowManagerUI
      Parameters:
      workflowCopy - The copy created with WorkflowManagerUI.copy(WorkflowCopyContent) method.
      Returns:
      The new node ids of the inserted nodes and the annotations in a dedicated object.
      Throws:
      IllegalArgumentException - if the workflow copy is not of type WorkflowPersistorWrapper
    • setAutoSaveDirectoryDirtyRecursivly

      public void setAutoSaveDirectoryDirtyRecursivly()
      Description copied from interface: WorkflowManagerUI
      Marks the workflow and all nodes contained as dirty in the auto-save location.
      Specified by:
      setAutoSaveDirectoryDirtyRecursivly in interface WorkflowManagerUI
    • setName

      public void setName(String name)
      Description copied from interface: WorkflowManagerUI
      Set new name of this workflow or null to reset the name (will then return the workflow directory in WorkflowManagerUI.getName() or null if this flow has not been saved yet).
      Specified by:
      setName in interface WorkflowManagerUI
      Parameters:
      name - The new name or null
    • renameWorkflowDirectory

      public boolean renameWorkflowDirectory(String newName)
      Description copied from interface: WorkflowManagerUI
      Renames the underlying workflow directory to the new name.
      Specified by:
      renameWorkflowDirectory in interface WorkflowManagerUI
      Parameters:
      newName - The name of the directory.
      Returns:
      Whether that was successful.
    • getNameField

      public String getNameField()
      Specified by:
      getNameField in interface WorkflowManagerUI
      Returns:
      the name set in the constructor or via WorkflowManagerUI.setName(String). In comparison to WorkflowManagerUI.getName() this method does not use the workflow directory name if no other name is set.
    • setEditorUIInformation

      public void setEditorUIInformation(org.knime.core.node.workflow.EditorUIInformation editorInfo)
      Description copied from interface: WorkflowManagerUI
      Stores the editor specific settings. Stores a reference to the object. Does not create a copy.
      Specified by:
      setEditorUIInformation in interface WorkflowManagerUI
      Parameters:
      editorInfo - the settings to store
    • getEditorUIInformation

      public org.knime.core.node.workflow.EditorUIInformation getEditorUIInformation()
      Description copied from interface: WorkflowManagerUI
      Returns the editor specific settings.
      Specified by:
      getEditorUIInformation in interface WorkflowManagerUI
      Returns:
      the editor settings currently stored, can be null (in that case the settings of the parent workflow manager are usually used)
    • getNrWorkflowIncomingPorts

      public int getNrWorkflowIncomingPorts()
      Specified by:
      getNrWorkflowIncomingPorts in interface WorkflowManagerUI
      Returns:
      The number of incoming ports
    • getNrWorkflowOutgoingPorts

      public int getNrWorkflowOutgoingPorts()
      Specified by:
      getNrWorkflowOutgoingPorts in interface WorkflowManagerUI
      Returns:
      The number of outgoing ports
    • getWorkflowIncomingPort

      public NodeOutPortWrapper getWorkflowIncomingPort(int i)
      Specified by:
      getWorkflowIncomingPort in interface WorkflowManagerUI
      Parameters:
      i - Index of the port
      Returns:
      The incoming port at the given index
    • getWorkflowOutgoingPort

      public NodeInPortWrapper getWorkflowOutgoingPort(int i)
      Specified by:
      getWorkflowOutgoingPort in interface WorkflowManagerUI
      Parameters:
      i - Index of the port
      Returns:
      The outgoing port at the given index
    • setInPortsBarUIInfo

      public void setInPortsBarUIInfo(org.knime.core.node.workflow.NodeUIInformation inPortsBarUIInfo)
      Description copied from interface: WorkflowManagerUI
      Set UI information for workflow's input ports (typically aligned as a bar).
      Specified by:
      setInPortsBarUIInfo in interface WorkflowManagerUI
      Parameters:
      inPortsBarUIInfo - The new UI info.
    • setOutPortsBarUIInfo

      public void setOutPortsBarUIInfo(org.knime.core.node.workflow.NodeUIInformation outPortsBarUIInfo)
      Description copied from interface: WorkflowManagerUI
      Set UI information for workflow's output ports (typically aligned as a bar).
      Specified by:
      setOutPortsBarUIInfo in interface WorkflowManagerUI
      Parameters:
      outPortsBarUIInfo - The new UI info.
    • getInPortsBarUIInfo

      public org.knime.core.node.workflow.NodeUIInformation getInPortsBarUIInfo()
      Description copied from interface: WorkflowManagerUI
      Get UI information for workflow input ports.
      Specified by:
      getInPortsBarUIInfo in interface WorkflowManagerUI
      Returns:
      the ui info or null if not set.
      See Also:
    • getOutPortsBarUIInfo

      public org.knime.core.node.workflow.NodeUIInformation getOutPortsBarUIInfo()
      Description copied from interface: WorkflowManagerUI
      Get UI information for workflow output ports.
      Specified by:
      getOutPortsBarUIInfo in interface WorkflowManagerUI
      Returns:
      the ui info or null if not set.
      See Also:
    • getWorkflowVariables

      public List<org.knime.core.node.workflow.FlowVariable> getWorkflowVariables()
      Description copied from interface: WorkflowManagerUI
      Get read-only access on the current workflow variables.
      Specified by:
      getWorkflowVariables in interface WorkflowManagerUI
      Returns:
      the current workflow variables, never null.
    • getInPort

      public WorkflowInPortUI getInPort(int index)
      Description copied from interface: WorkflowManagerUI
      Specified by:
      getInPort in interface NodeContainerUI
      Specified by:
      getInPort in interface WorkflowManagerUI
      Overrides:
      getInPort in class NodeContainerWrapper<org.knime.core.node.workflow.WorkflowManager>
    • getOutPort

      public WorkflowOutPortUI getOutPort(int index)
      Description copied from interface: WorkflowManagerUI
      Specified by:
      getOutPort in interface NodeContainerUI
      Specified by:
      getOutPort in interface WorkflowManagerUI
      Overrides:
      getOutPort in class NodeContainerWrapper<org.knime.core.node.workflow.WorkflowManager>
    • getWorkflowAnnotations

      public Collection<org.knime.core.node.workflow.WorkflowAnnotation> getWorkflowAnnotations()
      Specified by:
      getWorkflowAnnotations in interface WorkflowManagerUI
      Returns:
      read-only collection of all currently registered annotations.
    • getWorkflowAnnotations

      public org.knime.core.node.workflow.WorkflowAnnotation[] getWorkflowAnnotations(org.knime.core.node.workflow.WorkflowAnnotationID... ids)
      Description copied from interface: WorkflowManagerUI
      Helper method to get the workflow annotations referenced by the respective id.
      Specified by:
      getWorkflowAnnotations in interface WorkflowManagerUI
      Parameters:
      ids - the ids to get the annotation for
      Returns:
      a new array with the annotations - might contain null-entries if there is no annotation for the given id
    • addWorkflowAnnotation

      public org.knime.core.node.workflow.WorkflowAnnotation addWorkflowAnnotation(org.knime.core.node.workflow.AnnotationData annoData, int preferredIndex)
      Description copied from interface: WorkflowManagerUI
      Add new workflow annotation, fire events. The workflow annotation id will be set, too!
      Specified by:
      addWorkflowAnnotation in interface WorkflowManagerUI
      Parameters:
      annoData - to add
      preferredIndex - as per WorkflowManager.addWorkflowAnnotation(AnnotationData, int)
      Returns:
      a new annotation
    • bringAnnotationToFront

      public void bringAnnotationToFront(org.knime.core.node.workflow.WorkflowAnnotation annotation)
      Description copied from interface: WorkflowManagerUI
      Resorts the internal ids to move the specified annotation to the last index. It also updates its associated ids (of both, the passed annotation and the with the workflow manager stored annotation, if different).
      Specified by:
      bringAnnotationToFront in interface WorkflowManagerUI
      Parameters:
      annotation - to bring to front
    • sendAnnotationToBack

      public void sendAnnotationToBack(org.knime.core.node.workflow.WorkflowAnnotation annotation)
      Description copied from interface: WorkflowManagerUI
      Resorts the internal ids to move the specified annotation to the first index. It also updates it's associated id (of both, the passed annotation and the with the workflow manager stored annotation, if different).
      Specified by:
      sendAnnotationToBack in interface WorkflowManagerUI
      Parameters:
      annotation - to bring to front
    • nodeUIInformationChanged

      public void nodeUIInformationChanged(org.knime.core.node.workflow.NodeUIInformationEvent evt)
      Description copied from interface: WorkflowManagerUI
      Listener to annotations, etc; sets content dirty.
      Specified by:
      nodeUIInformationChanged in interface WorkflowManagerUI
      Parameters:
      evt - Change event.
    • getNodeAnnotations

      public List<org.knime.core.node.workflow.NodeAnnotation> getNodeAnnotations()
      Specified by:
      getNodeAnnotations in interface WorkflowManagerUI
      Returns:
      a list of all node annotations in the contained flow.
    • castNodeModel

      public <T> T castNodeModel(org.knime.core.node.workflow.NodeID id, Class<T> cl)
      Description copied from interface: WorkflowManagerUI
      Retrieves the node with the given ID, fetches the underlying NodeModel and casts it to the argument class.
      Specified by:
      castNodeModel in interface WorkflowManagerUI
      Type Parameters:
      T - The type the class
      Parameters:
      id - The node of interest
      cl - The class object the underlying NodeModel needs to implement
      Returns:
      The casted node model.
    • findNodes

      public <T> Map<org.knime.core.node.workflow.NodeID,T> findNodes(Class<T> nodeModelClass, boolean recurse)
      Description copied from interface: WorkflowManagerUI
      Find all nodes in this workflow, whose underlying NodeModel is of the requested type. Intended purpose is to allow certain extensions (reporting, web service, ...) access to specialized nodes.
      Specified by:
      findNodes in interface WorkflowManagerUI
      Type Parameters:
      T - Specific NodeModel derivation or another interface implemented by NodeModel instances.
      Parameters:
      nodeModelClass - The class of interest
      recurse - Whether to recurse into contained metanodes.
      Returns:
      A (unsorted) list of nodes matching the class criterion
    • findNodeContainer

      public NodeContainerWrapper findNodeContainer(org.knime.core.node.workflow.NodeID id)
      Description copied from interface: WorkflowManagerUI
      Get the node container associated with the argument id. Recurses into contained metanodes to find the node if it's not directly contained in this workflow level.

      Clients should generally use WorkflowManagerUI.getNodeContainer(NodeID) to access directly contained nodes.

      Specified by:
      findNodeContainer in interface WorkflowManagerUI
      Parameters:
      id - the id of the node in question
      Returns:
      The node container to the node id (never null)
    • getInputNodes

      public Map<String,org.knime.core.node.dialog.ExternalNodeData> getInputNodes()
      Description copied from interface: WorkflowManagerUI
      Get quickform nodes on the root level along with their currently set value. These are all DialogNode including special nodes like "JSON Input".

      Method is used to allow clients to retrieve an example input.

      Specified by:
      getInputNodes in interface WorkflowManagerUI
      Returns:
      A map from node's parameter name to its (JSON object value)
    • setInputNodes

      public void setInputNodes(Map<String,org.knime.core.node.dialog.ExternalNodeData> input) throws org.knime.core.node.InvalidSettingsException
      Description copied from interface: WorkflowManagerUI
      Counterpart to WorkflowManagerUI.getInputNodes() - it sets new values into quickform nodes on the root level. All nodes as per map argument will be reset as part of this call.
      Specified by:
      setInputNodes in interface WorkflowManagerUI
      Parameters:
      input - a map from node's parameter name to its (JSON or string object value). Invalid entries cause an exception.
      Throws:
      org.knime.core.node.InvalidSettingsException - If parameter name is not valid or a not uniquely defined in the workflow.
    • getExternalOutputs

      public Map<String,org.knime.core.node.dialog.ExternalNodeData> getExternalOutputs()
      Description copied from interface: WorkflowManagerUI
      Receive output from workflow by means of OutputNode. If the workflow is not fully executed, the map contains only the keys of the outputs. The values are all null in this case.
      Specified by:
      getExternalOutputs in interface WorkflowManagerUI
      Returns:
      A map from node's parameter name to its node data
    • removeWorkflowVariable

      public void removeWorkflowVariable(String name)
      Description copied from interface: WorkflowManagerUI
      Remove workflow variable of given name. The method may change in future versions or removed entirely (bug 1937).
      Specified by:
      removeWorkflowVariable in interface WorkflowManagerUI
      Parameters:
      name - of variable to be removed.
    • getContext

      public WorkflowContextUI getContext()
      Description copied from interface: WorkflowManagerUI
      Returns the current workflow context or null if no context is available.
      Specified by:
      getContext in interface WorkflowManagerUI
      Returns:
      a workflow context or null
    • notifyTemplateConnectionChangedListener

      public void notifyTemplateConnectionChangedListener()
      Specified by:
      notifyTemplateConnectionChangedListener in interface WorkflowManagerUI
    • hasCredentials

      public boolean hasCredentials()
      Description copied from interface: WorkflowManagerUI
      Indicates whether the workflow has credentials stored (except the implicit knime.system.default credentials that are set by KNIME Server).
      Specified by:
      hasCredentials in interface WorkflowManagerUI
      Returns:
      true if credentials are stored with the workflow
    • isInWizardExecution

      public boolean isInWizardExecution()
      Description copied from interface: WorkflowManagerUI
      Returns whether the workflow is executed in wizard execution or in regular execution mode.
      Specified by:
      isInWizardExecution in interface WorkflowManagerUI
      Returns:
      true if the workflow is executed in wizard execution (i.e. step by step), otherwise false