View Source mix finitomata.generate (Finitomata v0.29.3)
Mix task to generate the Finitomata
instance scaffold.
By running mix finitomata.generate --module MyFSM
one would be prompted
to enter the FSM declartion if ELIXIR_EDITOR
environment variable is set,
in the same way as IEx.Helpers.open/0
does. THen the scaffold implementation
(and optionally the test for it) will be generated.
Allowed arguments
--module: :string
[mandatory] the name of the module to generate, it will be prepended withOtpApp.Finitomata.
--syntax: :string
[optional, default::flowchart
] the syntax to be used, might be:flowchart
,:state_diagram
, or a module name for custom implementation--timer: :integer
[optional, default:false
] whether to use recurrent calls in this FSM implementation--auto-terminate: :boolean
[optional, default:false
] whether the ending states should lead to auto-termination--listener: :string
[optional, default:nil
] the listener implementation--impl-for: :string
[optional, default::all
] what callbacks should be auto-implemented--generate-test: :boolean
[optional, defaultfalse
] whether the test should be generated as well
Example
mix finitomata.generate --module MyFSM --timer 1000 --auto-terminate true --generate-test true