Search code examples
c#.netautomatonymous

Automatonyous state machine, generate graph from code


I'm using Automatonyous state machines in my c# project. I'm wondering if there is a way to automatic obtain the graph of coded state machines.


Solution

  • You can generate a GraphViz .dot file from the state machine using the Visualizer assembly.

    https://github.com/MassTransit/Automatonymous/blob/master/src/Automatonymous.Tests/Visualizer_Specs.cs#L30

    UPDATE

    With MassTransit v8, this has moved into the MassTransit.StateMachineVisualizer NuGet package.

    And the unit test is here.