
806 So.2d 376 (2001)
Ex parte The CINCINNATI INSURANCE COMPANIES.
(Re Schlinkert Sports Associates, Inc., and Thomas R. Schlinkert v. Janet P. Bargeron).
1992363.
Supreme Court of Alabama.
June 15, 2001.
*377 Jene W. Owens, Jr., of Brooks & Hamby, P.C., Mobile, for petitioner.
James G. Curenton, Jr., Fairhope, for respondent.
SEE, Justice.
In a legal action by an entity known as The Cincinnati Insurance Companies ("Cincinnati") against Janet Bargeron, Cincinnati petitions for a writ of mandamus directing the Baldwin Circuit Court to dismiss Bargeron's counterclaims to the extent those counterclaims are based on the same homeowner's insurance policy that was the basis of a previously filed declaratory-judgment action in a federal court. Because we conclude that Bargeron's counterclaims, to the extent they are based on the homeowner's policy, were compulsory in the federal action, we grant the petition and issue the writ.
In January 1995, Cincinnati issued a homeowner's insurance policy to Thomas Schlinkert and Bargeron to insure their residence. At that time, Schlinkert and Bargeron were married; they were divorced in 1996. In dividing the marital estate, the trial court awarded Schlinkert possession of, and title to, the marital residence, and one-half of all household furniture and other furnishings. Approximately two weeks after the divorce, on August 14, 1996, while Schlinkert was out of town, Bargeron forcibly entered the marital residence and removed various furnishings and personal property from the home.[1]
Schlinkert filed an insurance claim with Cincinnati on August 19, 1996. According to Schlinkert's proof-of-loss claim, the value *378 of the personal property removed from the residence exceeded the limits of the homeowner's policy issued by Cincinnati. In investigating the claim, Cincinnati deposed Schlinkert. Bargeron refused to cooperate with Cincinnati's investigation. Following its investigation, Cincinnati paid Schlinkert $25,000.
On March 5, 1997, Cincinnati filed, in the United States District Court for the Southern District of Alabama, a declaratory-judgment action against Schlinkert and Bargeron. Cincinnati asked the federal court to determine the rights and obligations of all parties under the homeowner's insurance policy. The federal court, in July 1997, stayed the declaratory-judgment action pending resolution of Schlinkert and Bargeron's appeals in the divorce action.
On October 16, 1997, Schlinkert and the business he controls, Schlinkert's Sports Associates, Inc. ("SSA"), sued Bargeron in the Baldwin Circuit Court (CV-97-971), alleging civil theft and trespass, based on Bargeron's alleged removal of $84,000 from various financial accounts of SSA. Specifically, Schlinkert alleged that during 1994 and 1995 Bargaron had illegally transferred funds from SSA accounts to her own personal account.[2] Cincinnati paid Schlinkert $20,000 under the employee-theft and -dishonesty provision of the business policy.[3] Cincinnati became a plaintiff in the business-theft action, to the extent of its subrogation interest. On August 13, 1998, Schlinkert filed another civil action against Bargeron in the Baldwin Circuit Court (CV-98-742), alleging trespass and conversion, based on her removal of personal property from the marital residence.
The federal court then lifted its stay of the declaratory-judgment action, to determine
"whether an insurance company is contractually or otherwise legally obligated to one of its named insureds under its homeowner's insurance policy for the removal of more than one-half of the personal property from the insured residence by the other named insured (1) when there has been an intervening court decree generally dividing the personal property between the insureds in half and (2) there has not been a formal amendment to the written insurance policy to reflect the provisions of the divorce decree."
Exhibit M, Federal court order of November 17, 1998.
On February 11, 2000, in the state business-theft action (CV-97-971), Bargeron filed a counterclaim against Cincinnati, alleging breach of contract, bad faith, the tort of outrage, negligence, and wantonness. Specifically, Bargeron claimed that Cincinnati had breached its contract by failing to properly investigate Schlinkert's business- and home-theft claims. Cincinnati moved to dismiss or strike Bargeron's counterclaim to the extent that it was based on the same homeowner's policy that was at issue in the federal declaratory-judgment action. The trial court denied that motion.
On July 13, 2000, the federal court entered a judgment in favor of Schlinkert, *379 holding that he was entitled to recover from Cincinnati, subject to the policy limits, 100% of the value of the personal property removed by Bargeron, to the extent that the property removed exceeded Bargeron's one-half share of the total property.[4]
Cincinnati has petitioned for a writ of mandamus[5] directing the trial court to dismiss Bargeron's state-action counterclaims to the extent those counterclaims are based on the homeowner's policy that was the basis for the federal declaratory-judgment action. The writ of mandamus is an extraordinary writ; one petitioning for it must show (1) a clear legal right in the petitioner to the order sought, (2) an imperative duty on the respondent to perform, accompanied by a refusal to do so, (3) the lack of another adequate remedy, and (4) the properly invoked jurisdiction of the court. Ex parte Breman Lake View Resort, L.P., 729 So.2d 849, 851 (Ala.1999). The writ of mandamus "will issue only to compel the exercise of a trial court's discretion; it will not issue to control or to review a court's exercise of its discretion unless an abuse of discretion is shown." Id.
Rule 13(a), Ala. R. Civ. P., and Rule 13(a), Fed.R.Civ.P., provide:
"A pleading shall state as a counterclaim any claim which at the time of serving the pleading the pleader has against any opposing party, if it arises out of the transaction or occurrence that is the subject matter of the opposing party's claim and does not require for its adjudication the presence of third parties of whom the court cannot acquire jurisdiction."
(Emphasis added.) The purpose of Rule 13 "is to avoid circuity of actions and to enable the court to settle all related claims in one action and thereby avoid a wasteful multiplicity of litigation on claims that arose from a single transaction or occurrence." Grow Group, Inc. v. Industrial Corrosion Control, Inc., 601 So.2d 934, 936 (Ala.1992), citing 6 Charles Alan Wright, Arthur R. Miller & Mary Kay Kane, Federal Practice and Procedure: Civil § 1409 (2d ed.1990). To effect the purpose of Rule 13, the consequence for failing to assert a compulsory counterclaim is a bar against the assertion of that claim in any other action. See Brooks v. Peoples Nat'l Bank of Huntsville, 414 So.2d 917, 920 (Ala.1982); Owens v. Blue Tee Corp., 177 F.R.D. 673, 682 (M.D.Ala.1998).
The drafters of Rule 13, Ala. R. Civ. P., intended to adopt the "logical-relationship" *380 test for determining whether a counterclaim is compulsory. "A counterclaim is compulsory if there is any logical relation of any sort between the original claim and the counterclaim." Committee Comments on 1973 adoption of Rule 13, ¶ 6. Under the logical-relationship standard, a counterclaim is compulsory if "(1) its trial in the original action would avoid a substantial duplication of effort or (2) the original claim and the counterclaim arose out of the same aggregate core of operative facts." Ex parte Canal Ins. Co., 534 So.2d 582, 584 (Ala.1988) (quoting Brooks v. Peoples Nat'l Bank of Huntsville, 414 So.2d 917, 919 (Ala.1982)). In determining whether the claims "arose out of the same aggregate core of operative facts," this Court must determine whether "(1) the facts taken as a whole serve as the basis for both claims or (2) the sum total of facts upon which the original claim rests creates legal rights in a party which would otherwise remain dormant." Canal Ins., 534 So.2d at 584.
The United States Court of Appeals for the Eleventh Circuit has also adopted a logical-relationship test for determining whether a counterclaim is compulsory under Rule 13(a), Fed.R.Civ.P. See Republic Health Corp. v. Lifemark Hosps. of Florida, Inc., 755 F.2d 1453, 1455 (11th Cir. 1985). There is a logical relationship "when `the same operative facts serve as the basis of both claims or the aggregate core of facts upon which the claim rests activates additional legal rights, otherwise dormant, in the defendant.'" Republic Health, 755 F.2d at 1455 (quoting Plant v. Blazer Fin. Servs., Inc., 598 F.2d 1357, 1361 (5th Cir.1979)). Moreover, the Eleventh Circuit has stated that "[a] determination of whether a counterclaim is compulsory is not discretionary; rather, such a determination is made as a matter of law." Republic Health, 755 F.2d at 1454. See also Owens v. Blue Tee Corp., 177 F.R.D. 673, 680 (M.D.Ala.1998).
Cincinnati argues that Bargeron should have asserted her claims in the federal declaratory-judgment action because, it says, those claims arise from the same homeowner's insurance policy.[6] Cincinnati relies on Ex parte Canal Insurance Company, supra. In that case, Canal Insurance Company filed a federal declaratory-judgment action, seeking a determination of its obligations under an automobile-insurance policy. 534 So.2d at 583. The insured then filed a complaint in a state court, alleging breach of contract, bad faith, the tort of outrage, and fraud; the insured then answered the federal declaratory-judgment action, asserting as a counterclaim in that action the same allegations of fact and the same claims for relief that the insured had asserted in the state-court action. Id. Canal Insurance moved for a dismissal of the state-court action, asserting that the prior-pending, federal declaratory-judgment action barred the state claim. Id. Reviewing a mandamus petition related to the state court's denial of Canal Insurance's motion to dismiss, this Court stated that "the matter raised in the state court complaint constitute[d] a compulsory counterclaim in the federal court action *381... pending at the time the state court action was commenced." Canal Ins., 534 So.2d at 585.
Cincinnati's federal declaratory-judgment action sought a recognition of its "right ... to pursue, via subrogation, any claims which Thomas Robert Schlinkert may have against Janet Bargeron due to the [home theft]." The federal action also sought a "judgment against ... Bargeron for any further amounts [that the] Court determines are owed by Cincinnati to ... Schlinkert." In her counterclaim, Bargeron alleged breach of contract, bad faith, the tort of outrage, negligence, and wantonness in Cincinnati's handling of the home-theft and business-theft investigations and in the payment of insurance proceeds to Schlinkert.[7] Bargeron's counterclaims, to the extent they relate to the home-theft action, meet the logical-relationship test. If the claims against Cincinnati, in relation to the home-theft, had been filed as a counterclaim in the federal declaratory-judgment action, the parties and the claims would have (1) avoided "`a substantial duplication of effort [because] (2) the original claim and the counterclaim arose out of the same aggregate core of operative facts.'" Canal Ins., 534 So.2d at 584. It would have served the purposes of Rule 13 for Bargeron to have litigated her claims against Cincinnati in the same action in which Cincinnati sought a declaration of its rights and obligations under the homeowner's insurance policy; it would have avoided a multiplicity of actions, and all matters could have been resolved in one action. See Grow Group, Inc., 601 So.2d at 936. Therefore, insofar as Bargeron's claims relate to the matters at issue in the federal declaratory-judgment action and depend on the homeowner's policy, they are now barredthey were compulsory counterclaims that should have been asserted in the federal declaratory-judgment action. The trial court should have granted Cincinnati's motion to dismiss those claims. See Rule 13(a), Ala. R. Civ. P.; Brooks, 414 So.2d at 920 (the consequence for the failure to assert a compulsory counterclaim is to bar the assertion of that claim in any other action). We, therefore, grant the petition and issue the writ of mandamus directing the circuit court to dismiss Bargeron's counterclaims.
PETITION GRANTED AND WRIT ISSUED.
MOORE, C.J., and HOUSTON, BROWN, JOHNSTONE, HARWOOD, WOODALL, and STUART, JJ., concur.
NOTES
[1]  Schlinkert testified by deposition that one of his neighbors saw Bergeron and several other people as they loaded two moving vans with the household furnishings. Among the items taken from the home were electronics, rugs, furniture, mirrors, and jewelry and other miscellaneous personal items.
[2]  In January 1997, a Baldwin County grand jury indicted Bargeron on two counts of first-degree theft in connection with her transfers of $30,000 and $25,000 from SSA. In April 1999, a Baldwin County jury acquitted her of first-degree theft in connection with the $30,000 transfer. However, the jury convicted her of first-degree theft in connection with the $25,000 transfer.
[3]  Cincinnati had issued three separate policies to Schlinkert: a homeowner's policy, a business policy, and an umbrella policy.
[4]  The declaratory-judgment order deferred to the state court's determination of the following: (1) what items constituted the marital property that was divided in half by the divorce judgment; (2) what constituted "one-half"; (3) which items Bargeron had removed; and (4) the value of the removed items and whether that value exceeded Bargeron's one-half share.
[5]  This Court has stated that Rule 5, Ala. R.App. P., "provide[s] a simple and effective method of obtaining appellate review of an order" denying a motion to dismiss a counterclaim. In re Continental Oil Co. v. Williams, 370 So.2d 953, 955 (Ala.1979). In that case, this Court denied the petition for the writ of mandamus, noting that the proper method of review would be a Rule 5 appeal. See Continental Oil, 370 So.2d at 955. However, this Court has, by a petition for the writ of mandamus, reviewed the denial of a motion to dismiss a counterclaim. See Ex parte Canal Ins. Co., 534 So.2d 582 (Ala.1988).

The general rule is that a mandamus petition "`will not be granted if the matter complained of can be presented ultimately on an appeal.'" Miller v. Holder, 292 Ala. 554, 557, 297 So.2d 802, 804 (1974). However, mandamus review is "`allowed where, because of the particular circumstances involved, adequate redress cannot be afforded by appeal after final judgment.'" Id. (citations omitted).
[6]  Cincinnati argues that Rule 13(a), Ala. R. Civ. P., when read in conjunction with § 6-5-440, Ala.Code 1975 (prohibiting a party from prosecuting "two actions in the courts of this state at the same time for the same cause and against the same party") essentially makes the defendant with a compulsory counterclaim in the first action a "plaintiff" in that action (for purposes of § 6-5-440) as of the time of its commencement. See Ex parte Breman Lake View Resort, 729 So.2d at 851. Bargeron argues that § 6-5-440 is inapplicable because, she says, she is not a plaintiff in two separate actions; she argues that the only claim or action she filed is the counterclaim in the business-theft action. We need not address § 6-5-440, because our analysis under Rule 13(a) is dispositive.
[7]  Although Bargeron's complaint intertwines the home-theft and business-theft actions, they are separate actions.
