Groovy, Javascript, or Jython scripting language can be used to create a validation rule which are used to validate elements in your model. The advantage of using script validation rules is that it is not necessary to compile and store them in a classpath. Oftentimes, the code is compact and simple.

 

How to create a  a script validation rule

  1. Create a constraint.
  2. Set the stereotype «UML Standard Profile::Validation Profile::validationRule» for the validation rule.
  3. Set the severity level, error message, and abbreviation.
  4. Specify constrained element(s).
  5. Specify the specification language (Groovy, Javascript, or Jython).
  6. Enter the validation code in the selected language.