Behavior SM generation does not quote string parameters
When having string parameters for states they are plain in the generated state machine python script. They should be put into quotation marks. For example, the when specifying the topic for the SubscriberState, python throws an error if I don't add quotes around the topic. I believe this shouldn't be the responsibility of the user.
FlexBE is set up to allow the user to specify variables (e.g. from the dashboard) as well as strings.
If you input without quotes, it treats the input data as a request to use a variable.
If you want text you need to add the quotes yourself.
I appreciate the confusion this causes, and I'm open to suggestions on UI improvements to help differentiate the use of variables vs. strings.
As we allow for importing manual code blocks, I don't think it is as simple as assuming all single word strings are text unless variable is pre-defined in dashboard. I suppose we could assume that all multi-word inputs are intended to be strings, but may open up to more ambiguity in how things are treated.
We are working on some enhancements to the UI over the next 6 months, so I am open to suggestions.
Some potential ideas:
- change background color depending on if treating as variable or text and then applying some logic
- if no quotes and single word, treat as variable
- if any character is not valid variable name (e.g. apostrophe or $) treat as text
- if multiple words separated by comma or white space, always treat as string
- automatically add quotes to text if missing based on conditions above.