Author Topic: Repository Schema ER diagram  (Read 767 times)

ngong

  • EA User
  • **
  • Posts: 269
  • Karma: +1/-2
    • View Profile
Repository Schema ER diagram
« on: January 25, 2023, 10:26:53 pm »
Is there a kind of ER diagram about the schema of the model repository?
I am currently trying to do an SQL query about the relation of a connector in a State Chart to a Trigger. I found the Tigger name in the PDATA1 field of the connector. However that may not be unique. I could not identify the Tigger Object_ID related to the Connector_ID in any other table.
Rolf

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12782
  • Karma: +532/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Repository Schema ER diagram
« Reply #1 on: January 25, 2023, 10:51:22 pm »
You can simply reverse engineer EA's database using EA.

For anything else, see Q.'s inside book: https://leanpub.com/InsideEA

Geert

PS. I love how you misspelled "Tigger". Makes me instantly think of Winnie the Pooh :)

wivel

  • EA User
  • **
  • Posts: 214
  • Karma: +12/-1
  • Driven by Models
    • View Profile
Re: Repository Schema ER diagram
« Reply #2 on: January 26, 2023, 12:17:50 am »
PS. I love how you misspelled "Tigger". Makes me instantly think of Winnie the Pooh :)

Made me giggle too  :)

Henrik

philchudley

  • EA User
  • **
  • Posts: 719
  • Karma: +19/-0
  • UML/EA Principal Consultant / Trainer
    • View Profile
Re: Repository Schema ER diagram
« Reply #3 on: January 26, 2023, 02:05:33 am »
I suspect that Trigger objects are located within the t_object table with t_object.Name matching the value PDATA1 in the t_connector. table

So a join using t_object and t_connector on t_object.Name and t_connector.PDATA1 restricting t_object to t_object.Object_Type to 'Trigger' and t_connector.Connector_Type to 'StateFlow'

Should do the trick.

Phil
follow me on Twitter

@SparxEAGuru

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12782
  • Karma: +532/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Repository Schema ER diagram
« Reply #4 on: January 26, 2023, 02:08:15 am »
I suspect that Trigger objects are located within the t_object table with t_object.Name matching the value PDATA1 in the t_connector. table

So a join using t_object and t_connector on t_object.Name and t_connector.PDATA1 restricting t_object to t_object.Object_Type to 'Trigger' and t_connector.Connector_Type to 'StateFlow'

Should do the trick.

Phil
I can't believe you should join based on the name.
That would mean that, if you change the name of the trigger, the link is lost?

I'll have a look...

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12782
  • Karma: +532/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Repository Schema ER diagram
« Reply #5 on: January 26, 2023, 02:17:06 am »
The link from t_connector to the trigger in t_object is stored in t_xref

Code: [Select]
select os.Name as StartState, c.Name as transitionName, oe.Name as EndState, o.Name as TriggerName
from t_connector c
inner join t_xref x on x.Client = c.ea_guid
and x.Behavior = 'trigger'
inner join t_object o on o.ea_guid = x.Description
inner join t_object os on os.Object_ID = c.Start_Object_ID
inner join t_object oe on oe.Object_ID = c.End_Object_ID
where c.ea_guid = '{670E1D8D-9913-4dcc-8E27-78138DE5939E}'

Geert