Cal. Civ. Proc. Code § 438
(a) As used in this section:
(b)
(c)
(1) The motion provided for in this section may only be made on one of the following grounds:
(B) If the moving party is a defendant, that either of the following conditions exist:
(2) The motion provided for in this section may be made as to either of the following:
(3) If the court on its own motion grants the motion for judgment on the pleadings, it shall be on one of the following bases:
(B) If the motion is granted in favor of the defendant, that either of the following conditions exist:
(f) The motion provided for in this section may be made only after one of the following conditions has occurred:
(g) The motion provided for in this section may be made even though either of the following conditions exist:
(h)
(4) If the motion is granted with leave to file an amended complaint or answer, as the case may be, then the following procedures shall be followed:
(i)
(1) Where a motion for judgment on the pleadings is granted with leave to amend, the court shall not enter a judgment in favor of a party until the following proceedings are had: