On the course of developing my own nodes and features, I was able to create custom port objects storing Java objects, which load and save themselves using ModelContent (RO and WO). Now I encounter a problem to create port objects made of several DataTable: I don’t know what would be the official way to load and store them.
Motivation for this strange idea of storing several data tables as one object: the node manipulates complex graphs made of several sets of entities having different attributes (for instance: households, people, dwellings). These entities might be linked together. So far it seems like the best idea to store that data in KNIME is to have one table for links storing the ids of the linked entities, and one table per entity type.
So back to my problem:
- I created a MultiGraphPortObject implements PortObject
- so I can declare a Serializer extends PortObjectSerialize which can load and save objects from PortObjectZip*Stream
to save a datatable t so far, I’m using:
ZipEntry zipEntryName = new ZipEntry(tablename);
DataContainer.writeToStream(portObject.t, new NonClosableOutputStream(out), exec);
This works, as it saves the table as a file inside the zipfile. But this leads to a slow and sytematic copy of the entire tables between two nodes. It seems like tables are usually dealt with in another way. Should I just store their BufferedTableId instead?
Tks for your help on this specific & complicated question!