In 372, when Emperor Jianwen grew ill, he created Sima Yao crown prince and Sima Daozi the Prince of Langye. He died soon thereafter, and Sima Yao assumed the throne as Emperor Xiaowu.
Emperor Jianwen's illness led to his designation of Sima Yao as heir apparent and Sima Daozi as the Prince of Langye.  He died soon after, and Sima Yao took over the throne as Emperor Xiaowu.