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

Multiple internal transitions are not rendered nicely #157

Open
noricor opened this issue Aug 27, 2021 · 3 comments
Open

Multiple internal transitions are not rendered nicely #157

noricor opened this issue Aug 27, 2021 · 3 comments

Comments

@noricor
Copy link

noricor commented Aug 27, 2021

If a state has multiple internal transitions the rendered output is not very readable.
It seems like all internal transitions are smashed together.
Can they be separated somehow so that they are nicely readable?

Here an example:

Initial.initial,
On { 
   foo:events.GetState / Action.GetState, 
   bar;
   
 },
 Off.final;

Initial.initial -> On;
On -> Off.final : events.Exit / Action.Exit;
On -> On [type=internal]  : events.GetState / Action.GetState;
On -> On [type=internal]  : events.GetVersion / Action.GetVersion;
On -> On [type=internal]  : events.SetLogLevel / Action.SetLogLevel;
On -> On : events.Reset;

Alternatively internal transitions could also be displayed within a state (like entry, exit, do)
as it is defined in the UML specification.

@github-actions github-actions bot added the stale label Sep 4, 2021
Repository owner deleted a comment from github-actions bot Sep 4, 2021
@sverweij sverweij removed the stale label Sep 4, 2021
@sverweij
Copy link
Owner

sverweij commented Sep 4, 2021

Hi @noricor - I guess you mean that this...

image

...could render nicer? State-machine-cat runs into the limitations of the auto-layout engine in some occasions. I'm on the lookout for an other one.

That said if I interpret your last sentence correctly: would something like this work? Or does this miss something?

image

Initial.initial,
On: 
events.GetState / Action.GetState
events.GetVersion / Action.GetVersion
events.SetLogLevel / Action.SetLogLevel
 { 
   foo:events.GetState / Action.GetState, 
   bar;
   
 },
 Off.final;

Initial.initial -> On;
On -> Off.final : events.Exit / Action.Exit;
On -> On : events.Reset;

@noricor
Copy link
Author

noricor commented Sep 7, 2021

Hi,

yes, you identified the rendering issue correctly, especially for large state machines (20-30 states with lots of transitions and stuff) this becomes a readability issue.

Regarding the second part. Yes, this would work and it is also more in line with the UML 2.5 spec which introduces an "internal transition compartment" for states

Internal Transition compartment
This compartment contains a list of internal Transitions, where each item has the following syntax:
{trigger}* ['[' guard']'] [/behavior-expression]
Where is the notation for Triggers (see sub clause 13.3.4), is a Boolean expression for a
guard, and the optional is the specification of the effect Behavior to be executed if the
Event occurrence matches the trigger and guard of the internal Transition. It is an expression written in some
textual surface language, which may be either a vendor-specific or some standard language (see sub clause
16.1).

Cheers

@github-actions github-actions bot added the stale label Sep 15, 2021
Repository owner deleted a comment from github-actions bot Sep 15, 2021
@sverweij sverweij removed the stale label Sep 15, 2021
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

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