Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behavior SM generation does not quote string parameters #78

Open
tropappar opened this issue Oct 12, 2021 · 1 comment
Open

Behavior SM generation does not quote string parameters #78

tropappar opened this issue Oct 12, 2021 · 1 comment
Assignees

Comments

@tropappar
Copy link

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.

@dcconner dcconner self-assigned this Apr 28, 2023
@dcconner
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants