Book a Demo

Author Topic: How to Extract Custom View Types in a Query  (Read 3937 times)

wikitect

  • EA User
  • **
  • Posts: 117
  • Karma: +2/-0
    • View Profile
    • TRAK Community
How to Extract Custom View Types in a Query
« on: November 02, 2009, 11:18:49 pm »
This is actually a registered support request that was submitted on 9th November and never responded to despite having submitted a reminder to find out what was happening ....

I have created a MDG Technology plugin that adds some specific diagram types based on the base UML set. I want to create a SQL search that pulls out a list of diagrams and these custom types.

I can see I need to use t_diagram. I had thought t_diagramtypes might help but this just contains the base set of diagram types.

Does anyone know where custom diagram types would be stored and the key to link this back to t_diagrams?

Thanks
======
Favourite epitaph: 'Under this sod lies another'

TRAK Framework https://sf.net/p/trak
MDG for TRAK https://sf.net/p/mdgfortrak

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: How to Extract Custom View Types in a Query
« Reply #1 on: November 03, 2009, 08:50:52 am »
If you want a list of available custom diagram types, can't help you: it's held in memory not the database.

If you want to know, for a specific diagram, whether it is a custom diagram type: t_diagram.StyleEx has a property setting like 'MDGDgm=BPMN1.1::BPMN;' buried in amongst all the other properties.

This field is available to automation (read/write): EA.Diagram.StyleEx
The Sparx Team
[email protected]

wikitect

  • EA User
  • **
  • Posts: 117
  • Karma: +2/-0
    • View Profile
    • TRAK Community
Re: How to Extract Custom View Types in a Query
« Reply #2 on: November 03, 2009, 09:17:44 am »
No, I don't need to know all the available types.

I have extended the basic types Logical and Activity and need to find out which of these each diagram is.

It has to be introduced by the MDG technology and presumably stored so that when the technology isn't loaded each diagram still knows what custom type it is.
======
Favourite epitaph: 'Under this sod lies another'

TRAK Framework https://sf.net/p/trak
MDG for TRAK https://sf.net/p/mdgfortrak

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to Extract Custom View Types in a Query
« Reply #3 on: November 03, 2009, 09:53:58 pm »
And what does your Diagram.StyleEx field read for those custom diagram types?

Geert

wikitect

  • EA User
  • **
  • Posts: 117
  • Karma: +2/-0
    • View Profile
    • TRAK Community
Re: How to Extract Custom View Types in a Query
« Reply #4 on: November 03, 2009, 10:16:52 pm »
Typically of the form


Code: [Select]
ExcludeRTF=0;DocAll=0;HideQuals=0;AttPkg=1;ShowTests=0;ShowMaint=0;SuppressFOC=1;
MatrixActive=0;SwimlanesActive=1;MatrixLineWidth=1;MatrixLocked=0;TConnectorNotation=UML 2.1;
TExplicitNavigability=0;AdvancedElementProps=1;AdvancedFeatureProps=1;
AdvancedConnectorProps=1;
ProfileData=;MDGDgm=TRAK::OV01;STBLDgm=;ShowNotes=0;VisibleAttributeDetail=0;
ShowOpRetType=1;SuppressBrackets=0;SuppConnectorLabels=0;PrintPageHeadFoot=0;ShowAsList=0;

My SQL / JET SQL code is a bit rusty but clearly the ideal would be able to search for the beginning of the MDGDgm string and then extract the 4 character substring containing the custom diagram type.
======
Favourite epitaph: 'Under this sod lies another'

TRAK Framework https://sf.net/p/trak
MDG for TRAK https://sf.net/p/mdgfortrak

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to Extract Custom View Types in a Query
« Reply #5 on: November 03, 2009, 10:45:41 pm »
I guess that would be the ideal situation, but I think you can get a long way with the regular "Like" operator.
Something like
Code: [Select]
select * from t_diagram
where typeEx like '%MDGDgm=TRAK::%'
Should give you all the diagrams from the custom "TRAK" mdg.

Only if you also want to show the specific type as a result you'll need some nifty substring command.

Geert

wikitect

  • EA User
  • **
  • Posts: 117
  • Karma: +2/-0
    • View Profile
    • TRAK Community
Re: How to Extract Custom View Types in a Query
« Reply #6 on: November 03, 2009, 11:43:47 pm »
Thanks.

Unfortunately that is exactly what I'm going to have to do otherwise the view type will be lost in the verbiage.

I'm hoping that there is some systematic order and that the substring always appears at the same point. It probably means something like a subquery that returns the substring to the main query. It's been many years since I looked at this sort of a query and MySQL/JET will have different ways of achieving this.
======
Favourite epitaph: 'Under this sod lies another'

TRAK Framework https://sf.net/p/trak
MDG for TRAK https://sf.net/p/mdgfortrak

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to Extract Custom View Types in a Query
« Reply #7 on: November 03, 2009, 11:57:15 pm »
Good luck with that  :-/
I'm happy we are using SQL-Server so I don't have to use the messed up MS Access SQL syntax.

Geert