Skip to content

Latest commit

 

History

History
executable file
·
26 lines (20 loc) · 973 Bytes

File metadata and controls

executable file
·
26 lines (20 loc) · 973 Bytes

org.eclipse.papyrus.training.library.validation

This plugin show how to contribute a validation rule

  1. Define a Java Constraint checking that a library has a minimum of books
  2. Define an Ocl Constraint checking that a book has more than 0 pages

How To code:

  • create the plug-in
  • contribute to the following extension point org.eclipse.emf.validation.constraintProviders in plugin.xml

How To test:

  1. Launch your eclipse-runtime
  2. Open Window > Preferences
  3. Select Model Validation > Constraints
  4. Verify that there is a category named "Library Example Validation Category"
  5. Verify that there is a rule named "minimum.books"
  6. Verify that there is a rule named "minimum.pages"
  7. Create the following model Library Book
  8. Right Click on model in the Model Explorer View> Validation > Validate model
  9. Verify that you have the warning messages in the model Validation view