MassTransit / Automatonymous

A state machine library for .Net - 100% code - No doodleware
Apache License 2.0
736 stars 116 forks source link

Visualizer use Ignore like When #51

Closed sm-g closed 4 years ago

sm-g commented 6 years ago

In state machine I have

During(Failed,
                Ignore(CreateEntitiesFaulted)
                );

but generated dot file has edges from Failed state to CreateEntitiesFaulted event.

phatboyg commented 6 years ago

I bet I know why, the visualizer was written before Ignore was added, and likely not updated to handle it.

wexman commented 6 years ago

Any update on this? I'd like to show to my colleagues how awesome Automatonymous is, but this might be a show stopper...

I already peeked at the code, but have no clue where to start...

sm-g commented 6 years ago

also TransitionToState inside Then not visualized

.ThenAsync(context => context.WithServices(async sp =>
{
    ...

    if (condition)
    {
        await this.TransitionToState(Succeeded);
    }
    else
    {
        await this.TransitionToState(Failed);
    }
}))
phatboyg commented 6 years ago

Because you’re call it, only the Then will be visualized. Conditionals inside Then cannot be discovered.

sm-g commented 6 years ago

How I should design such statemachine, where decision is not based on value in message/instance, to be able to visualize transitions?

phatboyg commented 6 years ago

Use .If()

https://github.com/MassTransit/Automatonymous/blob/develop/src/Automatonymous.Tests/Condition_Specs.cs#L78