A duration is an expression of the form
PnYnMnDTnHnMnS, where each part is optional (years, months, etc.).
C_DURATION has constraints that allow or not each part/component, and also has a range constraint.
The range constraint has upper and lower limits that are of type
Duration. If we have a range of
P1Y validate against that constraint or not?
Another case: range =
P2Y..P5Y and value =
P1Y20M, does that fail because 1Y < 2Y or passes because the 20M is calculated as 1Y? I have checked in Java it is possible to
normalize certain durations so 20M becomes 1Y8M.
The question comes from: if the value should have the same components as the range and validate each component individually or if there are different components there is a unit conversion to do the comparison, like:
Another question is: both range and allowed fields constraints could be mixed, so we could have:
- allowed months = false
Should the range be also compliant with the
allowed fields? There is no rule in the spec AFAIK that checks that situation (Archetype Object Model 1.4 (AOM1.4))
If these cases are not considered in the current specs, we might need to clarify these cases, since it is related to conformance testing.