How to propogate Hilites downstream

I have a view in which users can select aggregated cells to Hilite. The hiliting is successfully propogated back upstream towards the data source and I can see the hilited cells using the HiLite Filter. However the hiliting is not propogated downstream. Even when I simply output the same input table to the (second) output port the downstream hiliting is still not available.

The only clue I've got is the HiLiteHandler:

HiLiteHandler hiliteHandler = nodeModel.getInHiLiteHandler(
PriceSensitivityNodeModel.IN_PORT_WTP_MATRIX );

According to the documentation, getInHiLiteHandler(int inIndex) returns the HiLiteHandler for the given input index. In my case, the relevant input table and the output table both use the second port.

This routine seems to explain why the upstream tables are getting the hilites but how do I get the downstream tables to also get the hilites? How do I tell the node that the input table and the output table are related (with the same number of rows)?


Hello, I think you are looking for org.knime.core.node.NodeModel.getOutHiLiteHandler(int).

Thanks aborg. I was wondering why I didn't find this myself but now I know why. The routine getOutHiLiteHandler(int) is protected and not visible. The documentation says:

This method is intended to be overridden.

This default implementation simply passes on the handler of
input port 0 or generates a new one if this node has no inputs.

In fact, the current implementation already looks pretty involved and it's not immediately clear to me how to override this method. As nobody else seems to have tackled it, let me ask this more general question...

Are HiLites typically intended to propogate forward or is it much more common for them to only propogate back towards the source?


Some more background. What I am trying to achieve is very similar to what the NumericBinner source code example already does. I just can't seem to figure out how to replicate it.

The NumericBinner takes a table at the InPort, adds a binned column, then pushes it to the OutPort. The NumericBinner then provides a graphical view from which you are able to hilite one or more bins. If you then put a HiLite Filter on either side of the NumericBinner (either attached to the upstream source table or attached downstream to the NumericBinner's OutPort) then in both cases the HiLite Filter will correctly show you the rows that were hilited in the view.

I'm trying to do something very similar. The difference is that my node has two InPorts and two OutPorts and that the rows I want to HiLite are on the second port (I mention this because perhaps I'm not spotting the hidden '0' in the NumericBinner sample code that refers to the first port). But while I can see the HiLites upstream of my node I can not see them downstream of my node. It's a mystery!!