An DurationConstraint asserts that a Model Element (which becomes a ‘constrainedElement’) exists during a duration in time, possibly relative to some given set of observations.
•If the Duration has an expr, then this is evaluated to produce the result of the DurationExpression. The expr must evaluate to a single value.
•The expr can reference the observations associated with the Duration.
•If the Duration has an expr but no observations, then the expr evaluates to a duration constant.
•If the Duration does not have an expr, then it must have a single DurationObservation and the result of that observation is the value of the Duration.
How to specify a Duration Constraint
1 Create the DurationConstraint as a definition through the Explorer or by drawing an DurationConstraint on a diagram.
2 Create a Constraint to ConstrainedElement relationship between the DurationConstraint (in the example below, the constraint “Form Timeout”) and a Classifier (in the example below, the class “Web Form”) either by drawing the relationship on a diagram or by specifying the ConstrainedElement (in this case the class “Web Form”) in Constraint tab of the DurationConstraint definition
3 In the DurationConstraint definition, create its Specification – which is a DurationInterval definition.
4 Specify a max or min value of the Duration in the appropriate tabs of the DurationConstraint definition. In either case you create a Duration definition. In the Duration definition, specify: