Tool support of DV_DURATION

Hi everyone,

We’ve been confused by how modelling tools support the DV_DURATION class. We’ve come up with a set of hypotheses about how we think this should work ideally, and would like to discuss it with the community. Some of these are trivial, but I’m mentioning them anyway just to avoid any chance of misunderstandings. Hopefully we can agree on a set of guidelines for UI implementation.

  1. It should be possible to allow all time units, or select any combination of allowed units to the exclusion of all other time units.
  2. Only allowed time units can be used to set minimum, maximum or assumed values.
  3. An assumed value should always be within the interval given by any maximum and minimum values.
  4. When setting minimum and maximum values, the minimum should always be a smaller value (adjusted for units) than the maximum. For example: Minimum can’t be 120 minutes if maximum is 1 hour.
  5. When setting minimum and maximum values, the minimum time unit should always be smaller than or equal to the maximum time unit. For example: Minimum can’t be in hours if the maximum is in seconds.
  6. When setting minimum and maximum values, the maximum can’t be smaller than 1 [largest allowed unit]. For example, if months and years are allowed, the maximum can’t be set to 6 months.

Thoughts?

1 Like

*bump* I’d really like to get some feedback on this! :blush:

I suspect this is difficult to discuss in this forum and best addressed in a meeting. I’ve been confused as to how this works in practice, and suspect some of the tooling is not consistent.

Let’s look at some assumptions and possible use cases to start:

Duration data type allows a single unit as “1516 hours” or concatenated (?) multiple units as “2 months, 1 week and 4 hours”.

If we set a min PT0M (0 minutes) and max of P3M (3 months) in the Archetype Designer, then PT0M and P3M are setting the valid boundaries of the whole duration.

In the example 0 minutes-3 months above, if hours, days, and weeks also selected as available, then in an implementation, the end-user should be able to represent it in any configuration using the available units

Question: If hours and days and weeks are also allowed units, should we be able to set max and min for each unit, eg to limit the number of hours to 24, or leave it unconstrained to the duration limit of 3 months or 2190 hours?

Comments/thoughts

Heather

1 Like

At the specifications level…

That’s the case already, see here in the ADL2 spec (but this is unchanged from ADL1.4).

I guess you mean in the mixed constraint of the form PWD/|P0W..P50W| (see here in ADL2 spec).

The spec does imply what you say, but doesn’t actually say that in the interval part, only units from the left-hand part can be used - indeed, it seemed so obvious we didn’t state it. But we could add a bit more to that section to make it clearer.

That is the case globally in all ADL structures, regardless of the data type, and is stated by the VOBAV validity rule.

That is also a standard constraint in the model, specifically the Interval type. However, with Durations (almost uniquely), implementations have to take care to implement the = and < operators properly by normalising all units for comparison. So if this is not working in some tool, this is the reason.

I don’t remember ever thinking about this one, but it seems perfectly sensible. We could add that constraint to the AOM model and ADL documentation (would need a Change Request).

Same - we didn’t think about it, but it is also obvious - we should add it.

For the last 2, tools probably do random things, since there is nothing in the spec about these points. For the rest, I would say the spec is either clear, or the very obvious implication is clear.

I have created a new CR for these points.

We have never thought about this either, but could make sense.