title: Pytransitions queued hierarchical machine ends always in init state
body: <p>I'm using the pytransitions with HierarchicalMachine class to be able to create small nested machines to complete subtasks inside a bigger state machine. I'm using the queued transitions to be able to invoke a trigger from inside of the state callback.</p>
  <p>I would expect the following code ends in prepare_waiting state, but it actually goes back to prepare_init state.</p>
  <p>Do you have any idea why this happens?</p>
  <p><strong>Code:</strong></p>
  <pre><code>from transitions.extensions.factory import HierarchicalMachine
  import logging as log
  
  QUEUED = True
  
  class PrepareMachine(HierarchicalMachine):
      def __init__(self):
  
          states = [
              {&quot;name&quot;: &quot;init&quot;, &quot;on_enter&quot;: self.entry_init},
              {&quot;name&quot;: &quot;connecting&quot;, &quot;on_enter&quot;: self.entry_connecting},
              {&quot;name&quot;: &quot;waiting&quot;, &quot;on_enter&quot;: self.entry_waiting},
          ]
  
          super().__init__(states=states, initial=&quot;init&quot;, queued=QUEUED)
  
      def entry_init(self):
          print(&quot;common entry point ...&quot;)
          self.to_connecting()
  
      def entry_connecting(self):
          print(&quot;connecting multiple indtruments ...&quot;)
          self.to_waiting()
  
      def entry_waiting(self):
          print(&quot;wait for response ...&quot;)
  
  class ProductionMachine(HierarchicalMachine):
      def __init__(self):
          prepare = PrepareMachine()
          states = [&quot;init&quot;, {&quot;name&quot;: &quot;prepare&quot;, &quot;children&quot;: prepare}]
          super().__init__(states=states, initial=&quot;init&quot;, queued=QUEUED)
          self.add_transition(&quot;start_testing&quot;, &quot;init&quot;, &quot;prepare&quot;)
  
  log.basicConfig(level=log.INFO)
  machine = ProductionMachine()
  machine.start_testing()
  print(machine.state)
  </code></pre>
  <p><strong>Output:</strong></p>
  <pre><code>INFO:transitions.core:Finished processing state init exit callbacks.
  INFO:transitions.core:Finished processing state prepare enter callbacks.
  common entry point ...
  INFO:transitions.core:Finished processing state init exit callbacks.
  connecting multiple indtruments ...
  INFO:transitions.core:Executed callback '&lt;bound method PrepareMachine.entry_connecting of &lt;__main__.PrepareMachine object at 0xb6588bd0&gt;&gt;'
  INFO:transitions.core:Finished processing state connecting enter callbacks.
  INFO:transitions.core:Finished processing state connecting exit callbacks.
  wait for response ...
  INFO:transitions.core:Executed callback '&lt;bound method PrepareMachine.entry_waiting of &lt;__main__.PrepareMachine object at 0xb6588bd0&gt;&gt;'
  INFO:transitions.core:Finished processing state waiting enter callbacks.
  INFO:transitions.core:Executed callback '&lt;bound method PrepareMachine.entry_init of &lt;__main__.PrepareMachine object at 0xb6588bd0&gt;&gt;'
  INFO:transitions.core:Finished processing state init enter callbacks.
  prepare_init
  </code></pre>