Node executes functions always on the default parameters. How does the connection between NodeDialog and NodeModel work?

Hey all,
I’m trying to implement my own KNIME Node and I encountered a problem regarding the transfer of variables between NodeDialog and NodeModel.

In the NodeDialog, I created a SettingsModel, a DialogComponent, and added the DialogComponent to the Dialog as described in the NumberFormatter example. In the NodeModel, I defined a key parameter, a default parameter, and the createSettingsModel function. The execution of the nodes functions also works properly, BUT it always takes the default parameter - even if I changed it in the Node Dialog. I’m not sure, if I understood the implementation of NodeDialog and NodeModel properly, but I did the same steps as the NumberFormatter example suggested (… or obviously not since I’m asking …).

Has anybody encountered the same problem before? Can someone clarify the steps to take or can present a “best practice” approach?

Thanks in advance,
Johann

P.S. I can add snippets of my code later, if necessary.

Hi @wurz

Welcome to the KNIME forum and KNIME Node development!
It looks to me like you might not have added the new settingsmodel to the load / validate / save methods in your node model.

That would be the first place to check.
best,
Gabriel

Thanks for your advice, but I actually implemented that already.

In the meantime I found the problem. I instantiated another class before the updated parameters from the node’s dialog even were available. So it always took the default parameter.

Anyways, thank you very much for your help!

Best,
Johann

1 Like