§1. Exceptions of res iudicata, of agreement, and other peremptory exceptions which are called litis finitae must be proposed and adjudicated before the joinder of the issue. A person who proposes them later must not berejected but is liable for expenses unless the person proves that the presentation was not delayed maliciously.
§2. Other peremptory exceptions are to be proposed during the joinder of the issue and must be treated at the proper time according to the rules for incidental questions.
Source: Code of Canon Law (Vatican.va)