How do I make ports of a node take tuples as inputs or outputs? What is the PortObject parameter I’ve seen in some nodes?
Should I be using AWT and Swing for my dialog components or should I be using components in KNIME? (For example, the FileSelectionDialog class: org.knime.filehandling.core.defaultnodesettings.fileselection)
How do I access the state of the dialog in the model?
How do I let my users modify ports with a Meatball menu?
Any other resources for developing KNIME nodes would be appreciated.
Thanks! I understand 3 and 5 but here are my responses and questions about the others points you’ve raised.
I want to pass a bunch of variables across nodes but I only want one connection port. The tuple/dictionary/whatever I specifically want at the moment consists of: An object which is a subset of the Workflow object output by the Integrated Deployment ‘Capture Workflow End’ node, an integer, and a graph.
I looked through the source code of PortObject and I’m unclear what can be a PortObject. For example, can an integer or boolean be a PortObject? Can a dictionary/tuple be a PortObject? Can any object be a PortObject? The reason I’d like to know this is to pass along a bunch of variables with just one port.
I sort of understand this but not practically. Say I have a checkbox in my node Dialog and I want to get that state in the Model, how could I do that?
You need to create a new PortObject class that provides this functionality, which also answers 2), PortObjects are the classes that define the connection ports of nodes. They can consist of complex types such as tuples of other PortObjects.
When I was trying to make my own class that implemented the PortObject interface I looked at the FileSystemPortObject class. That class extends AbstractSimplePortObject and in that class. I believe I should extend this class, is that correct? And then I need to make a PortObjectSpec class that extends AbstractSimplePortObjectSpec, and this would be the class that has my variables using models?
Also, what are ModelContentRO and ModelContentWO? I believe I need to read and write state using ‘models’ but what actually are they?
I can see methods in those model classes for accessing and modifying fundamental data types and arrays, but how do I add those complex types like tuples, PortObjects and tables?
@azsb1g19 Only the OP (in this case: you) get notifications per default if new answers are posted. If you want to make sure your post is read by specific users, it’s a good idea to mention them directly.
This tells you which classes you need to implement. When you click on the underlined elements in the ExtensionPointDetails, it will open a new class dialog, pre-populated with the correct interfaces.
These interfaces should also contain the documentation in their javadoc that tells you what you need.