title: Modelling C# Action in UML
body: <p>I'm currently using my unorthodox UML skills to document some code.  Currently, I'm modelling a function that baffles me as far as UML is concerned.</p>
  
  <p>In a nutshell, this function creates an <code>Action, and this</code>Action<code>runs a statemachine in either blocking or non-blocking fashion (i.e. calls either</code>Invoke<code>or</code>BeginInvoke`, respectively).</p>
  
  <p>For example:</p>
  
  <pre><code>public void MyFunc()
  {
      bool dummy_blocking;
  
      Action my_action = new Action( () =&gt; {
          RunSomeStateMachine();
      });
  
      if( dummy_blocking)
          my_action.BeginInvoke( null, null);
      else
          my_action.Invoke();
  }
  </code></pre>
  
  <p>Would you just use a Create message to create an <code>Action</code>, and then in that <code>Action</code>'s lifeline call (to self) <code>RunSomeStateMachine</code>?  Following that, would you then use an alt fragment to either call <code>BeginInvoke</code> or <code>Invoke</code> on the <code>Action</code>?  The details around the <code>Action</code> are what really stump me.</p>
  
  <p>EDIT -- here is an example of my first attempt:</p>
  
  <p><img src="https://i.stack.imgur.com/ZYsXk.png" alt="enter image description here"></p>