Fixed WorkflowFactory entityManager bug.