Book a Demo

Author Topic: model search (SQL) and project constants  (Read 9772 times)

JocaRamiro

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: model search (SQL) and project constants
« Reply #15 on: August 05, 2010, 12:17:06 am »
Hello Gert,

First of all: Thank you for your quick and helpful response.

Secondly - "dump into Access" was a bit loose, but in the end more or less accurate.  Since my Access is a later edition than the one supported by EA, I made a copy of the file, converted it into a .mdb, and then did stuff to it.  I was afraid that I would end up making changes that corrupted EA's use of the data.  So, if I can have my queries run directly in EA, I avoid having to carry out this process over and over as the data changes.

Thirdly - I was able to follow that dialog, to get to the model search screens, and to create my searches.  This is great.   I would like to expose these searches when I create output from my EA model - either as .html or as .rdb.  Can I point to or embed my searches in one of the packages I have created.

Forthly - You referred to needing the EA Guid, and the like.  I did not understand the relevance of the comment.  Can you expand? For reference, here is one of my queries (which is probably more clumsy than it needs to be)

SELECT t_attribute.[Name], t_attribute.[Type], t_attribute.[Notes]
FROM t_attribute
WHERE t_attribute.[Stereotype]="AllReg"
Or t_attribute.[Stereotype]="AART"
Or t_attribute.[Stereotype]="AART/ANC"
Or t_attribute.[Stereotype]="AART/ANC/Exp"
Or t_attribute.[Stereotype]="AART/ANC/LD"
Or t_attribute.[Stereotype]="AART/ANC/LD/Exp"
Or t_attribute.[Stereotype]="AART/Exp"
OR t_attribute.[Stereotype]="AART/LD/TB"
Or t_attribute.[Stereotype]="AART/LD/TBS/TBD"
Or t_attribute.[Stereotype]="AART/TBD"
Or t_attribute.[Stereotype]="AART/TBS"
Or t_attribute.[Stereotype]="ART"
ORDER BY t_attribute.[Name];

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: model search (SQL) and project constants
« Reply #16 on: August 05, 2010, 03:15:09 pm »
Joca,

From within EA you can copy/paste the results in excel or something like that, but there is no other real "export" facility.
If you really need something like that you can write a little script or addin that uses the API.
The Repository class has an operation: SQLQuery that will accept any (select) query and returns the results as XML. From that output you should be able to convert to whatever format you need.

Forthly: the CLASSGUID and CLASSTYPE are used by EA to
- a: allow you to doubleclick on an element returned by the search, or find it in the project browser
- b: show you the correct icon for this type of element.

These two fields are not displayed as such.

As to the question  of "pointing or embedding in packages", I'm not sure what you mean by that, could you elaborate?

Geert