How state machines and factories work together
masterA State Machine is the object that manipulates your domain object. A state machine is specific to a unique combination of an object + a graph.
Because you cannot manually instantiate a state machine for every object, you use the SM\Factory\Factory service. The factory takes your domain object and the name of the graph you want to apply, and returns the appropriate state machine instance.
To use it, inject SM\Factory\Factory into your service or controller.
public function myAwesomeAction($id, \SM\Factory\Factory $factory)
{
// Get your domain object
$article = $this->getRepository('MyAwesomeBundle:Article')->find($id);
// Get the state machine for this object, and graph called "simple"
$articleSM = $factory->get($article, 'simple');
}