Modify output table from NodeView

node-execution
#1

Hello. I’m implementing custom node and I want to create NodeView that would be able to affect output table. I saw it is possible in Scatter Plot (JavaScript), but I couldn’t find the source code for JS nodes to investigate it. How do I do it? Is there a way to ‘re-execute’ NodeModel, or shoud I store execute method params and just call execute method manually?

0 Likes

#2

Hi @ajbond,

The source code is available, but not yet on GitHub / Bitbucket. You can, however, access all sources by installing them via File > Install KNIME Extensions

and looking for the respective JAR file in the plugins/ folder of your KNIME installation.

Even the JS nodes are re-executed when you are applying a change.

Best,
Stefan

2 Likes

#3

Hi,

we are working on making the JavaScript repositories public as well within the next 2-3 weeks. Once this is done you can inspect it to figure out how exactly the JavaScript views work.

In short the nodes use two ‘transportation’ objects which need to be JSON-serializable. One we call the view representation is data and settings sent to the view that does not change. The other is called the view value and contains all the settings that can potentially be changed inside a view (e.g. the selection in the scatter plot). When you open the view and changes are made to the view value and you click the ‘Close’ button the framework will ask you what you want to do with the changes. If you then click apply, the view value is sent back to the node model and the node is re-executed (the execute method is run again). You can then use the information of the changed view value to populate the output table.

2 Likes

#4

Hi and thank you for your answers. What I was really looking for is the InteractiveView interface and the rest that comes with it to provide this kind of “view - node model” interactions.

0 Likes

#5

Hi,

try extending your node model from the org.knime.js.core.node.AbstractWizardNodeModel and your node factory should implement the org.knime.core.node.wizard.WizardNodeFactoryExtension.

Otherwise have a look at the other view’s implementations.

Cheers,
Christian

0 Likes