Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: PeterHeintz on January 25, 2018, 11:20:21 pm
-
Up to now my diagram queries had been simple enough to use the query builder.
But now I need sql and I want to filter to concrete diagram types like BDD or IBD.
The t_diagram table has a Diagram_Type field but only containing abstract types like Logical, Package,… but not the concrete once.
T_diagramtypes is also not helpful, so I tried to use the magic “description” field in t_xref. This field contains some diagram field information but I do not know how to connect to.
Does anyone know in which field and table the concrete diagram types are stored and how this table is connected to t_diagram.
Is it t_diagram->t_object->t_xref?
-
Hi,
The diagram metatype is stored in the StyleEx column of t_diagram. It is a MEMO field and contains a semi-colon separated list of key-value pairs, of which the key "MDGDgm" contains the type you are searching for as shown in the example below. As you can see getting this solely by query is not the easiest task, but with a script/add-in it is easily possible to parse the content of the attribute.
StyleEx content for a BDD:
SaveTag=721D3575;ExcludeRTF=0;DocAll=0;HideQuals=0;AttPkg=1;ShowTests=0;ShowMaint=0;SuppressFOC=1;MatrixActive=0;SwimlanesActive=1;KanbanActive=0;MatrixLineWidth=1;MatrixLineClr=0;MatrixLocked=0;TConnectorNotation=UML 2.1;TExplicitNavigability=0;AdvancedElementProps=1;AdvancedFeatureProps=1;AdvancedConnectorProps=1;m_bElementClassifier=1;ProfileData=;MDGDgm=SysML1.3::BlockDefinition;STBLDgm=;ShowNotes=0;VisibleAttributeDetail=0;ShowOpRetType=1;SuppressBrackets=0;SuppConnectorLabels=0;PrintPageHeadFoot=0;ShowAsList=0;SuppressedCompartments=;Theme=:119;
PS: For examining EA databases and finding information, I found a small tool, where you can browse through an actual EA project with data easily and perform SQL queries (also update and insert queries unlike through EA's SQL editor): http://www.alexnolan.net/software/mdb_viewer_plus.htm
-
Hi McMannus,
Thank you! That is what I was looking for.
Viewing the database is not my problem. I have MS Access and a MS SQL Manager on my machine.
My problem was that I have overseen that, when I was scanning all that super long stings like in StyleEx by my eyes. Maybe I should have better chosen a query.
Anyhow! Thank you very much!
-
For those interested, I use a free tool called Any SQL Maestro to query .eap file https://www.sqlmaestro.com/products/anysql/maestro/ (https://www.sqlmaestro.com/products/anysql/maestro/)
It an be used with almost any type of database and it has a freeware version as well.
Geert
-
Definitely gonna try that one as the feature table outperforms MDB Viewer plus the support for multiple DB types is great :-)
Thanks Geert!