Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: David.Molesworth on May 26, 2021, 12:50:34 pm

Title: How to create a simple extract of UML (Data) Class names and descriptions
Post by: David.Molesworth on May 26, 2021, 12:50:34 pm
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
Title: Re: How to create a simple extract of UML (Data) Class names and descriptions
Post by: Paolo F Cantoni on May 26, 2021, 12:58:03 pm
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!]
Title: Re: How to create a simple extract of UML (Data) Class names and descriptions
Post by: Geert Bellekens on May 26, 2021, 02:44:48 pm
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
Title: Re: How to create a simple extract of UML (Data) Class names and descriptions
Post by: David.Molesworth on May 26, 2021, 04:15:24 pm
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
Title: Re: How to create a simple extract of UML (Data) Class names and descriptions
Post by: qwerty on May 26, 2021, 04:26:13 pm
For some reason you need to run
Code: [Select]
SELECT note as notex, * from t_object(notex might be anything else)

q.
Title: Re: How to create a simple extract of UML (Data) Class names and descriptions
Post by: Geert Bellekens on May 26, 2021, 04:55:12 pm
There is an option to show or hide the notes in the search window. It works on the name of the field returned.

Geert
Title: Re: How to create a simple extract of UML (Data) Class names and descriptions
Post by: David.Molesworth on May 26, 2021, 06:43:13 pm
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