Default values in Configuration Dialog of a Component

Hello,

My goal is to improve the configuration dialogs of my components.
I have 2 issues.

The first issue is that the default values are overwritten by the values of the configuration dialog itself.

Screenshot from 2022-07-26 15-23-57
Screenshot from 2022-07-26 15-28-16

That way the user can’t really see the default values that I’m giving to the configuration nodes after consecutive runs. It just keeps the last value that was typed in the dialog.

Now the second issue, has to do with what default values I’m trying to give.
I have a component that uses XML Reader node and XPath and takes the element values from the provided XML and shows them in the configuration dialog.

Basically, I just want the users to see what’s inside the XML so they can modify parts of the document.
But every time you open the dialog of the component, the overwritten values from the previous run are kept(issue 1).
The optimal would be to show the XML’s element values as default values in the dialog(using flow variables for the default values).
It would be nice, if every time I open the dialog, the component reads the XML and renews the default values based on provided XML’s element values.
I guess that the problem is that the configuration nodes need to be the first nodes that are executed in the component.

So the questions are, can I have the dialog to not overwrite the default values?
And can I have a single component that renews it’s default values based on the provided XML document? It seems to me that this would require 2 components, one for the querying of element values and the other one that takes these values as input and puts them using flow variables as default values for the configuration dialog.

I hope that is clear enough.

Hi @vasichar11 ,

If I understood correctly, you want to display elements from the XPath node and change them if necessary.

For that purpose I would recommend the Table Editor node, which you can connect to the XPath node. With “right click on the Table Editor” and “Execute and open views” you can display the content of the XPath and adjust it if necessary.

If this does not solve your problem, please contact me again.

Best,
Linh

2 Likes

Thank you for the reply!

Table Editor seems useful here, but I would like to restrict accepted min and max values which is possible with the configuration nodes. Is it also possible with the table editor?

Hi @vasichar11 ,

Maybe it is not the most elegant solution, but you could combine the Table Reader node and the Configuration node. The attached image shows an example workflow.

If an input is out of bounds, execution fails.

Hopefully this helps!

Best,
Linh

2 Likes