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

Process event in new state #78

Open
RockWood66 opened this issue Aug 20, 2021 · 1 comment
Open

Process event in new state #78

RockWood66 opened this issue Aug 20, 2021 · 1 comment

Comments

@RockWood66
Copy link

How do I handle an event in one state, transition to another state and handle the same instance of the event in the new state?

        builder.In(States.NoReadHeader)
            .On(TAEvents.TriggerCamera)
                .If(HeaderNRComplete).Goto(States.GoodHeader)
                .Otherwise().Execute(SendHeaderNR_SM);

        builder.In(States.GoodHeader)
            .On(TAEvents.TriggerCamera)
                .If(HeaderComplete).Goto(States.Labels)
                .Otherwise().Execute(SendHeaderSM);

If I fire trigger camera on state NoReadHeader and the guard transitions to GoodHeader I need to run the guard/otherwise when the GoodHeader transtions, so in the above if HeaderNRComplete is true and HeaderComplete is false it executes SendHeaderSM

@ursenzler
Copy link
Member

A single event can only trigger a single transition and is then considered to be processed. You would need a second event to trigger another transition.
Maybe you should define a transition from NoReadHeader to Labels/SendHeaderSM directly.

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