Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 611
Alexey Zimarev Avatar asked Mar 23 '16 09:03

Alexey Zimarev


1 Answers

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

During(Pending,
    When(StatusChecked, context => context.Data.IsMessageCondition)
        .Then(...));
like image 133
Chris Patterson Avatar answered Oct 04 '22 15:10

Chris Patterson