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

Graph: re-entry transition is missing its entry action #588

Open
nightroman opened this issue Jun 30, 2024 · 5 comments
Open

Graph: re-entry transition is missing its entry action #588

nightroman opened this issue Jun 30, 2024 · 5 comments

Comments

@nightroman
Copy link

Here is the graph of the official BugTrackerExample

Graphviz

Note that it correctly shows the label Assign / OnAssigned on transitioning from Open to Assigned and from Deferred to Assigned.

But on transitioning from Assigned to Assigned (re-entry) the label is just Assign instead of expected Assign / OnAssigned.
(OnAssigned is called on re-entry to Assigned and this should be reflected).

@mclift
Copy link
Member

mclift commented Jul 3, 2024

Thanks for writing this up, @nightroman.

I think that in this case the graph output is correct since OnAssigned is specifically configured for the parameterised Assign trigger, whereas the re-entrant transition uses the Assign trigger directly.

.OnEntryFrom(_assignTrigger, OnAssigned) // This is where the TriggerWithParameters is used. Note that the TriggerWithParameters object is used, not something from the enum
.PermitReentry(Trigger.Assign)

Does this explain what you're seeing?

Thanks

@nightroman
Copy link
Author

nightroman commented Jul 4, 2024

On transitioning from Assigned to Assigned (re-entry) the parameterized trigger Assign is called, i.e. one has to specify the new bug assignee. E.g. when assigning from Harry to Fred here, we provide the parameter "Fred":

bug.Assign("Harry");
bug.Assign("Fred");

In other words, .PermitReentry(Trigger.Assign) does not mean that the re-entry is not parameterized. The same parameterized .OnEntryFrom(_assignTrigger, OnAssigned) applies and the call to OnAssigned is happening on re-entry (debugging, testing, logging confirm this).

@mclift
Copy link
Member

mclift commented Jul 4, 2024

Thanks for the quick reply. I really shouldn't try to debug stuff when I'm tired :)

I'll try to spend some time on this over the next few days, unless you're already working on it.

Thanks

@nightroman
Copy link
Author

@mclift Thank you. No, I am not working on this (yet, maybe another day and another issue). Besides, this issue may be related or be in the same area as #587 and you have already started some work #589 (great!). So it might be reasonable either to fix both issues together or one after another.

@nightroman
Copy link
Author

As for contributing, in a way... at this point I've been working on PowerShell helpers for Stateless: #592 These tools are useful for state machine interactive testing, low ceremony graph generation/show, etc.

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

2 participants