<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="247483" data-post-id="247483">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mudasobwa" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mudasobwa/120/5298_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mudasobwa
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Cure</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="ityonemo" data-post="11" data-topic="46983">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ityonemo/48/11341_2.png" class="avatar"> ityonemo:</div>
<blockquote>
<p>smart way to use mermaid</p>
</blockquote>
</aside>
<p>Wow. Thanks! Somehow I missed this possibility. Will surely support it alongside <em>PlantUML</em>. BTW, the compile-time check is already implemented in the library during definition parsing.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="247483" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-blog-post-finitomata-the-proper-fsm-for-elixir/46983/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-247483" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="247483"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="247494" data-post-id="247494">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mudasobwa" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mudasobwa/120/5298_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mudasobwa
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Cure</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="ityonemo" data-post="11" data-topic="46983">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ityonemo/48/11341_2.png" class="avatar"> ityonemo:</div>
<blockquote>
<p>smart way to use mermaid</p>
</blockquote>
</aside>
<p>FWIW, I have implemented <code>mermaid</code> support. This is how the documentation for the generated module looks when <code>mermaid</code> syntax is used. Kudos and many thanks!</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/7/9/7912d0d8b6aafe7437af581ae22f081f97206e55.png" data-download-href="https://forum.elixirforum.com/uploads/default/7912d0d8b6aafe7437af581ae22f081f97206e55" title="Screenshot_20220403_115040" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/7/9/7912d0d8b6aafe7437af581ae22f081f97206e55_2_690x401.png" alt="Screenshot_20220403_115040" data-base62-sha1="hh45mUgwzHXE2k7o50xqqHsMPK5" width="690" height="401" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/7/9/7912d0d8b6aafe7437af581ae22f081f97206e55_2_690x401.png, https://forum.elixirforum.com/uploads/default/optimized/3X/7/9/7912d0d8b6aafe7437af581ae22f081f97206e55_2_1035x601.png 1.5x, https://forum.elixirforum.com/uploads/default/original/3X/7/9/7912d0d8b6aafe7437af581ae22f081f97206e55.png 2x" data-dominant-color="0C131E"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Screenshot_20220403_115040</span><span class="informations">1284×748 60.4 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="247494" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-blog-post-finitomata-the-proper-fsm-for-elixir/46983/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-247494" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="247494"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="247754" data-post-id="247754">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Oliver" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Oliver/120/1167_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Oliver
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This reminds me of the FSM framework I wrote for usage in my own project.</p>
<p>I did however not resort to parsing a description string, I used some macros instead.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmacro __using__(_opts) do
  quote do
    Module.register_attribute(__MODULE__, :transitions, accumulate: true)

    import     unquote(__MODULE__)

    # ensure our additional functions are added only right before compilation
    # after all module attribute values have been fully determined
    @before_compile unquote(__MODULE__)
  end
end

defmacro __before_compile__(_env) do
  quote do
    def transitions, do: @transitions
  end
end

defmacro transition(list) do
 # [...] omitted some checks for required fields for example 

  quote do
    @transitions unquote(list)
  end
end
</code></pre>
<p>You can then add transitions like this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  use # "&lt;module name&gt;"

  transition(state: :idle, in: :start,    next: :wait)
  transition(state: :wait, in: :continue, end:  :pass)
  transition(state: :end,  in: :finish)
</code></pre>
<p>I ended up supporting waiting for different incoming messages, a join, end states, and “guard functions” that can further refine if a transition is taken.</p>
<p>The resulting list of transitions then ends up in a module attribute I can read and process.</p>
<p>(The part of handler functions or callbacks is not shown as it is not specific to describing the transition table. I defaulted to <code>handle/2</code> as a default function for incoming functions, and allowed a user-defined handler name if needed that could be defined differently for every single transition.)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="247754" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-blog-post-finitomata-the-proper-fsm-for-elixir/46983/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-247754" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="247754"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="247756" data-post-id="247756">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mudasobwa" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mudasobwa/120/5298_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mudasobwa
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Cure</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Great! But in my understanding, the textual representation is easier to grasp and it produces a diagram in docs for free.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="247756" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-blog-post-finitomata-the-proper-fsm-for-elixir/46983/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-247756" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="247756"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="247809" data-post-id="247809">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="KristerV" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/KristerV/120/13808_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  KristerV
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>these examples are great. this opens up a whole new section in my head. thanks!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="247809" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-blog-post-finitomata-the-proper-fsm-for-elixir/46983/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-247809" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="247809"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="288030" data-post-id="288030">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ivanhercaz" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ivanhercaz/120/35764_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ivanhercaz
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>First, really great package, <a class="mention" href="/u/mudasobwa" rel="nofollow">@mudasobwa</a>. Easy to use and intuitive. Thank you for this contribution to the Elixir ecosystem.</p>
<p>Some days ago I tried to implemented a FSM to manage the setup of an application, but then I realized that maybe is not the proper use case.</p>
<p>Aside from the examples given in Finitomata’s documentation, have you got some application example with Finitomata implemented? Just to learn until I have the necessary time to implement some ideas I have.</p>
<p>Thanks in advance!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="288030" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-blog-post-finitomata-the-proper-fsm-for-elixir/46983/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-288030" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="288030"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="288201" data-post-id="288201">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mudasobwa" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mudasobwa/120/5298_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mudasobwa
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Cure</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>There is <a href="https://github.com/am-kantox/finitomata/tree/main/examples/ecto_intergation" rel="noopener nofollow ugc">https://github.com/am-kantox/finitomata/tree/main/examples/ecto_intergation</a> non-official take on integration with <code>ecto</code> (which would not be the best implementation, but still.)<br>
Aside from that, all other real-world examples I have I cannot actually share. I will try to come up with a better more sophisticated example, thanks.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="288201" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-blog-post-finitomata-the-proper-fsm-for-elixir/46983/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-288201" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="288201"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="288224" data-post-id="288224">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ivanhercaz" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ivanhercaz/120/35764_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ivanhercaz
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thank you very much, <a class="mention" href="/u/mudasobwa" rel="nofollow">@mudasobwa</a>! I must be going blind because I really didn’t see the <code>examples</code> directory in Finitomata’s repository <img src="https://forum.elixirforum.com/images/emoji/apple/sweat_smile.png?v=15" title=":sweat_smile:" class="emoji" alt=":sweat_smile:" loading="lazy" width="20" height="20"> . Really useful example.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="288224" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-blog-post-finitomata-the-proper-fsm-for-elixir/46983/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-288224" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="288224"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>