Unexpected handling of new input table

Hi All

 

I've been trying to impliment a new type (BitSet) and some nodes to handle creating and then performaning some other actions like getting the cardinality and a string representation. 

 

I've created the new type and it appears to serialize correctly. 

 

I've made a node which takes a set of int columns and creates a bitset where a position is set if the value of the cell is not 0 (relies on being given a discrete set of columns). 

 

I've usef a SettingsModelFilterString to choose the columns which should be included and excluded and placed a filter for int columns. 

 

I have two mock tables, the first table with the following columns

 

Table 1: String, String, String, (IntCell)bit1, (IntCell)bit2, (IntCell)bit3, (IntCell)bit4, (IntCell)bit5

 

Table 2: String, String, String, (IntCell)bit1, (IntCell)bit2, (IntCell)bit3, (IntCell)bit5

 

In table 2 bit4 has been removed. 

 

Scenario:

 

Table 1 is connected to the node, the dialog has been configured to allways include all columns. The Include list contains Bit1, Bit2, Bit3, Bit4 and Bit 5. 

Before and after running the output column spec is StringCell, StringCell, StringCell, BitSetCell as expected.

 

I run the node and then change the input to table 2. 

I now get the following error: 

 

ERROR Create BitSet Configure failed (IllegalArgumentException): No such column name(s) in ColumnRearranger: [Bit4]
DEBUG Create BitSet Configure failed (IllegalArgumentException): No such column name(s) in ColumnRearranger: [Bit4]
java.lang.IllegalArgumentException: No such column name(s) in ColumnRearranger: [Bit4]
at org.knime.core.data.container.ColumnRearranger.remove(ColumnRearranger.java:300)
...
 
I must open the dialog before I can continue. 

If I start with table 2 and then switch to table 1, if I don't open the dialog Bit4 is not included in the include list and is therefore not used ot make the BitSet. 

My expectation was that the include list would automatically update without me needing to load the dialog. This behaviour would for example allow me to safely run the node in a loop.

 

Have I badly implimented this node or is this the expected behaviour (or maybe both)?

 

I've attached relevant code sections as a txt file. 

 

Many thanks

 

Sam

 

 

In configure you always have to check if the columns in the settings are (still) existing in the input data table and throw an InvalidSettingsException otherwise. In fact you have to check all settings if they are still compatible with the input table.

Thanks for the help, I took a look at how the column filter node to see how to do this and it now behaves as expected.