Esempio n. 1
0
        public FlipperFloomeen()
        {
            Flow.AddStateSetting(State.Unchanged).IsStartState();

            Flow.AddTransition("FlipTransition")
            .From(State.Unchanged)
            .On(Command.Flip)
            .GoTo(State.Changed);
        }
Esempio n. 2
0
        public TestingOnOffMachine()
        {
            Flow.AddStateSetting(State.On)
            .IsStartState();

            Flow.AddTransition("SwitchOnTransition")
            .From(State.On)
            .On(Command.SwitchOff)
            .GoTo(State.Off);

            Flow.AddTransition("SwitchOffTransition")
            .From(State.Off)
            .On(Command.SwitchOn)
            .GoTo(State.On);
        }
Esempio n. 3
0
        public CustomerOrderFloomeen()
        {
            Flow.AddStateSetting(State.New)
            .IsStartState();

            Flow.AddStateSetting(State.Delivered)
            .IsEndState();

            Flow.AddTransition("CargoTransition")
            .From(State.New)
            .On(Command.Cargo)
            .GoTo(State.Shipping);

            Flow.AddTransition("HandTransition")
            .From(State.Shipping)
            .On(Command.Hand)
            .GoTo(State.Delivered);
        }
Esempio n. 4
0
        public RadioFloomeen()
        {
            Flow.AddStateSetting(State.StandBy).
            IsStartState()
            .OnEnterEvent(OnEnterAction)
            .OnExitEvent(OnExitAction);

            Flow.AddStateSetting(State.Playing)
            .Then()
            .OnEnterEvent(OnEnterAction)
            .OnExitEvent(OnExitAction);

            Flow.AddStateSetting(State.Paused)
            .Then()
            .OnEnterEvent(OnEnterAction)
            .OnExitEvent(OnExitAction);


            Flow.AddTransition()
            .From(State.StandBy)
            .On(Command.Play)
            .GoTo(State.Playing);

            Flow.AddTransition()
            .From(State.Playing)
            .On(Command.Stop)
            .ReturnTo(State.StandBy);

            Flow.AddTransition()
            .From(State.Playing)
            .On(Command.Pause)
            .GoTo(State.Paused);

            Flow.AddTransition()
            .From(State.Paused)
            .On(Command.Stop)
            .ReturnTo(State.StandBy);

            Flow.AddTransition()
            .From(State.Paused)
            .On(Command.Play)
            .ReturnTo(State.Playing);
        }
Esempio n. 5
0
        public CustomerOrderFloomeen()
        {
            Flow.AddStateSetting(State.New)
            .IsStartState();

            Flow.AddStateSetting(State.Delivered)
            .IsEndState();

            Flow.AddTransition("CargoTransition")
            .From(State.New)
            .On(Command.Cargo)
            .Do(CheckOrderedProductsAvailability)
            .When(AreReadyForShipping)
            .GoTo(State.Shipping)
            .Otherwise()
            .GoTo(State.Waiting);

            Flow.AddTransition("HandTransition")
            .From(State.Shipping)
            .On(Command.Hand)
            .GoTo(State.Delivered);
        }
Esempio n. 6
0
        public MessagingFloomeen()
        {
            Flow.AddStateSetting(State.Ready)
            .IsStartState()
            .OnEnterEvent(ManageOnEnterEvent)
            .OnExitEvent(ManageOnExitEvent);

            Flow.AddStateSetting(State.Retrying)
            .IsStartState()
            .OnEnterEvent(ManageOnEnterEvent)
            .OnExitEvent(ManageOnExitEvent);

            Flow.AddStateSetting(State.Error)
            .IsEndState();

            Flow.AddStateSetting(State.Sent)
            .IsEndState();

            Flow.AddTransition("SendingFlow")
            .From(State.Ready)
            .On(Command.Send)
            .Do(SendEmail)
            .When(Success)
            .GoTo(State.Sent)
            .Otherwise()
            .GoTo(State.Retrying);

            Flow.AddTransition("RetryingFlow")
            .From(State.Retrying)
            .On(Command.Send)
            .Do(SendEmail)
            .When(Success)
            .GoTo(State.Sent)
            .When(BelowMaxRetries)
            .StayAt(State.Retrying)
            .Otherwise()
            .GoTo(State.Error);
        }