🚀 Welcome to MDriven Learn –  Don’t miss the latest Release Notes.
OCLOperators brokenConstraints

Returns a collection of the names of broken constraints for the class and object.

Example

Complaint.allinstances->first.brokenConstraints

What this does

  1. Complaint.allInstances → all Complaints
  2. ->first → one concrete instance
  3. .brokenConstraints → violated constraints for that instance

Returns only violated constraints.

The result is a collection (possibly empty).

See also: Constraints, OCLOperators constraints