Filter by new data type

Hello,
I created a new type of data and included it in a new node, everything works fine, but I create another node and I need it to filter through the new type of data created, as filtered by String or Double, but I did not recognize, what could he do?
Regards,
Laura

Hi @Laura_Marzo,
I am not quite sure what your exact goal is here, if you want to know how to create a column selection DialogComponent that only allows selecting columns of your new datatype you can make use of the DialogComponentColumnNameSelection: which you can create so that it only allows selecting columns of a certain type: (see this code).

If that is not what you mean, please explain your problem in a bit more detail.
best,
Gabriel

Hello @gab1one,
I explain better, I have a node that when I run creates a new column with the new data type that I created (I have the GeometryCell and the GeometryValue). This new type of data I have not put in KNIME’s knime.basic , because I do not know how to do it, I do not know if this has something to do with it.
In another node I need to filter through that new column.
I created exactly a DialogComponentColumnNameSelection, and filtered by my new data type, like this:
addDialogComponent (new DialogComponentColumnNameSelection (
new SettingsModelString (
DistanceToPointNodeModel.Geo, “”), “Geometry”, 0, GeometryValue.class));
But then I get this message:
error
What can I do? If there is something I have not explained well, please tell me, and I will try to explain it better.
Regards,
Laura

Hi @Laura_Marzo,
this error indicates that there is no GeometryValue column in the input table at input port 0. You need to connect a table containing such a column before you’ll be able to open the node dialog. If you did and the error still shows we will need to investigate further.
best,
Gabriel

Hi @gab1one
I connect my node that creates this column with the new node for which I want to filter and it is that this error comes out, I do not know why it is that this can happen. When I create a new type of data it is necessary to add it to a jar?
Best,
Laura

You need to define the datatype in the “extensions” tab in your plugin.xml:

There you can add a new DataType extension :

You need to set the cell class and a serializer for it in the configuration options:

best,
Gabriel

2 Likes

Hello @gab1one
I did that before and it did not work that way, I have these two packages: ToPoint (it is the node package where a new Geometry column generates me) and here I create the necessary classes for this, the GeometryCell and the GeometryValue, and in the plugin.xml, I do everything you told me.

ghjgh

But these classes, I group them in one .jar, and I put them in another package from another node that is the Distance,

rsdgerg

and also included the plugin.xml, the previously explained, but now from the created .jar, and from that Form follows me without recognizing, I do not know if the program will take it as two different classes or if in the ToPoint project, I should put it in a direct file.
Regards,
Laura

Hi @Laura_Marzo,
I think the origin of your problems lies (at least partially) in your project setup.

That is not the correct way to share dependencies, you can set the first plugin as a dependency of the second in the plugin.xml file via the dependencies tab, via the Required Plugins section:

.

Also is there a specific reason you have a different project for each node? It would make your work a lot easier if you put all related nodes into one project.

best,
Gabriel

Hello @gab1one
Every time I have to create a new node, I do not have to create a new project ?, I’ve always thought that it is like that, how could I put all the nodes together in a single project?
Regards,
Laura

You can just copy the source code package that defines your nodes into the target project. So you would have one citi.cu package and one distanceToPoint package (and so on) in the same project. You will need to adapt the Node extension in the plugin.xml of that result project, so that all your nodes are properly registered.

best,
Gabriel

2 Likes

I think that could solve all these problems I had, I will try to do, and then I tell you if it worked. Thank you
Laura

1 Like

Thank you very much, everything works perfectly, all the problems I had were solved, it filters and everything, THANKSSSS
Laura

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.