On petition of a party to an arbitration agreement alleging the existence of a written agreement to arbitrate a controversy and that a party to the agreement refuses to arbitrate that controversy, the court shall order the petitioner and the respondent to arbitrate the controversy if it determines that an agreement to arbitrate the controversy exists, unless it determines that:
If the court determines that a written agreement to arbitrate a controversy exists, an order to arbitrate that controversy may not be refused on the ground that the petitioner's contentions lack substantive merit.
If the court determines that there are other issues between the petitioner and the respondent which are not subject to arbitration and which are the subject of a pending action or special proceeding between the petitioner and the respondent and that a determination of such issues may make the arbitration unnecessary, the court may delay its order to arbitrate until the determination of such other issues or until such earlier time as the court specifies.
If the court determines that a party to the arbitration is also a party to litigation in a pending court action or special proceeding with a third party as set forth under subdivision (c), the court (1) may refuse to enforce the arbitration agreement and may order intervention or joinder of all parties in a single action or special proceeding; (2) may order intervention or joinder as to all or only certain issues; (3) may order arbitration among the parties who have agreed to arbitration and stay the pending court action or special proceeding pending the outcome of the arbitration proceeding; or (4) may stay arbitration pending the outcome of the court action or special proceeding.
Ca. Civ. Proc. Code § 1281.2