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

Dispatching to parent: process() vs. processEvent() in action #623

Open
pmf opened this issue Jun 28, 2024 · 0 comments
Open

Dispatching to parent: process() vs. processEvent() in action #623

pmf opened this issue Jun 28, 2024 · 0 comments

Comments

@pmf
Copy link

pmf commented Jun 28, 2024

I have a composite machine, and I want to dispatch an event to the parent.

It works when using process(ev_success{}) in the transition table of the sub machine, but it does not work when I send this event from an action in the sub machine (I can work around this by dispatching ev_success_internal from one action of the sub machine to trigger a dummy state, from which I can process(ev_success{}) to the parent).

What does not work (fails to compile): see example_not_working.cpp (the first file) in this gist:
https://gist.github.com/pmf/520607f3952d56c9482e2550296b1ab4

What works: : see example_working.cpp (the first file) in the same gist (this is the workaround I use; ideally, I'd to just dispatch ev_success from this action, and have it behave like if it had been done by process() in the transition table).

(In addition, when I define an unreachable dummy state that accepts ev_success in the child machine, it compiles, but does not work at runtime: https://gist.github.com/pmf/5512263bc9e32b17b3571ca417c3094b).

This happens with either my old version (from 2020) or the current version in master as of today.

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