Book a Demo

Author Topic: Reporting from a Model View folder  (Read 4986 times)

Andrew Warner

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Reporting from a Model View folder
« on: January 07, 2010, 10:04:29 am »
Hi all,
I'm trying to generate a report of an ad-hoc group of model elements.

I want to be able to flag or otherwise group the elements relevant for a particular perspective, for example a development team working on a module.

I should point out that we're using a cross-domain model, e.g. bpmn, business rules, business services, uml...and feeding that into a scrum team in the form of statements of requirement like user stories, domain model, business rules.

We want to highlight the things that are relevant and the relationships that exist in the model but for a focused view.

My first thought was to create a model view with a favourites folder in and report off that but the reports seem only to work on packages. A side question might be is it possible to report on an individual element?

My next attempt involved setting up a model document. I was planning to use a custom search to return the elements in the view.

Now, I can't see a way to get a reference to the contents of a model view in either the query builder or the sql query.

Is it possible to do that?

My next step was going to be to check out the API and write a script to return the elements but it's not clear to me that I can invoke the script from anywhere suitable for this purpose, e.g. a search or the element list in a model document.

Another option I suppose is to add a tagged value (can I add it to all types?) where I could add a bunch of names for these perspectives and put that in the query but that seems like a lot of work.

over to you folks.
Cheers,
Andrew.
« Last Edit: January 07, 2010, 10:07:13 am by adwarner »
Regards,
Andrew Warner.

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Reporting from a Model View folder
« Reply #1 on: January 08, 2010, 03:11:22 pm »
The Search facility results page (ctrl-F) does have a context menu option to generate RTF from the 'Selected' results returned by your query (use Ctrl-A  to select all). I suggest you try this for simpicity.
« Last Edit: January 08, 2010, 03:12:03 pm by Dermot »

Andrew Warner

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Reporting from a Model View folder
« Reply #2 on: January 08, 2010, 05:11:28 pm »
Thanks Dermot,
That works if the search can return the items I'm trying to find but there isn't really anything common to them. Except, perhaps, that they are linked in a favourites folder or are represented on a diagram.

I tried to use an RTF report template that details the elements on a diagram and that partly works if I generate the report from a package.

If I do it from a search result set (showing the diagram whose contents i want to report on) I get some nonsense from another element. I guess it's because the diagram isn't an element.

I have been trying to get the objects represented on the diagram from an sql search but I can't figure out the data items I need to get the DiagramObjects or their equivalent via sql.

Back to the drawing board. ::)

Cheers,
Andrew.

P.S. The problem I have is that the package structure doesn't necessarily reflect the reports I need but the reporting feature is intimately tied to the package structure. That means my packages start to look like a document rather than a model.
« Last Edit: January 08, 2010, 05:15:59 pm by adwarner »
Regards,
Andrew Warner.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Reporting from a Model View folder
« Reply #3 on: January 08, 2010, 05:44:34 pm »
Andrew,

To get the elements on a diagram from an sql search you should join t_diagram with t_diagramObject and t_object
(I'm guessing its the elements in t_object you are after)
t_diagram and t_diagramObject share the diagram_ID and t_diagramObject and t_object share the object_ID

Something like this:
Code: [Select]
select o.ea_guid as CLASSGUID,o.Object_Type as CLASSTYPE,o.name as Name,
package.name as 'Package Name' ,package_p1.name as 'Package level -1',package_p2.name as 'Package level -2',package_p3.name as 'Package level -3'
from ((((((t_diagram d
inner join t_diagramObjects do on d.diagram_id = do.diagram_id)
inner join t_object o on do.object_id = o.object_id)
inner join t_package package on o.package_id = package.package_id)
left join t_package package_p1 on package_p1.package_id = package.parent_id)
left join t_package package_p2 on package_p2.package_id = package_p1.parent_id)
left join t_package package_p3 on package_p3.package_id = package_p2.parent_id)
where d.name like '<Search Term>'

Geert

Andrew Warner

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Reporting from a Model View folder
« Reply #4 on: January 11, 2010, 11:52:18 am »
Thanks Geert,
you're a champ!

I didn't know about t_diagramObject; it doesn't show up in the Custom SQL Search list.

Do you know if the schema is documented anywhere?

I have the API object model from the doco but I'm not sure how closely it matches the schema. It also doesn't have the table names.

Cheers,
and thanks again
Andrew.
Regards,
Andrew Warner.

Andrew Warner

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Reporting from a Model View folder
« Reply #5 on: January 11, 2010, 01:00:40 pm »
Unfortunately,
the model document doesn't seem to run. When I generate an RTF document it complains that
Quote
To run a custom search you must specify ea_guid AS CLASSGUID in your select statement      

The search Geert provided does that but because of the joins it has to specify the table thus, "o.ea_guid"

Perhaps the "o." prefix screws up the RTF generation from a document model??

[edit]By the way, the vanilla search runs just fine. It's only when I invoke it via a Model Document that it fails.[/edit]

Cheers,
Andrew.
« Last Edit: January 11, 2010, 01:02:30 pm by adwarner »
Regards,
Andrew Warner.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Reporting from a Model View folder
« Reply #6 on: January 11, 2010, 07:22:52 pm »
Andrew,

I haven't tested this query with the RTF generator (because I don't use that).
The query IS in fact returning the ea guid as "CLASSGUID" so that shouldn't be a problem.

Just a hunch, what happens if you remove all fields from the select except for the CLASSGUID and maybe the CLASSTYPE ?

Any way this turns out, I would report this to Sparx as this is clearly a bug. (even if it is only the error message that needs to be adjusted to really provide a clue of what is wrong)


As for the datamodel documentation, there isn't any :'(

Geert