5

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?

Alexey Zimarev
  • 17,944
  • 2
  • 55
  • 83

1 Answers1

6

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

During(Pending,
    When(StatusChecked, context => context.Data.IsMessageCondition)
        .Then(...));
Chris Patterson
  • 28,659
  • 3
  • 47
  • 59