Book a Demo

Author Topic: Search SQL Query - Composite Diagram  (Read 7068 times)

E.Eckstein

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Search SQL Query - Composite Diagram
« on: July 22, 2015, 11:21:46 pm »
Hi there,

I am working in EA 10 right now and I have an request for a special search.

To make it easier to understand I'll first describe what is in the model.

So we have a diagram with an element e1. This element e1 has an composite diagram c1. In this diagram c1 there is a link to e1 and some other linked objects o1-o10 some of the attributes a1-a3 of these objects o1-o10 are linked into (or out of) the e1.

We do this in this kind of way, because we don't want do define (sometimes) hundreds of parameters (in/out) for elements like e1.

Well now it's time for my search.

I begin with on of the attributes a1.
From this a1, I want to find all elements like e1 that are having this one as incoming or outgoing link.

Well I would know this in a DB I designed myself, but those ea db tables are realy confusing in the way they are designed.
e.g. I can't find a table where a the composite diagram of an object is stored.

So what I like to know: Is there a "nearly" complete EA db-schema somewhere? Or what is the easiest way to find how those elements are related?`

Maybe is there a table where "link" uses of objects are hold.
 ::)
Best regards and thanks,
Eric

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Search SQL Query - Composite Diagram
« Reply #1 on: July 23, 2015, 12:55:22 am »
Hi,

The tables to look at are t_object, t_diagramobjects, t_diagram and t_connector.

All elements on a given t_diagram can be found by joining

t_diagram.diagram_id = t_diagramobjects.diagram_id
and t_object.object_id = t_diagramobjects.object_id

If a t_object has a composite its ntype = 8 and pdata1 is the t_diagram.diagram_id of the composite diagram.

t_connector.start_object_id and t_connector.end_object_id join to t_object.object_id

Hope that helps.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Search SQL Query - Composite Diagram
« Reply #2 on: July 23, 2015, 03:08:44 am »
The only documentation of the table can be found in my Inside book (see below).

Actually an embedded diagram is just a diagram found in t_diagram (and the element having it as embedded has some flag set).

How have you linked the attributes? I guess with Advanced/Link to Feature. If so the info is in t_connector.styleex. You might write a SQL but I'd prefer a script since it involves quite some text operation.

q.
« Last Edit: July 23, 2015, 03:09:13 am by qwerty »

E.Eckstein

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: Search SQL Query - Composite Diagram
« Reply #3 on: July 23, 2015, 04:34:05 pm »
Thank you guys,
this was realy helpful and saved me a lot of wasted time.

@qwerty: Yes the users will use the "link to feature" functionality of the connectors.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Search SQL Query - Composite Diagram
« Reply #4 on: July 23, 2015, 07:55:17 pm »
Quote
LF<dir>P=<guid><pos>; connector is attached to attribute/operation
<dir> = S or E meaning Start (source) or End (target) <guid> = ea_guid of t_attribute or t_operation
<pos> = R if <dir> == S or L if <dir> == E
<pos> is obviously redundant...
There can be one LFSP, one LFEP or both be present in one StyleEx property
about the StyleEx of t_connector; from my Inside book

q.