0

Sorting objects in DOORS by the built-in DXL Attribute "Last Modified On" only sorts to the date level. That is, after sorting there is no guarantee to the order of Objects that were modified on the same calendar date (but at different times).

That's beyond stupid, especially since other online sources suggest that this field does in fact have this information available - but apparently only sorts on the displayed info, not the underlying data.

Neverminding how I'd LIKE this to work, what can I do instead? Today a module has literally hundreds of changed Objects, but I'm only interested in those altered in the last hour.

Joe Marfice
  • 151
  • 2
  • 18

1 Answers1

0

Looks like DOORS stores Last Modified On as a date only, without any time. Just to check, I added a layout DXL column with this in it:

Date dMod
dMod = obj."Last Modified On"
dMod = dateAndTime(dMod)
display dMod ""

In return I was greeted with entries like:

09/08/15 00:00:00

I'm not really proud of this next thing, but it sort of does the job. I created a DXL attribute called Last History Date with the following DXL:

History hr
Date dResult = null
Date dHist = null
Date dLastMod = null

dLastMod = obj."Last Modified On"
dLastMod = dateAndTime(dLastMod)

for hr in obj do {
    dHist = hr.date
}

if (null dHist) { dResult = dLastMod }
else if (dLastMod > dHist) { dResult = dLastMod }
else { dResult = dHist }
obj.attrDXLName = dResult

If there are no history records, or history is recorded before Last Modified On, it just uses Last Modified On and you'll have to deal with 00:00:00. The history date isn't necessarily the same as Last Modified On -- depends on if you have "Affect change dates" or "Generate history" features turned on for the various object attributes. It's sort of a half-baked solution, but if you really want to sort with time I can't think of another way.

Kirk Kittell
  • 112
  • 2
  • 9
  • Thanks! A lot! However... "Check" runs without errors, but when I close the DXL dialog I get a runtime error, "Nul passed into first argument, line 16" (the last line). – Joe Marfice Oct 27 '16 at 21:34
  • Sorry about that--put it together while leaving the office. I won't have DOORS in front of me until Monday (hooray) to test, but maybe if "Last Modified On" and history are both null at the end, need to set the output to Created On. Or maybe a "" null string. I'll check it out then. – Kirk Kittell Oct 28 '16 at 11:11