entone
StatesLanguage - Declaratively design state machines that compile to Elixir based :gen_statem processes with the States Language JSON specification
StatesLanguage
Declaratively design state machines that compile to Elixir based :gen_statem processes with the States Language JSON specification.
About
States Language is the JSON specification behind AWS Step Functions, a powerful way to coordinate many disparate services into a cohesive “serverless” system. This library uses the same JSON specification and compiles to Elixir based :gen_statem processes.
Why
The initial idea for the Elixir implementation came about while working on an IVR system and we wanted a way to describe “call flows” in a declarative manner. Ideally building a system on top to allow for solution engineers to visually build call flows for a client, without writing any code.
After researching the space a bit, we landed on the States Language spec and decided it was a great fit for describing state machines. With the power of Elixir macros in-hand, this library was born.
I’ve been working on this for a few months now and have found it to be a super useful way to design state machines. Using JSON as a declarative format has also opened up a lot of opportunities for sharing this structure across projects and UIs. There’s even some mix tasks to quickly output your state machines to Graphviz and DagreD3.
The Hexdocs documentation is pretty robust, but feel free to post any questions you have here.
I hope the community finds this as useful of a tool as we have.
Brought to you by Citybase
Most Liked
entone
Ok, did it!
Here’s an example of configuring, compiling and running a StatesLanguage module and process at runtime
Enjoy!
entone
I pushed out a new release the other day, 0.2.5. It includes some fixes for string based events and a Graphviz serialization fix for the string events as well.
Unfortunately I haven’t had much time to work on a web based visual editor, but with the Graphviz support, it’s a really quick way to visually validate your logic.
For the editor, I’ve been looking into https://rete.js.org/ which I think could be really cool!
Here’s a screenshot of the one I’ve built at work, it’s not drag and drop, but does allow you to CRUD states and visualize the state machine in real-time.
entone
I’ve finally made some progress on an editor. It doesn’t currently output the JSON, but will be adding that soon.
here’s a quick video
and you can play with it here, https://citybaseinc.github.io/states-language-editor/
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance










