I'm new to MassTransit, and I can't seem to figure out how it maps the States that I define on a saga (MassTransitStateMachine) to the "State" property on the related SagaStateMachineInstance class.
For example, if I have a state machine class with three states:
public class MySaga :
MassTransitStateMachine<MySagaState>
{
public State Executing { get; private set; }
public State Completed { get; private set; }
public State Failed { get; private set; }
...
}
And my state machine instance class has a "State" property
public class MySagaState : SagaStateMachineInstance
{
public Guid CorrelationId { get; set; }
public int State { get; set; }
}
How does MT decide which saga state is which integer?
There also appear to be two built-in saga states, "Initial" and "Final", so this example would have 5 states. How is the State to integer mapping done?