The extension plugin, also known as New Node Wizard, included in the KNIME developer version enables the user to easily create its own KNIME nodes. Two options are available to either create a new project in the workspace with a new node, or add a new node to an existing project. In both cases, the wizard generates all Java classes and registers the node with the KNIME repository. KNIME can immediately be launched to enjoy the functionality of the new node (unless no sample code was included – then it cannot be executed).
Create a new Node-Extension
To create a new node plugin, start the KNIME developer version and switch to the Java perspective. Select File –> New –> Other... Subsequently select the Create new KNIME Node-Extension bullet in the KNIME folder. The next dialog shows the node extension wizard. Here all settings are defined to create a new plugin project and a KNIME node.
The first two options are either to create a completely new project, or to place the new node in an existing project. The following node options are available: Specify the node class name (without spaces) that will be used as a prefix for the
NodeView. The package name describes the Java destination where the class files are created in, followed by a vendor text field and a description. In the node type combo box, select the node type: for example Source, Sink, Learner, Predictor, Manipulator, Visualizer, Meta, or Other node. Nodes of different types are colored differently in KNIME. Note: currently all automatically generated nodes have one data in port and one data out port only; but these can be changed inside the node implementation. A last option enables the user to create all node classes with sample code. The node simply appends a few columns to the input data then. Without this flag, only empty classes are created. Click the Finish button to create all Java classes and to register the new node in the corresponding plug-in project. The next time KNIME is launched, the node is immediately visible and functional.
KNIME's Core Node Classes
After the new plug-in project has been created, a look into the project's source folder shows all Java classes necessary to run a new KNIME node which is already registered with the project's plugin.xml. The
NodeFactory, the entry point for the platform, bundles all necessary node classes:
NodeView (both optional). In addition, a
NodeFactory.xml description is generated, which contains node properties such as a node description, node name, node type, icon, port and view descriptions, an explanation of all dialog options. These properties are shown inside the Node Description view in KNIME.
Create a new KNIME Runtime Configuration
In order to launch KNIME you need to create a new runtime configuration: open the Run menu and click Open Run Dialog... Within this frame a new runtime configuration can be set up by right-clicking the Eclipse Application tag. Specify a new workspace directory and select
org.knime.product.KNIME_APPLICATION as Run an application option. Inside the Arguments tab we recommend using the following VM arguments:
-ea -Xmx1G -XX:MaxPermSize=512M. Click Apply to apply the changes and click Run to launch KNIME.