Business logic in Finite State Machine

Hello, i’m new to Elixir and Erlang world, but I want to create mechanism to restrict the use of a module through steps involving data. So I thought using finite state machine, with some states and data. But I need to execute some business logic to validate data and go to some state.

I also thought about map and struct with pattern matching but nothing prevent than a state was hard coded inside the struct.

For me the idea of state machine is really good and I though to replace struct by finite state machine with some logic inside.

Do you think is good concept or idea, or is it really bad?


Is this post relevant? Did you implement your business logic as a state machine at the end? Did you use a library? I would be happy to know about the way you taken if possible.

1 Like