protected function createTransition(TransitionInterface $sourceTransition)
{
$targetStateName = $sourceTransition->getTargetState()->getName();
$targetState = $this->findOrCreateState($targetStateName);
$this->mergeMetadata($sourceTransition->getTargetState(), $targetState);
$eventName = $sourceTransition->getEventName();
$condition = $this->createCondition($sourceTransition);
$transition = new Transition($targetState, $eventName, $condition);
if ($sourceTransition instanceof WeightedInterface) {
$transition->setWeight($sourceTransition->getWeight());
}
return $transition;
}