Components are KNIME nodes that you create with a KNIME workflow. They compress and abstract functionality and can have their own classy, interactive views. Components can be reused in the same workflows and also can be shared with others using KNIME Server or the KNIME Hub. They can also represent web pages in an Analytical Application through KNIME Server.
In this blog, you will learn how to encapsulate nodes into components, to create custom views and also learn how Components can be executed. To know more, you can always check our KNIME Analytics Training to get knowledge of other different KNIME Components.
KNIME FOR DUMMIES
Must Check: Basics Nodes & Workflow in KNIME
What components or nodes does KNIME include?
KNIME presently includes the following nodes:
- I/O nodes for reading and writing data from files and databases
- Data manipulation nodes for managing the internal data tables that are used to pass information between components
- Charting and plotting nodes
- Statistics and Data Mining nodes
Must Check: Key Features of KNIME Analytics Platform
What are the KNIME Components?
KNIME Components are nodes that contain sub-workflows, which means, many further nodes. The most visible difference between nodes and components is that components let you bundle functionality for sharing and reusing. They can share not only workflows but also useful workflow pieces with the community using the KNIME Hub. Starting with version 4.0, they are called “Components” and we can build and share components. The Quickform Nodes have also been deprecated which was used to handle configuration as well as inputs, and now it is replaced with dedicated nodes for component configuration, input/output, and visualization widgets.
- Variable Scope: The variable scope of a Component is local which makes them self-containing and less polluting to the parent workflow. A flow variable defined inside a Component is by default not available outside it, and a flow variable defined outside the Component is by default not available inside it.
- Custom configuration dialogs: Components can have custom configuration dialogs.
Encapsulating Nodes into Components-
Create a Component by:
- Selecting the nodes that are to be encapsulated in the workflow editor by making a rectangle with a mouse over them
- Or, pressing the Ctrl button on the keypad and selecting single nodes with a mouse click
- Then, right-clicking the selection and selecting Create Componentin the menu
Configuring KNIME Components
The settings for Components are the Component name, and the input and output ports and their types.
To change the settings for a Component:
- Right-click the Component and select Reconfigure. In the dialog that opens, you can change the Component name, and add and remove input and output ports of any type.
- You can change these settings for a Component in much the same way: expand the Componentitem in its context menu, and select Setup. After that, a dialog opens similar to the dialog.
In the wizard, you can apply the following settings:
- Add input and output ports by clicking on the Addbutton and selecting the port type in the dialog that opens.
- Remove existing input and output ports by clicking the Remove Notice that you have to remove all connections coming to and from the port before you can remove it.
- Change the order of the input and output ports using the Upand Down Changing the order of the ports doesn’t affect any functionality of the workflow but is often practical to avoid crossing connections and thus improve the visual appearance of the workflow.
To return the nodes within a Component into their original, uncollapsed form, right-click on the Component and select Expand on the menu. To change a Component back to a simple Component, select Convert instead of Expand.
KNIME Component Dialogs
Now, let us see how to create a custom configuration dialog for a Component using Quickform nodes.
A Quickform node can provide input parameters for other nodes in the workflow. If you use one or more Quickform nodes inside a Component, the configuration dialog of the Component will show all these configuration options you created inside it in its custom dialog.
Quickform nodes enable different types of user inputs such as string input, integer input, selecting one value in a list and more. All the Quickform nodes are available in the node repository in the “Workflow Control” category under the “Quickforms” category.
The output of a Quickform node often is a flow variable. In the configuration dialog of the quickform node, you can describe the name and the default value of the flow variable, including some settings to control the appearance of the custom dialog, if the Quickform node is used inside a Component.
Another node can contact the flow variable output of a Quickform node if the flow variable output of the Quickform node is associated to it. The value of the output of the Quickform node is either defined by its default value or corresponds to the value provided by the user in the custom configuration dialog of the Component.
Custom Views on KNIME Components
Must Check: Build your first KNIME Workflow
A job manager defines how components or workflows are executed, i.e. in which order, and how the data is passed from one component to another. In every configuration dialog, there is a Job Manager Selection tab. It is set to “standard” by default, but it can be changed for single nodes and Components.
The different settings for the Job Manager are as follows:
In the standard execution model, the processes in a workflow are performed node by node. Data are passed from one node to another after the entire input data of a node has been processed. The dataset passed to the next node is the intermediate output table, which you can inspect by opening the output table of a node in the middle of a workflow.
If you open the Job Manager Selection tab in any configuration dialog and see the job manager selection (default), then the node operation is executed according to the standard execution model.
In the streaming execution model, data is passed from one node to another as soon as it is available i.e. the complete data need not be processed. Hence, the operating speed of the streaming execution model increases because only the rows “in transit” are concerned.
Streaming execution can be applied to single nodes or entire workflows inside a Component. The Streaming Executor is an extension available in KNIME Labs, which you can install by navigating to File – > Install KNIME Extensions
The streaming mode to execute a Component: If you use the streaming model to execute a Component, the sub-workflow inside it is always executed entirely. The intermediate output tables of the nodes inside the Component are not available, because they are not reserved. The nodes are connected by dotted connections, and the numbers above them show the number of records that have passed that particular connection. After this, please download & install KNIME Analytics Platform on your Windows or Mac.