Topic
  • 6 replies
  • Latest Post - ‏2013-04-18T15:57:13Z by lanef
lanef
lanef
18 Posts

Pinned topic Need help working with History Records

‏2013-04-17T16:04:19Z |

Hi,

So I have a user(s) wanting a spreadsheet of information.  I've made a lot of headway but need some brain power help.  The information is to be broken down into months, be specific to a module, and will consist of counts of 1) All requirements in module for that month, 2) All modify actions on requirements for that month, 3) All deletions of requirements for that month, and 4) All additions of new requirements for that month.

Most of this I can get from module history (I think) by looping through and keying off types like modifyObject, deleteObject, addObject and using the associated absno to look up objects.  So what I'm thinking (by running test programs to help my understanding, and with much hellp from our DOORS community) is that to accurately count objects that are requirements for any given month in the life of an object I'll have to start with the oldest baseline and start a running sum sort of thing for requirements counts.  Someone please point me to a more graceful solution?

Also noticed that some history records (e.g. a purgeObject type) have absno of -1.  What does -1 signify? Is there anyway to extract the object number that was actually purged?  I'm thinking if an object (that happened to be a requirement) gets purged it introduces an unfixable broke.  Is there a way to 'read' information about purged objects from History records?

Hopefully at least some of this makes sense.  Any help/constructive comments are, as always, greatly appreciated.

 

Best,

Frank

  • llandale
    llandale
    2972 Posts
    ACCEPTED ANSWER

    Re: Need help working with History Records

    ‏2013-04-17T17:54:55Z  

    Oh yes.  You need to run History as the "Administrator".

    In order to prevent folks from using History to get information about Objects to which they lack any "R" access, History for purged objects is "ReadLockedData".  This is because it sees that the current user lacks "R" access to an object that no longer exists.  Likewise if you rename an attribute, all History for that attribute becomse "ReadLockedData" because it cannot determine your rights.  However, the "Administrator" can see all History.  "-1" is the value of integer readlocked data.

    -Louie

  • llandale
    llandale
    2972 Posts

    Re: Need help working with History Records

    ‏2013-04-17T17:42:13Z  

    1) While your last 3 requirement indeed seem to me to come from History, the 1st one "Count of Requirements" should be just, well, the count of requirements at the time of the report:

    • int Count = 0
    • for o in mod do {if (o is a requirement) then Count++}

    2), 3), and 4).  This may get tricky.  When an object is created it is not a "Requirement" yet.  So when you see a "createObject" History you may need to query that object NOW to see if it IS a requirement.  But you also perhaps want to increment the count if it WAS a requirement when the History was made; since perhaps your definition of "Requirement" excludes deleted objects.  What do you count if you set "IsRequirement" to "False" and then deleted the object?  I wonder if your report script could maintain attribute "Was Requirement", which is read the next time the script runs. Yuuuuuuck; I see not good solution here.

    I wonder if the following outline is useful:

    • for hst in module do
    • {  dat = hst.date
    •    if (dat is outside range) then continue
    •    ht = hst.type
    •    if (I care about this History Type)
    •    {  AbsNo = hst.absNo
    •       if (AbsNo represents a "Requirement") then do counting
    •    }
    • }

    2) Seems to me that "Modifications to Requirements" may mean "Modifications to Requirement Text"; if so the History needs to be for attribute "Object Text".  In any case you probably want a specific list of Attributes modifications to count, ignoring others.

    You only need to read history back to the previous month; or back to when the script last run; or back 30 days or whatever.  Things get sticky of you have baselined during this period.  Perhaps run the script right before you Baseline and then you only need to work with History in the current module; not in all baselines in the interval period.

    I don't believe I've run into AbsNo of -1 for a purgeObject.

    -Louie

  • llandale
    llandale
    2972 Posts

    Re: Need help working with History Records

    ‏2013-04-17T17:54:55Z  

    Oh yes.  You need to run History as the "Administrator".

    In order to prevent folks from using History to get information about Objects to which they lack any "R" access, History for purged objects is "ReadLockedData".  This is because it sees that the current user lacks "R" access to an object that no longer exists.  Likewise if you rename an attribute, all History for that attribute becomse "ReadLockedData" because it cannot determine your rights.  However, the "Administrator" can see all History.  "-1" is the value of integer readlocked data.

    -Louie

  • lanef
    lanef
    18 Posts

    Re: Need help working with History Records

    ‏2013-04-17T20:03:04Z  
    • llandale
    • ‏2013-04-17T17:54:55Z

    Oh yes.  You need to run History as the "Administrator".

    In order to prevent folks from using History to get information about Objects to which they lack any "R" access, History for purged objects is "ReadLockedData".  This is because it sees that the current user lacks "R" access to an object that no longer exists.  Likewise if you rename an attribute, all History for that attribute becomse "ReadLockedData" because it cannot determine your rights.  However, the "Administrator" can see all History.  "-1" is the value of integer readlocked data.

    -Louie

    Thank you Louie!  I'm going to study these responses and I appreciate your outline.  I always learn from studying your code.  Learn in the sense of both  this is what you do and style issues that make a difference.

    My user is being adamant about wanting exact (as possible) requirement counts for particular months.  And thank you for highlighting the Is/Was requirement issue (there really is no good solution).

    Best,

    Frank

  • llandale
    llandale
    2972 Posts

    Re: Need help working with History Records

    ‏2013-04-18T13:41:37Z  
    • lanef
    • ‏2013-04-17T20:03:04Z

    Thank you Louie!  I'm going to study these responses and I appreciate your outline.  I always learn from studying your code.  Learn in the sense of both  this is what you do and style issues that make a difference.

    My user is being adamant about wanting exact (as possible) requirement counts for particular months.  And thank you for highlighting the Is/Was requirement issue (there really is no good solution).

    Best,

    Frank

    Oh.  You want a report run now that generates what things looked like at various month intervals in the past.  Then yes you need to "count" requirements by adjusting by those created and deleted.

  • llandale
    llandale
    2972 Posts

    Re: Need help working with History Records

    ‏2013-04-18T14:19:51Z  
    • lanef
    • ‏2013-04-17T20:03:04Z

    Thank you Louie!  I'm going to study these responses and I appreciate your outline.  I always learn from studying your code.  Learn in the sense of both  this is what you do and style issues that make a difference.

    My user is being adamant about wanting exact (as possible) requirement counts for particular months.  And thank you for highlighting the Is/Was requirement issue (there really is no good solution).

    Best,

    Frank

    As for "style"...  There is a saying that humans can "juggle 5 +/- 2 balls in their heads at one time".  Or is it "7".  whatever.  This means that for most folks, a diagram with say 8 bubbles is drastically harder to comprehend than one with 7, which is only a little harder than one with 6.

    Now there are a lot of folks who can juggle lots of balls, and many of those folks are here.  These folks don't need "style" nor "neatness" nor "comments" nor other crutches in order to understand later what they have written earlier since they can juggle all that details with little effort.  While inside some detail they can remember many other important details and don't need any visual help in the code to do so.

    I'm not one of them.  If I cannot see the entire function and see the parts and how they interact (without actually reading the lines of code) then I'm a basket case.  So I take a lot of care with "style" because I write a LOTS of code, much of it complicated, and if I don't use visual clues or carefully crafted variable names etc I cannot work on it at all.

    And I'd like to say that the wiz-bangers who CAN juggle lots of balls should "write down" to the level of the rest of us, since making the code understandable to the next dude later is just as important as making it work on the computer for you now.

    -Louie

    I had a collaborator who wrote this 2500 line program.  Fe had two small functions at the top and everything else in the main function; most of it repeated 8 or so times.  The depth of the program was perhaps 25 levels, so every 8 levels or soe he'd reset the indent back to the left edge of the file.  Well, he could keep track of all that detail and was astounded that I could not.  I was astounded that he could, but flabbergasted that he could not understand he had a rather unique talent.

  • lanef
    lanef
    18 Posts

    Re: Need help working with History Records

    ‏2013-04-18T15:57:13Z  
    • llandale
    • ‏2013-04-18T14:19:51Z

    As for "style"...  There is a saying that humans can "juggle 5 +/- 2 balls in their heads at one time".  Or is it "7".  whatever.  This means that for most folks, a diagram with say 8 bubbles is drastically harder to comprehend than one with 7, which is only a little harder than one with 6.

    Now there are a lot of folks who can juggle lots of balls, and many of those folks are here.  These folks don't need "style" nor "neatness" nor "comments" nor other crutches in order to understand later what they have written earlier since they can juggle all that details with little effort.  While inside some detail they can remember many other important details and don't need any visual help in the code to do so.

    I'm not one of them.  If I cannot see the entire function and see the parts and how they interact (without actually reading the lines of code) then I'm a basket case.  So I take a lot of care with "style" because I write a LOTS of code, much of it complicated, and if I don't use visual clues or carefully crafted variable names etc I cannot work on it at all.

    And I'd like to say that the wiz-bangers who CAN juggle lots of balls should "write down" to the level of the rest of us, since making the code understandable to the next dude later is just as important as making it work on the computer for you now.

    -Louie

    I had a collaborator who wrote this 2500 line program.  Fe had two small functions at the top and everything else in the main function; most of it repeated 8 or so times.  The depth of the program was perhaps 25 levels, so every 8 levels or soe he'd reset the indent back to the left edge of the file.  Well, he could keep track of all that detail and was astounded that I could not.  I was astounded that he could, but flabbergasted that he could not understand he had a rather unique talent.

    Very well said post!  I know what you mean about those types of folks, to an objective observer it's amazing to see the things they can't understand.  Unfortunately I'm not one of them so I appreciate every bit of help from everyone on this forum!  There are a lot of very talented and very patient/kind folks here.  I appreciate you all.

    You have a profound understanding of DOORS and DXL, I'm using your stuff to pull me up from where I am.  In searching the forum I've come across a couple of your posts that were so technically detailed that I couldn't understand them in fifteen minute time span.  They're bookmarked and I'm going to study them when I have some breathing room.

    Thank you very much!

    Best,

    Frank