An IntervalConstraint asserts that a Model Element (which becomes a ‘constrainedElement’) must have a value in the given range interval. An Interval is a range between two values – specifically a ValueSpecification specified using two other ValueSpecifications, the min and the max.
The constrainedElements of an IntervalConstraint are asserted to have values that are within the range specified by the Interval of the IntervalConstraint.If a constrainedElement has a value outside this range, then the IntervalConstraint is violated.
How to specify an Interval Constraint
1 Create the IntervalConstraint as a definition through the Explorer or by drawing an IntervalConstraint on a diagram.
2 In the IntervalConstraint definition, create its Specification – which is an Interval definition.
3 Specify the max value and the min value of the Interval. In the example below, an Integral of 100 At Bats is chosen for the min for a “Regular Backup” baseball player. The max is set to an Integral of 300 At Bats.
4 Draw a Constraint to ConstrainedElement relationship between the Constraint and a Classifier – in this example to the class Baseball Player – or specify the ConstrainedElement (in this case the class BaseballPlayer) in Constraint tab of the IntervalConstraint definition.