A written dismissal of an action shall be entered in the clerk's register and is effective for all purposes when so entered.
All dismissals ordered by the court shall be in the form of a written order signed by the court and filed in the action and those orders when so filed shall constitute judgments and be effective for all purposes, and the clerk shall note those judgments in the register of actions in the case.
Ca. Civ. Proc. Code § 581d