fix(generator): allow end states from choice states in the initial state transition path #165
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This updates the code generator so that end states that are reachable from the initial state are handled properly.
Motivation and Context
Previously, if you had an initial state which went (e.g. via a choice pseudostate) to an end state for that substate, they would not generate properly.
This code fixes that.
How has this been tested?
Modeled up this simple toy case:
Model:
choice_end_test.webgmexm.zip
Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
Here is the execution trace for the model under various conditions:
Showing regular end state usage (coming from another / sibling state) still works
Showing that initial state resolution to end state transitions out accordingly
Note the starting and final states are the same:
Generated code:
Choice_End_Test_generatedCode.zip
Types of changes
Checklist:
Software