FlexBE / flexbe_app

The classic user interface (editor + runtime control) for the FlexBE behavior engine. See the flexbe_webui for latest
BSD 3-Clause "New" or "Revised" License
48 stars 49 forks source link

fix: code generation for containers without outcomes #77

Closed omercans closed 1 year ago

omercans commented 3 years ago

When creating a container that has no outcomes within a behavior, flexbe_app is generating a python code that gives an error next time the behavior is loaded. This occurs as the generated string is "OperatableStateMachine(outcomes=[''])" while it should be "OperatableStateMachine(outcomes=[])" .

An example behavior can be found in the attachment: codegenerationtest.zip

Same problem does not occur with the getInputKeys() & getOutputKeys() as their length is checked before appending those strings. Same approach can also be used for the getOutcomes() method as an alternative to the solution given in this PR.

dcconner commented 1 year ago

Plan to review and test this and merge in the next few weeks