Feature Request - Bound _Exchangeable_ Groups in `PortsConfigurationBuilder`

I noticed recently that PortsConfigurationBuilder now has the concept of ‘bound’ groups, accessible through the series of addBoundExtendableInputPortGroup (and corresponding output port group) methods. However, the private method called by all of these is the only way I can see to restrict the number of ports in the added bound group.

So, for example, if I want a configurable node with 2 input ports, which must always be the same type, I currently have to use a bit of a dubious workaround:

PortsConfigurationBuilder pcb = new PortsConfigurationBuilder();
		pcb.addExchangeableInputPortGroup("Test Connection",
				DBSessionPortObject.TYPE, DBSessionPortObject.TYPE,
		// TODO: This swaps both ports but unfortunately doesnt constrain to 2
		// inputs total
		// pcb.addBoundExtendableInputPortGroup("Reference Connection",
		// "Test Connection", 1);

And then in the NodeModel:

    MyNodeModel(NodeCreationConfiguration creationConfig) {

    MyNodeModel(PortType portType) {
        // The creationConfig only has 1 port type which we use twice
        super(ArrayUtils.fill(new PortType[2], portType), new PortType[0]);
        // ...

It would be nice if in addition to the ‘bound extendible’ group, there was an option to add a bound exchangable group (or even just a ‘bound’ group of fixed size), or even just be able to specify the maximum number of ports in the bound extendible group so that it could be constrained to no more than 1 port.


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