public TestSaga(TestSagaState state) : base(state) { RegisterEvent <TestSagaStartMessage>(Transitions.StartEventArrived); RegisterEvent <TestEvent>(Transitions.SecondEventArrived); Machine .Configure(TestStates.Created) .Permit(Transitions.StartEventArrived, TestStates.GotStartEvent); Machine.Configure(TestStates.GotStartEvent) .OnExit(() => { ResultHolder.Add("123", "123"); }) .Permit(Transitions.SecondEventArrived, TestStates.GotSecondEvent); }
public void LongTime(string taskId, TimeSpan timeout) { Thread.Sleep(timeout); ResultHolder.Add(taskId, taskId); RaiseEvent(new ScheduledCommandSuccessfullyProcessed(Id)); }
public void Success(string taskId) { ResultHolder.Add(taskId, taskId); Emit(new[] { new ScheduledCommandSuccessfullyProcessed(Id) }); }
public void Success(string taskId) { ResultHolder.Add(taskId, taskId); RaiseEvent(new ScheduledCommandSuccessfullyProcessed(Id)); }
public TestProcess() { During(Initial, When(Start).TransitionTo(Started)); During(Started, When(Process).Then(ctx => ResultHolder.Add("123", "123")).Finalize()); }