genericworkflownodes / GenericKnimeNodes

Base package for GenericKnimeNodes
https://github.com/genericworkflownodes/GenericKnimeNodes
Other
15 stars 16 forks source link

Error handling of non-matching Port types #109

Open jpfeuffer opened 8 years ago

jpfeuffer commented 8 years ago

Today I discovered, that there are actually different Port types (e.g. prefix, multifile). The first thing that I found confusing is that I did not find a way to see that ports are of a different type and that you can actually connect ports of different types. The second thing is the error handling when executing the nodes with wrong port types connected. In the case of prefix types you just get a casting exception. Last but not least, why do we need a prefix type? Can't we just extract the basename from a usual URIport and gather all files of the same name? Why do we have to explicitly call it a "prefix" Port?

temehi commented 8 years ago

@jpfeuffer I have a related issue to this one and I don't know if I should create a new issue.

why do we need a prefix type?

A prefix output port is useful in the case of a node generating multiple files and another node taking these files as an input. I will create a separate issue to be safe.

Can't we just extract the basename from a usual URIport and gather all files of the same name? Why do we have to explicitly call it a "prefix" Port?

No! the follow up node will require just the "prefix" and yet the files should remain saved. About my related issue I will create a new one #115 just to be safe

jpfeuffer commented 8 years ago

Ok. I see now why they are useful. We should nevertheless do something about the error handling when connecting ports of a wrong type.