I've got some events in state machine
public Event<FirstCompletedEvent>? FirstCompletedEvent { get; set; }
public record FirstCompletedEvent(Guid PaymentKey, string PaymentDetails) : IQueueMessage;
public Event<SecondCompletedEvent>? SecondCompletedEvent { get; set; }
public Event<ThirdCompletedEvent>? ThirdCompletedEvent { get; set; }
AllCompletedEvent
fires when all of 3 arrived.
CompositeEvent(() => AllCompletedEvent, x => x.AllCompletedEventStatus,
FirstCompletedEvent,
SecondCompletedEvent,
ThirdCompletedEvent);
Question: is it possible to pass data from FirstCompletedEvent
into AllCompletedEvent
for futher processing. To make something like this:
During(Payout,
When(AllCompletedEvent)
.Then(c => DoSomething(c.Data.PaymentDetails)
I've tried to save it to state in event handler, but it fired (if fired at all) after When(AllCompletedEvent
) - absolutely not what I looking for.
When(FirstCompletedEvent)
.Then(c => c.Instance.PaymentDetails = c.Data.PaymentDetails)