Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fsm_draw_state_diagram command #29

Open
Ibukun2021 opened this issue Apr 10, 2021 · 1 comment
Open

fsm_draw_state_diagram command #29

Ibukun2021 opened this issue Apr 10, 2021 · 1 comment

Comments

@Ibukun2021
Copy link

Ibukun2021 commented Apr 10, 2021

Hello,

I am not really clear on the 'fsm_draw_state_diagram' command and how to generate a state diagram after implementing your State Machine code. I am trying to generate a state machine diagram for the code below using your implementation. The comment below from one of the documentations wasn't really clear to me and it reads thus:
...................................................................................................................................................................................................................................................................
"State Machine workflows can be visualized using a state diagram.
finite-state-machine generates diagrams using Mermaid Markdown syntax, which can be viewed using the Mermaid Live Editor.
Use the fsm_draw_state_diagram command and point to State Machine workflow class that inheritences from StateMachine.

class parameter is required

$ fsm_draw_state_diagram --class examples.turnstile:Turnstile

initial_state parameter is optional

$ fsm_draw_state_diagram --class examples.turnstile:Turnstile --initial_state close
.................................................................................................................................................................................................................................................................

How do I go about this? I already have my code written up. Just need to finish up with the visualization of the state diagram. Will appreciate any help.

@alysivji
Copy link
Owner

  • command is fsm_draw_state_diagram
  • class option refers to the full dotted path (project.module:ClassName) where the State Machine can be found
  • initial_state is optional -- can be used to specify the initial state of the FSM

Have you tried cloning this repo and running the example command from the project root in a virtual environment where finite-state-machine is installed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants