Book a Demo

Author Topic: Value of 'Direction' in the database  (Read 7961 times)

MatthiasVDE

  • EA User
  • **
  • Posts: 196
  • Karma: +1/-0
    • View Profile
Value of 'Direction' in the database
« on: April 05, 2017, 08:04:30 pm »
On the label of a connector you can choose the direction so that a litle black arrow appears. Now I want to query that value, but I can't find  that value in the DB.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Value of 'Direction' in the database
« Reply #1 on: April 05, 2017, 08:35:54 pm »
Hi Matthias,

Be careful with that. It's not a global setting for the connector, but a local setting for the connector and diagram. So keeping it consistent between diagrams is difficult impossible.

Since it's an aspect of how a connector is displayed in a diagram, you'll most likely find it in the DiagramLinks object / t_diagramlinks table and probably in a "Style" attribute / column.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Value of 'Direction' in the database
« Reply #2 on: April 05, 2017, 10:13:35 pm »
Ehrm, no. The direction is stored in t_connector.direction

q.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Value of 'Direction' in the database
« Reply #3 on: April 05, 2017, 11:17:10 pm »
Ehrm, no. The direction is stored in t_connector.direction

Not the connector direction. The label direction indicator.
On the label of a connector you can choose the direction so that a litle black arrow appears.

That's in t_diagramlinks.Geometry / DiagramLinks.Geometry, which is a complex property consisting of semicolon-separated property=value pairs. One of these properties is called LMT. LMT is in turn a colon-separated list of subproperty=value pairs, and the subproperty we're after is DIR:
0 for No indicator;
1 for To Destination;
-1 for To Source.

Here's a sample geometry for a connector with a To Source label direction:
Code: (t_diagramlinks.Geometry) [Select]
SX=1;SY=9;EX=1;EY=9;EDGE=2;$LLB=;LLT=;LMT=CX=25:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=-1:ROT=0;LMB=;LRT=;LRB=;IRHS=;ILHS=;
/Uffe
My theories are always correct, just apply them to the right reality.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Value of 'Direction' in the database
« Reply #4 on: April 05, 2017, 11:19:30 pm »
I stand corrected. You are right.

q.

MatthiasVDE

  • EA User
  • **
  • Posts: 196
  • Karma: +1/-0
    • View Profile
Re: Value of 'Direction' in the database
« Reply #5 on: April 05, 2017, 11:21:49 pm »
Ehrm, no. The direction is stored in t_connector.direction

Not the connector direction. The label direction indicator.
On the label of a connector you can choose the direction so that a litle black arrow appears.

That's in t_diagramlinks.Geometry / DiagramLinks.Geometry, which is a complex property consisting of semicolon-separated property=value pairs. One of these properties is called LMT. LMT is in turn a colon-separated list of subproperty=value pairs, and the subproperty we're after is DIR:
0 for No indicator;
1 for To Destination;
-1 for To Source.

Here's a sample geometry for a connector with a To Source label direction:
Code: (t_diagramlinks.Geometry) [Select]
SX=1;SY=9;EX=1;EY=9;EDGE=2;$LLB=;LLT=;LMT=CX=25:CY=13:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=-1:ROT=0;LMB=;LRT=;LRB=;IRHS=;ILHS=;
/Uffe

Thanks!

What's the relation between t_connector and t_diagramlinks?
« Last Edit: April 05, 2017, 11:23:42 pm by MatthiasVDE »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Value of 'Direction' in the database
« Reply #6 on: April 05, 2017, 11:48:59 pm »
A connector is represented once in t_connector for two connected element. t_diagramlinks has individual renderings of this connector per diagram. If there is no entry in t_diagramlinks, EA renders a default appearance. Meanwhile it looks like EA always creates an entry in t_diagramlinks. In former times (IIRC) there was only an entry when you tweaked a connector (add bends, hide it, move labels, etc.).

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Value of 'Direction' in the database
« Reply #7 on: April 08, 2017, 05:13:37 pm »
The problem is that roles can have directions too, so it's not that easy to update a diagram using SQL as you get direction arrows for roles as well.
(I did an experiment a while ago in order to automatically add direction arrows to labels of connectors)
So you'll really have the parse the whole string, figure out which part is for the name of the connector and then add or change the DIR value for that part.

Geert