Author Topic: How to create a simple extract of UML (Data) Class names and descriptions  (Read 2595 times)

David.Molesworth

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
I'd like to create a data entity catalogue out the objects in EA.  Thought this would be a simple one table SQL query.  By description I mean the rich text box on the object / properties page.  t_object is the main table - name field found simple enough.  Can't find the description field.  Because rich text, maybe more complex.  Not even sure what the field is called?  No label on the front-end.  Tried to use the Query builder, but I can't seem to edit the fields returned beyond the base entity

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Hi David,

You probably want the Notes column in t_object.  But it contains HTML descriptors if you use character enhancements (bolding, italics etc.)

HTH,
Paolo

[Edit: My bad...  Thanks, Geert!]
« Last Edit: May 26, 2021, 03:30:59 pm by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
t_object.Note is the description field.
If you use the search window and leave the name of the field as "note" then EA will format the text for you.

If you want plain text you better use a little script.
You can get the contents you need using Repository.SQLQuery and you can then convert the description to plain text using Repository.GetFormatFromField

Geert

David.Molesworth

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Thanks Paolo and Geert for the replies.  How did I miss that field? - seems obvious.

Went back to my query and run a simple:
select name, note from t_object
where object_type = 'Class'

No error, but no note field returned.  Same if I run select * from t_object.  Are the HTML descriptors preventing the column being returned?

I'm just running from the SQL Scratch pad option in Search Model feature

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
For some reason you need to run
Code: [Select]
SELECT note as notex, * from t_object(notex might be anything else)

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
There is an option to show or hide the notes in the search window. It works on the name of the field returned.

Geert

David.Molesworth

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Thanks guys for the fast responses.  That resolved it.  The one field that is hidden by default.  I get the rational why the field is treated differently, but Sparx don't make this stuff easy