Skip to content

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

@pmf

Description

@pmf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions