title: spring-statemachine 2.3.1 - How to get a StateMachine from a StateMachineModelFactory?
body: <p>I'm having the following business case while working with spring-statemachine 2.3.1 in a project:</p>
  
  <p>The state machine is defined with the Papyrus plugin and loaded from an uml file using the UmlStateMachineModelFactory as shown below:</p>
  
  <pre><code>public class MyStateMachineConfig extends StateMachineConfigurerAdapter&lt;String, String&gt;
  {
    @Override
    public void configure(StateMachineModelConfigurer&lt;String, String&gt; model) throws Exception
    {
      model.withModel().factory(myStateMachineModelFactory());
    }
  
    @Bean
    public StateMachineModelFactory&lt;String, String&gt; myStateMachineModelFactory()
    {
      return new UmlStateMachineModelFactory("classpath:my.uml");
    }
    ....
  </code></pre>
  
  <p>I need to persist the state machine context in a database using JPA. In order to do this, I need to use StateMachinePersister.persist(). This method uses as its first input parameter a StateMachine instance. However, I'm not able to get the StateMachine instance from my StateMachineModelFactory. The class StateMachineFactory has a method named getStateMachine() while the class StateMachineModelFactory doesn't.</p>
  
  <p>I didn't find neither a way to get a StateMachineFactory instance from a StateMachineModelFactory instance. Could anyone please help with some suggestions, ideally examples ? The documentation has different examples of how to do it but none for the case when the state machine is loaded from an UML file.</p>
  
  <p>Kind regards,</p>
  
  <p>Nicolas DUMINIL</p>