HOw to modify an existing node

Hi,

It's probably a basic question, but someone could say me the way to modify a node.

I want add some feature to the log-reg node : chi-square test, odd ratios and their IC, put the LL in the flow variables...

With the SDK, I can see the code, but I can't change it. I have try to create a new node, but I find no way to import the existing code in the new node.

Thank you for the answer

 

Hi,

The easiest thing to do might be to copy paste the node you want to modify in an own plugin and to modify the node there.

Christian

Hi,

Thanks a lot for your answer, but I don't know how to copy/paste the existing node in a new one. I have try to export/import the class but, I can't execute (various error retruned)

Ph

 

 

 

To find the source code and modify it follow these steps:

Go to the installation directory of your KNIME_SDK.
In the folder "plugins" look for the 'org.knime."something with source".jar' (see underlined part of directory below) files.
Open the .jar files with 7-zip or a similar program to see the content.
In those files are the source codes for the nodes

For example I am modifying the "TimeGenerator" node.
I found the source under:
"C:\Program Files\KNIME_SDK_2.11.3\plugins\org.knime.timeseries.source_2.11.0.0045392.jar\org\knime\timeseries\node\generator\".

After you have found the source code copy it to a new node extension. You can follow the steps in http://tech.knime.org/developer-guide.

 

Cheers

Hi @Mittosc ,

Thanks for this solution. I was able to open the .jar file of the node that I want but currently I am having a problem with finding the codes because when there’s no “.java” type files inside. I can only find “.class” files for NodeDialog, NodeFactory and NodeModel. Hope you can help me with this.

Br,
Gambit

Hi @Gambit,

As you have discovered, the solution proposed by @Mittosc is not ideal, can you tell me which node you want to modify? In many cases it might already be available on Github.
In all other cases you can use this method:

best,
Gabriel

2 Likes

Hi @gab1one ,

Thank you for your immediate response. Actually, I want to see the codes of the existing KNIME nodes that I can use to create new nodes. I am having some difficulties with coding so I thought studying the codes of the existing nodes will help me understand easier. I would love to know any suggestion from you guys.

Thanks and regards,
Gambit

Hi @Gambit,

In that case take a look at these repos, those contain various nodes that should help you:

Also please feel free to ask any questions you have here, we have a very helpful community on this forum.

best,
Gabriel

2 Likes