Book a Demo

Author Topic: Get signal names of all the signals connected to a specific block  (Read 4237 times)

aljazjelen

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Hi everyone,

First I would like to say thank you for accepting me in the community ;)
So, I am not an expert on EA/databases, however I can script with python quite well.

Recently I made a model, where classes are connected via information flow signals. Each signal has one or many names (Information Items Conveyed...).
Now, since the model is getting more and more complex, I would like to track the signal connection/usage between diagrams.
I figured out, one way could be that I export XMI and run a python script to look for signal names and obtain "target" and "sources" and save everything externally (in a CSV for example).
However... I am pretty sure there is better way, something with SQL querries?

Is there such a simple way?

Thanks!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Get signal names of all the signals connected to a specific block
« Reply #1 on: April 09, 2020, 05:56:47 pm »
The easiest way would be to write a query to get the information from the database.
If you search this forum you should find quite a few topics on how to query information items conveyed.

The advantage is that such an SQL Query can be executed from the search window and will return the desired result in less than a second.
export to xmi + execute a python script is much less convenient and a lot slower.

Geert

aljazjelen

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Get signal names of all the signals connected to a specific block
« Reply #2 on: April 09, 2020, 06:53:15 pm »
Hi Geert, thanks for the feedback.

I have already gone through the forum and found a topic which could help me most. However I would need a hand with a following SQL:
Code: [Select]
select Connector_ID, Direction, Connector_Type, t_object.Name as "Obj-Name", so.name as "Start-Name", eo.name as "End-Name"
from t_connector, t_xref, t_object, t_object so, t_object eo
where t_xref.Client = t_connector.ea_guid and t_xref.description LIKE '#WC#'+t_object.ea_guid+'#WC#' and so.object_id = Start_Object_ID and eo.object_id = End_Object_ID and t_object.name LIKE '<Search Term>'

I added this in the SQL Scratch Pad (in the "search window"), however it yields no results.

What could be an issue?

Regards,
Aljaz

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Get signal names of all the signals connected to a specific block
« Reply #3 on: April 09, 2020, 07:00:20 pm »
Not sure, that's not one of my SQL searches
Are you filling in the name in the search term window?
If not you can remove the and t_object.name LIKE '<Search Term>' part

Geert

aljazjelen

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Get signal names of all the signals connected to a specific block
« Reply #4 on: April 09, 2020, 09:01:49 pm »
Hi Geert!

Thank you so much for pointing it out. I played a bit around and your solution got me in the right direction :)

I have however last issue in my recent roller-coaster. Lets say, for an example, I only want to querry the connections within selected package.
I digged around a bit and came to idea to add another condition, modifying existing statement from:
Code: [Select]
where t_xref.Client = t_connector.ea_guid and t_xref.description LIKE '#WC#'+t_object.ea_guid+'#WC#' and so.object_id = Start_Object_ID and eo.object_id = End_Object_ID
to:
Code: [Select]
where t_xref.Client = t_connector.ea_guid and t_xref.description LIKE '#WC#'+t_object.ea_guid+'#WC#' and so.object_id = Start_Object_ID and eo.object_id = End_Object_ID and so.name LIKE 'MY_SELECTED_OBJECT_NAME'
(notice the "and so.name LIKE 'MY_SELECTED_OBJECT_NAME'")

This yields results I wanted, however I would want to "select my object" by clicking on the diagram and then use the querry to get all the relevant searches. I want to avoid to manually type the name of object.
There is for sure some kind of a "pointer" or "selector", from where i could get the name of selected object. Something like "selected.name"?

Best regards,
Aljaz

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Get signal names of all the signals connected to a specific block
« Reply #5 on: April 09, 2020, 09:07:41 pm »
See here: https://sparxsystems.com/enterprise_architect_user_guide/15.1/model_navigation/creating_filters.html

There are a number of macros you can use. I'm guessing you are after #CurrentElementGUID# or #CurrentElementID#

Geert

aljazjelen

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Get signal names of all the signals connected to a specific block
« Reply #6 on: April 14, 2020, 07:54:28 pm »
Hi Geert,

Sorry for taking time to answer.

With your support, I managed to find a work around by using the #CurrentElementGUID.

Topic can be closed.

Regards,
Aljaz