To get flow variables out of a Sorter node, my only option is to create individual variables for each criterion, which isn’t great for larger lists.
To get flow variable info into a Sorter node, there’s no way to provide a Sorter node with an array for the sort criterion any longer. I have to manually specify each item.
If I need to add an additional sort criterion, it can no longer by done dynamically - it has to be manually adjusted in the workflow.
I’ll start by saying I don’t have a solution, but I am happy to help bump the issue by providing an example of the problem.
I thought I’d take a look to see what happens when a sorter from KNIME 4.7.8 is imported in KNIME 5.3.2, configured programmatically, and I can certainly see that this is not ideal to say the least.
Having imported into KNIME 5.3.2, I have re-exported the flow
In this flow, the upper Sorter was configured in KNIME 4.7.8 and continues to operate based on the sorter settings provided by two String Array flow variables.
The sort config can be altered in the two components and on re-execution, the node behaves according to the config.
It does not appear to be possible to configure the lower Sorter in KNIME 5.3.2 to behave the same way.
Opening the config of the above sorter, it says that the configuration is deprecated.
I confess to being surprised by this. In my view functionality should only be deprecated when there is a viable alternative facility provided but as you have already mentioned, no alternative appears to exist.
The node can clearly still handle the old config, but it does not appear possible to configure a newly placed node to work the same way.
I am not a fan of the move away from array variables for the new config and I too would like to find a viable workaround or facility that brings back this very useful configuration mechanism. I am sure you are not alone in using it. Sorry I don’t have any good news for you but let’s hope there is some forthcoming.
My above post gave me an idea… if a configured copy of the Sorter Node still works with the supplied array then “all we need” is a copy of the Sorter node that is already pre-configured to use array variables. Then we “just” need to switch in/out the required variables …
… and so another component is born
I have put this in my “experimental” folder on the KNIME Community Hub.
Here is an updated version of the above flow, using this component in KNIME 5.3…
Yikes that’s quite the component… thanks for putting it together. I’m still studying it =)
And thanks for re-framing the issue too – I agree entirely about the topic of deprecating without replacing. It would be nice if new/refreshed nodes were available in a ‘beta’ package before they are put into the regular packages, so that we can have the opportunity to test them prior to mainstream release.
Thank you again, @takbb !