Alexey Zimarev
Alexey Zimarev

Reputation: 19640

Conditional transition in MassTransit Automatonymous saga

I have some state in the saga and trying to implement status check retries until I get some satisfactory value in a message I receved.

Say, I have something like this:

.During(Pending,
    When(StatusChecked)
        .TransitionTo(somethingThatDependsOnStatusCheckedData)

I can only feed a specific state to TransitionTo but I want it to transition depending on the received message content, is it possible?

Upvotes: 6

Views: 3431

Answers (1)

Chris Patterson
Chris Patterson

Reputation: 33565

For received message content, you can use the conditional expression on the When clause.

During(Pending,
    When(StatusChecked, context => context.Data.IsMessageCondition)
        .Then(...));

Upvotes: 9

Related Questions