Custom Component Process on Load

I have a custom node that I have built that has a Value Select Configuration node in it. I feed the Value Selectoin Configuration values using a Table Creator node. The problem I have is that when this node is added to a workflow, it does not automatically load the drop down list from the Value Select Configuration. It requires the user to run the node once to populate the list.

How can I get the list in the configuration to load automatically when the node is dragged onto the workflow?

Hi @rrousselot, it would be great to have components execute themselves automatically as you describe, but to my knowledge there isn’t a way of doing what you ask.

I’ve built quite a few components that have dynamic values used to populate the configuration nodes and they need to be manually pre-executed prior to configuration for the drop-downs etc to contain the required values.

Whilst I agree that what you want would be desirable, the problem is that whilst components look like they are self contained, they actually just form part of the workflow (they are effectively like “macros” or “subroutines”) and so the nodes within them get reset and need to be executed just like all the other nodes on your workflow. This means any dialog/config nodes that are populated dynamically don’t get populated until the user actively “pre-executes” the component prior to configuration - and if the workflow or the component gets reset, it needs to be executed again.


I’ve added some background info here, which I am sure you have already worked out for yourself, but may be of interest to others too, who are looking to use components in this way.

Take the following (highly useful :wink: ) component:

The Value Selection Configuration node is being dynamically populated by a Table Creator, similar to how you described it.

This particular config node would typically be populated by data coming into the component from the workflow, but can of course be written as you have suggested and have its values fed from the Table Creator within the component. (I have some similar components of my own that populate a list from a Table Reader rather than a Table Creator, so the config can be adapted by executing a different workflow. My components suffer from the same problem that you describe. I wish they didn’t! :wink: ).

Because this component (and that Table Creator) is just “part of the overall workflow”, and not really a self-contained “thing” like it appears to be, until the workflow is executed, it cannot pass values to the Config node.

If you were using a static configuration node such as Single Selection Configuration, there isn’t the problem, because nothing prior to that node need be executed for the node to have its required set of values, but where the contents of the node have to be calculated, this can only occur when you execute the component.

Without executing, the component’s config dialog will look like this with the “dynamic” options remaining unavailable:

After executing the component, all of the config will be available. So to configure such a component, it must be “pre-executed” prior to configuring.

What I would like to see would be some mechanism, perhaps an option on the individual Configuration nodes that allows you to specify “attempt to execute when component’s config dialog is opened”, so that when a user opens the config dialog for the component, any such nodes attempt to execute and get populated. This would then allow you to have dynamically configurable components where the configuration options are calculated purely within the component.

As it stands, I have to add comments like this to my component descriptions…

Sorry I can’t be of much help with an actual solution to your question.

3 Likes

I agree. This happens a lot on my end as well, and novices can see it as a component error or component design flaw… It would certainly make sense to me for KNIME to auto trigger a limited execution up to the config settings nodes on the first open of a new component. Or at least allow us to manually or auto trigger a refresh like we can in the interactive view…

2 Likes

Thanks btw for the great walkthrough.

1 Like