In an action, inter alia, to recover damages for discrimination in employment on the basis of age in violation of Executive Law § 296, the plaintiff appeals from an order of the Supreme Court, Kings County (Landicino, J.), dated October 25, 2012, which, in effect, granted the defendants’ motion pursuant to CPLR 3211 (a) to dismiss the complaint on the ground that the action was barred by the doctrine of res judicata.
Ordered that the order is affirmed, with costs.
From 1982 until his retirement in 2005, the plaintiff was employed by the New York City Department of Education (hereinafter the Department) as a plumber. In February 2004, charges were brought against the plaintiff pursuant to Civil Service Law § 75, alleging various types of work-related misconduct, and he was suspended for 30 days without pay. After a hearing, an administrative law judge upheld several of the charges and recommended that the plaintiff be suspended for a period of 30 days, to be satisfied by the prehearing suspension he had already served. While the charges were pending, the plaintiff served a notice of claim upon the City. In September 2004, he commenced an action in the Supreme Court (hereinafter the 2004 action) against the City, the Department, and his supervisor, Nunzio Piro, alleging, inter alia, defamation and intentional infliction of emotional distress. In an order dated February 21, 2008, the Supreme Court granted the defendants’ motion for summary judgment dismissing the complaint. In an order dated March 10, 2009, this Court affirmed the order of the Supreme Court (see Bayer v City of New York, 60 AD3d 713 [2009]).
*898In October 2005, while the 2004 action was pending, the plaintiff served another notice of claim upon the City. In June 2006, he commenced the instant action in the Supreme Court against the City, the Department, Piro, and two other employees of the Department, Richard Frisby and Michael Fiore, alleging age discrimination and the creation of a hostile work environment in violation of Executive Law § 296. In an order dated October 25, 2012, the Supreme Court, in effect, granted the defendants’ motion to dismiss the complaint in the instant action on the ground that the action was barred by the doctrine of res judicata (see CPLR 3211 [a] [5]).
“Under the doctrine of res judicata, a disposition on the merits bars litigation between the same parties, or those in privity with them, of a cause of action arising out of the same transaction or series of transactions as a cause of action that either was raised or could have been raised in the prior proceeding” (Abraham v Hermitage Ins. Co., 47 AD3d 855, 855 [2008]). Generally, to establish privity the interests of the nonparty must have been represented by a party in the prior proceeding (see Green v Santa Fe Indus., 70 NY2d 244, 253 [1987]). The Court of Appeals has observed that privity is an “amorphous concept,” not easily applied (Buechel v Bain, 97 NY2d 295, 304 [2001], cert denied 535 US 1096 [2002] [internal quotation marks omitted]), but persons in privity include those whose interests are represented by a party to the previous action and those “[whose] own rights or obligations in the subsequent proceeding are conditioned in one way or another on, or derivative of, the rights of the party to the prior litigation” (D’Arata v New York Cent. Mut. Fire Ins. Co., 76 NY2d 659, 664 [1990]).
“ ‘The fact that causes of action may be stated separately, invoke different legal theories, or seek different relief will not permit relitigation of claims’ ” (Pondview Corp. v Blatt, 95 AD3d 980, 980 [2012], quoting Matter of ADC Contr. & Constr., Inc. v Town of Southampton, 50 AD3d 1025, 1026 [2008]). Thus, the doctrine of res judicata “operates to preclude the renewal of issues actually litigated and resolved in a prior proceeding as well as claims for different relief which arise out of the same factual grouping or transaction and which should have or could have been resolved in the prior proceeding” (Koether v Generalow, 213 AD2d 379, 380 [1995] [internal quotation marks omitted]; see Luscher v Arrua, 21 AD3d 1005, 1006-1007 [2005]). In determining whether a factual grouping constitutes a transaction for res judicata purposes, a court must apply a pragmatic test and analyze how the facts are related as to time, space, origin or motivation, whether they form a convenient trial unit *899and whether treating them as a unit conforms to the parties’ expectations or business understanding (see Xiao Yang Chen v Fischer, 6 NY3d 94, 100-101 [2005]; Smith v Russell Sage Coll., 54 NY2d 185, 192-193 [1981]; Douglas Elliman, LLC v Bergere, 98 AD3d 642, 643 [2012]). For the doctrine of res judicata to be applied, there must have been, in the prior proceeding, a final judgment on the merits (see Brown v Lutheran Med. Ctr., 107 AD3d 837, 838 [2013]). “An order granting a summary judgment motion is on the merits and has preclusive effect” (Methal v City of New York, 50 AD3d 654, 656 [2008]).
The causes of action asserted by the plaintiff in the instant action arose out of the same transaction or series of transactions as those raised in the 2004 action. Moreover, as the plaintiff commenced this action in 2006, during the pendency of the 2004 action, all of the causes of action asserted here could have been raised in the 2004 action. The allegations here, while amplified somewhat by the assertions concerning the plaintiffs retirement in 2005 and the reasons therefor, arose from the same events that underpinned the 2004 action. Furthermore, although Frisby and Fiore were not named in the 2004 action, since they are employees of the Department whose conduct formed the basis of the plaintiffs allegations in the 2004 action, they are entitled to rely upon the beneficial disposition of the 2004 action against the City and the Department (see Perry v Costa, 97 AD2d 655, 655-656 [1983]). Accordingly, notwithstanding the fact that the causes of action and legal theories alleged here are different from those alleged in the 2004 action, and some of the defendants are different, the Supreme Court properly granted the defendants’ motion to dismiss the complaint on the ground that the instant action was barred by the doctrine of res judicata.
In light of our determination, we need not reach the parties’ remaining contentions.
Dillon, J.E, Hall, Austin and Sgroi, JJ., concur.