Page 1 of 1
Add unreferenced global variables to maintenance dialog
Posted: 22 May 2016 19:35
by Bushmills
and allow their removal, just as it is already possible with triggers, conditions and actions. Otherwise users get increasingly weary of running flows made by others, frequently requiring manual cleaning up global variables after their removal. The count of global variables on a system may also be substantial, making it hard to decide for each variable whether it's still in use.
Alternatively, add date/time to each variable, showing when it has been referenced the last time.
Re: Add unreferenced global variables to maintenance dialog
Posted: 23 May 2016 06:00
by kintrupf
+1
Re: Add unreferenced global variables to maintenance dialog
Posted: 26 May 2016 09:35
by IGY
+1
I would suggest introducing the same internal mechanism used for referring actions, conditions and triggers. This is essentially what Bushmills already implied.
Thus making it possible to:
- rename global variables
- list all flows that use a particular variable
I know this is a major change request
Re: Add unreferenced global variables to maintenance dialog
Posted: 27 May 2016 06:48
by MURTUMA
+1
IGY wrote:- rename global variables
Though, this might be too hard to implement as globally renaming vars inside scripts is quite different from changing the name of elements, I reckon.
Re: Add unreferenced global variables to maintenance dialog
Posted: 28 May 2016 15:21
by IGY
Yes, I said it won't be easy
The script editor would need to be able to display the friendly name of referenced variables, and provide controls for handling variables, etc....
Re: Add unreferenced global variables to maintenance dialog
Posted: 28 May 2016 15:41
by Bushmills
I'd be happy with a two step implementation: track and manage unreferenced first, deal with renamed variables another time
Re: Add unreferenced global variables to maintenance dialog
Posted: 28 May 2016 18:32
by IGY
I fully agree. That would be a huge help already, and I don't want to complicate things. However, that *is* the difficult part. Once you implement this bit, you get the rest almost for free. Let's wait what el jefe says...
Re: Add unreferenced global variables to maintenance dialog
Posted: 30 May 2016 19:10
by Martin
Getting the unreferenced bit to work in all circumstances is not possible. It could not detect dynamic variable names in expressions, e.g. getValue("global_var"+another_var, 123).
But I could add the feature to just detect regular usages like global_var = xyz and similar cases. Maybe a simple feature that just searches for global_var as text would help to find unused variables in many cases.
Renaming global variables is even more complicated. It's on my todo list to investigate if it's possible with a sane amount of work but I did not have the time to check the feasibility yet (Renaming of dynamic variables will not be supported, just the simple usages).