Bug 161558 - Allow a single constraint to report multiple problems
Summary: Allow a single constraint to report multiple problems
Status: VERIFIED FIXED
Alias: None
Product: EMF Services
Classification: Modeling
Component: Validation (show other bugs)
Version: unspecified   Edit
Hardware: Other Linux
: P3 enhancement
Target Milestone: ---   Edit
Assignee: Christian Damus CLA
QA Contact:
URL:
Whiteboard:
Keywords: api, plan
Depends on:
Blocks:
 
Reported: 2006-10-19 08:49 EDT by Christian Damus CLA
Modified: 2017-02-24 15:09 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2006-10-19 08:49:38 EDT
AbstractModelConstraints are fairly heavy-weight objects, and sometimes it makes sense (esp. in large constraint libraries) to group related constraints into a single class to reduce the number of classes that need to be loaded and to localize functionally related code.  This can currently be done by assigning multiple constraint IDs to the same constraint class, and invoking different rules according to the 'current constraint ID' indicated by the validation context.

However, there are also cases in which violation of a single (logical) constraint has multiple different manifestations, which need to be reported individually from a single invocation of the constraint.  For this purpose, it should be very straight-forward to permit a constraint to return a MultiStatus of IConstraintStatus objects, each with (potentially) a different severity, message, target, and constraint locus.  Suitable API should be provided to enable clients to create IConstraintStatuses for composition into a MultiStatus.
Comment 1 Christian Damus CLA 2006-11-17 16:53:22 EST
Est.: .5w
Comment 2 Christian Damus CLA 2006-11-30 18:06:45 EST
Committed the fix to HEAD.

Look for new factory methods on the ConstraintStatus class to create additional statuses and to aggregate multiple results into a multi-status.  A multi-status nested to any depth can now be returned from the validate() method of a constraint.  It is recommended to use the multi-status created by the factory method because it implements the IConstraintStatus API.
Comment 3 Nick Boldt CLA 2008-01-28 16:35:26 EST
Move to verified as per bug 206558.