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

fix(generator): allow end states from choice states in the initial state transition path #165

Merged
merged 1 commit into from
May 23, 2024

Conversation

finger563
Copy link
Owner

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:
CleanShot 2024-05-23 at 12 37 18
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

CleanShot 2024-05-23 at 12 39 05

Showing that initial state resolution to end state transitions out accordingly

Note the starting and final states are the same:
CleanShot 2024-05-23 at 12 40 51
CleanShot 2024-05-23 at 12 41 36

Generated code:
Choice_End_Test_generatedCode.zip

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code follows the code style of this project.

@finger563 finger563 self-assigned this May 23, 2024
@finger563 finger563 merged commit 092610a into main May 23, 2024
@finger563 finger563 deleted the fix/initial-choice-end-state branch May 23, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant