OCLOperators filterOnType
Created by Alexandra on 2017-08-13 · Last edited by Vale.buyondo on 2025-12-13.
The filterOnType operator filters a collection and returns only the elements that are of a specific type.It is mainly used ininheritance hierarchies where a collection contains mixed subtypes.
Note! This includes subclasses.
Syntax
collection->filterOnType(TypeName)
Example
Order is a base classOnlineOrder inherits from Order
Customer.allInstances->first.Orders->filterOnType(OnlineOrder)
This returns only Orders of type OnlineOrder
