Skip to content

Unable to create a table with multiple StateA to StateB transitions with same event but different guards and actions. #10

@phelter

Description

@phelter

Have a more complex transition table where:

return transition_table {
    * "stateA"_s + event<Start>              / doStart  = "stateB"_s
    , "stateB"_s  + event<Done> [ isX ] / completeX = "stateA"_s
    , "stateB"_s  + event<Done> [ isY ] / completeY = "stateA"_s
    , "stateB"_s  + event<Done> [ isZ ] / completeZ = "stateA"_s
};

The above won't work because of an error .... specified more than once as a direct base class

But If I change it to:

return transition_table {
    * "stateA"_s + event<Start>              / doStart  = "stateB"_s
    , "stateB"_s  + event<Done> [ isX || isY || isZ] / completeXYZ = "stateA"_s
};

where completeXYZ action now also needs to identify which of the guards triggered it is fine.

Is this expected?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions