Book a Demo

Author Topic: Report definition - Generating a package baseline report  (Read 5002 times)

tjlindsay

  • EA User
  • **
  • Posts: 21
  • Karma: +2/-0
    • View Profile
Report definition - Generating a package baseline report
« on: November 03, 2016, 02:17:27 am »
Hi - I'm attempting to generate a report which details the package baseline(s) for a given package.

I've created a Version Control template which invokes a version control fragment.  The details of my fragment are:

SELECT d.Version as Version, Notes
FROM t_document d left join t_object o on d.ElementID = o.ea_guid
WHERE d.docType = 'Baseline'
ORDER BY d.version ASC

I've tried including a where clause which should pull the packageID on generation, thus pulling only the pertinent information back for the package - yet I can't seem to make it work. Is anyone able to assist please?

p.s.  It would be great if I could extract the date and time stamp from the 'notes' section into a separate column if anyone knows how to do that?

Thanks in advance.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Report definition - Generating a package baseline report
« Reply #1 on: November 03, 2016, 04:26:45 am »
Hi TJ,


The query is executed in the context of a package and an element/object being processed for document generation, so you can use the #PACKAGEID# and #OBJECTID# macros in your query.

In a baseline's t_document row, the ElementID corresponds to the package GUID -- not actually an element GUID as you've got in your query.

The reason it works is that an EA package has a row both in t_package and in t_object, with the same ea_guid in both. This has been discussed before on this forum, and Sparx representatives have stated that that GUID matching is subject to change without notice.

But there is a more compelling reason to use t_package in your query, which is that you can create baselines on root nodes -- and root nodes do not have a t_object row. They're packages, but not elements (which is why they can't be shown in diagrams or have connectors going to them). Thus, your query won't find root node baselines.

So use t_package instead, and match t_package.Package_ID with #PACKAGEID#.


As to the second part of your question, the Notes column is text, not a timestamp. The "Baseline time:" text is simply the default in a dialog which the user may override, so you're not guaranteed to find a time there at all. Use t_document.DocDate instead.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.

tjlindsay

  • EA User
  • **
  • Posts: 21
  • Karma: +2/-0
    • View Profile
Re: Report definition - Generating a package baseline report
« Reply #2 on: November 03, 2016, 09:51:19 pm »
Uffe - Excellent, thanks for the direction.  Got it to work.  ;D

Thanks,

TJ.

tjlindsay

  • EA User
  • **
  • Posts: 21
  • Karma: +2/-0
    • View Profile
Re: Report definition - Generating a package baseline report
« Reply #3 on: December 01, 2016, 06:14:05 am »
Is there a way to report on the baseline author as well?  I can't remember seeing a field in the baseline version screen which records the author information.

Many thanks,
TJ

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Report definition - Generating a package baseline report
« Reply #4 on: December 01, 2016, 06:52:19 pm »
Hi again,

Yeah, no. What you've seen is what you get: there is an Author column in t_document, but it is left empty when a baseline is created. The New Baseline dialog doesn't have a field for it, and it's not filled in with the Author value from EA's options.

So you could report it quite easily, since you're pulling info from the database anyway, but nothing will come out when you do.


/Uffe
My theories are always correct, just apply them to the right reality.

tjlindsay

  • EA User
  • **
  • Posts: 21
  • Karma: +2/-0
    • View Profile
Re: Report definition - Generating a package baseline report
« Reply #5 on: December 07, 2016, 05:20:36 am »
Thanks Uffe, I did wonder! Never mind - back to the drawing board.

TJ.