Change Request: Make it Possible to Rename a Workflow Variable

It’d be great if I could rename a current Flow Variable. Currently, I can edit type and value but not the name of the variable.
image

Hi there @jan_lender,

why would you like to have this possibility? To my understanding you will still have to make change in every node that used this flow variable so it is same whether you rename existing or create new one if not mistaken.

Anyways you can close your workflow and edit your workflow.knime file inside workflow directory. This will change workflow variable name…

Br,
Ivan

1 Like

Hi Ivan,

I can’t understand how can you be that fast with your replies!

Well, I’m aware & often a user of the option to update *.knime file directly and I suppose this is a useful workaround.

Now, how this can occur. Well, I design & create really complex KNIME workflows and this is usually the reason why my needs slightly differ from what other users would want to get. I often copy & paste whole parts of workflows between one and another. After I paste a fragment that relies on a flow variable to be set (and configured from outside when running in BATCH mode) then I have to declare the flow variable in the target workflow. Every time I misspelled the name of the variable it occurred to my mind it’d be nice if I didn’t have to create new variable with a proper name instead of the wrong one. That’s that.

Regarding to your next point. Yes, when the meaning of a flow variable changes while it’s workflow is getting mature, it’s always the right time to change the variable’s name accordingly too. This is a coding best-practices mantra. I couldn’t do it another way. And you’re right, it’s necessary to fix all places the variable is referenced.

Regards,
Jan

2 Likes

Hi @jan_lender,

Good coffee, practice and other things put on hold :smiley:

I totally understand. My question was more why do you want it when you still need to fix it in all places where used.

And now when I think about it more seems that misspelling a flow variable (not necessary a workflow variable) or desire to change its name in order to better describe its purpose in combination with high usage of same in big workflow leads to some amount of time spent…

Br,
Ivan

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