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

EntryFrom displayed incorrectly on UmlDotGraph #509

Open
leeoades opened this issue Apr 6, 2023 · 2 comments
Open

EntryFrom displayed incorrectly on UmlDotGraph #509

leeoades opened this issue Apr 6, 2023 · 2 comments

Comments

@leeoades
Copy link
Contributor

leeoades commented Apr 6, 2023

Consider a state machine with two states called One and Two.
There are two triggers

  • GotoTwo from One to Two
  • and ReenterTwo from Two back to Two

There are then two OnEntry statements defined

  • OnEntry from GotoTwo runs a function called OnlyRunOnFirstEntryToTwo
  • OnEntry from ReenterTwo runs a function called RunOnEveryReentryToTwo
var sm = new StateMachine<State, Trigger>(State.One, FiringMode.Immediate);

        sm.Configure(State.One)
            .Permit(Trigger.GotoTwo, State.Two)
            ;

        sm.Configure(State.Two)
            .OnEntryFromAsync(Trigger.GotoTwo, OnlyRunOnFirstEntryToTwo)
            .PermitReentry(Trigger.ReenterTwo)
            .OnEntryFromAsync(Trigger.ReenterTwo, RunOnEveryReentryToTwo)
            ;

In the visualisation, I would expect a single entry label with something like "entry [GotoTwo] / OnlyRunOnFirstEntryToTwo"
Then on the reentry arrow, only the label "ReenterTwo / RunOnEveryReentryToTwo".

However, both function names appear as both entry statements inside the state and on the reentry arrow for ReenterTwo.

digraph {
compound=true;
node [shape=Mrecord]
rankdir="LR"
"One" [label="One"];
"Two" [label="Two|entry / OnlyRunOnFirstEntryToTwo\nentry / RunOnEveryReentryToTwo"];

"One" -> "Two" [style="solid", label="GotoTwo"];
"Two" -> "Two" [style="solid", label="ReenterTwo / OnlyRunOnFirstEntryToTwo, RunOnEveryReentryToTwo"];
 init [label="", shape=point];
 init -> "One"[style = "solid"]
}

graphviz (4)

@leeoades
Copy link
Contributor Author

Further investigation - The GetInfo() method returns a StateMachineInfo with missing information. The StateInfo for state Two has a list of EntryAction ActionInfo objects, but the FromTrigger strings are null on both.

@leeoades
Copy link
Contributor Author

Tracked the bug down to the (mis)representation of async trigger entry actions. Instead of "hiding" the trigger inside an anonymous action, I have mirrored the sync version. Please see PR: #511

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

No branches or pull requests

1 participant