Book a Demo

Author Topic: SQL Query for Data Objects from Information Flow  (Read 6355 times)

ssands

  • EA User
  • **
  • Posts: 91
  • Karma: +0/-0
    • View Profile
SQL Query for Data Objects from Information Flow
« on: November 19, 2014, 08:35:59 am »
Hi all,

I have been writing queries to report on on model. We have a lot of components. They are often connected with an "Information Flow" and we have attached Data Objects to those flows.

My question is what tables / relationships can I query to get that Info. I haven't been able to figure it out looking at the tables.

And, while I am at it, if I have more than one stereotype on a connector or component, how can I query for that? I can get the first one, I don't see how to get the others.

Thanks!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: SQL Query for Data Objects from Information Fl
« Reply #1 on: November 19, 2014, 10:10:00 am »
Quote
I have been writing queries to report on on model. We have a lot of components. They are often connected with an "Information Flow" and we have attached Data Objects to those flows.

My question is what tables / relationships can I query to get that Info. I haven't been able to figure it out looking at the tables.
This thread should be some help: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1399618995

Regarding multiple stereotypes, they are also saved in t_xref. Start with an empty database, add an element, give it several stereotypes and look in t_xref and you should be able to work it out.
The Sparx Team
[email protected]

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: SQL Query for Data Objects from Information Fl
« Reply #2 on: November 19, 2014, 11:40:59 pm »
A tweaked version of the SQL KP refers to that hopefully meets your requirement:

SELECT CONNECTOR.Name AS Connector_Name,
      CONNECTOR.Stereotype AS Connector_Type,
      CONVEYED.Stereotype AS Conveyed_Type,
      CONVEYED.Name AS Conveyed_Name,
      PRODUCER.Stereotype AS Producer_Type,
      PRODUCER.Name AS Producer_Name,
      CONSUMER.Stereotype AS Consumer_Type,
      CONSUMER.Name AS Consumer_Name
FROM t_xref XCONVEYED, t_object CONVEYED,
      t_object PRODUCER, t_object CONSUMER,
      t_connector CONNECTOR
WHERE XCONVEYED.Behavior='conveyed'
      AND XCONVEYED.Description LIKE '%' + CONVEYED.ea_guid + '%'
      AND CONNECTOR.Start_Object_ID=PRODUCER.Object_ID
      AND CONNECTOR.End_Object_ID=CONSUMER.Object_ID
      AND CONNECTOR.ea_guid = XCONVEYED.Client

ssands

  • EA User
  • **
  • Posts: 91
  • Karma: +0/-0
    • View Profile
Re: SQL Query for Data Objects from Information Fl
« Reply #3 on: November 21, 2014, 04:37:15 am »
Hi! I want to thank both of you for your input. It really helped and I've been able to extract the info I wanted.

I really appreciate your timely responses.

...now, I'm wondering if I shouldn't have tried this in a report instead! Oh well.   :)