Requisites of res judicata

What are the requisites of res judicata as a ground for motion to dismiss under [the old] Rule 16 of the Rules of Court? They are the following:

[1] The former judgment or order must be final;

[2] It must be a judgment or order on the merits;

[3] The court which rendered it had jurisdiction over the subject matter and the parties; and

[4] There must be, between the first and second actions, identity of parties, of subject matter and of cause of action.