Skip to content

Process event in new state #78

Open

Description

@RockWood66

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

Activity

  1. ursenzler commented on Aug 23, 2021

    @ursenzler
    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

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