Book a Demo

Author Topic: Can't focus on finding conveyed items on connectors in SysML IBD diagrams?  (Read 3265 times)

Colin Coates

  • EA User
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
Happy New Year!

I have the following SQL query (for Microsoft SQL Server) that will find conveyed signal items on connectors in SysML IBD diagrams:

Code: [Select]
select ea_guid as CLASSGUID, Connector_Type as CLASSTYPE, 't_connector' as CLASSTABLE, *
from t_connector
where ea_guid in (
select x.Client from t_xref as x
join t_object as o
on x.Description like concat('%', o.ea_guid,'%')
where x.type = 'connector property'
and x.Behavior = 'conveyed'
and o.Object_Type = 'Signal');

This is quite handy, so I want to make a query that works within a search folder inside the Focus window... I modified the query as follows:

Code: [Select]
select ea_guid as CLASSGUID, Connector_Type as CLASSTYPE, 't_connector' as CLASSTABLE, isnull(Name,'NO_NAME') as Name   
from t_connector
where ea_guid in (
select x.Client from t_xref as x
join t_object as o
on x.Description like concat('%', o.ea_guid,'%')
where x.type = 'connector property'
and x.Behavior = 'conveyed'
and o.Object_Type = 'Signal');

I added
Code: [Select]
isnull(Name,'NO_NAME') as Name to the query so that there is always something to click in the returned result set, even if the connector is nameless.

Unfortunately, "Find in diagrams" is greyed out for the rows returned in the Focus search result set. Can anyone suggest what I have done wrong (or might this be a bug)?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
I don't think you can use "Find in Diagrams" for connectors in the search window.
Whether or not you consider that a bug is up to you.

Geert

BobM

  • EA User
  • **
  • Posts: 144
  • Karma: +9/-0
    • View Profile
As Geert mentioned before you need to add either source object or target object to the search query (or both) to find the connector

a bit of scribbling but you get the point:

Code: [Select]
SELECT
, t_connector.*
, SOURCE = os.Name
, TARGET = ot.Name
FROM t_connector
LEFT JOIN t_Object os ON Start_Object_ID = os.OBJECT_ID
LEFT JOIN t_Object ot ON End_Object_ID = ot.OBJECT_ID

resulting in final code:
Code: [Select]
SELECT
ClassGUID = c.ea_guid
,ClassType = c.Connector_Type,
,ClassTable = 't_connector'
,Name = ISNULL(c.Name,'NO_NAME')
,Source = os.Name
,Target = ot.Name

FROM t_connector c
LEFT JOIN t_Object os ON c.Start_Object_ID = os.OBJECT_ID -- There is no difference between the INNER and OUTER join in this statement but it is used for semantic reason
LEFT JOIN t_Object ot ON c.End_Object_ID = ot.OBJECT_ID -- There is no difference between the INNER and OUTER join in this statement but it is used for semantic reason

WHERE c.ea_guid IN (
SELECT x.Client
FROM t_xref x
LEFT JOIN t_object o ON x.Description LIKE CONCAT('%',o.ea_guid,'%')
WHERE x.type = 'connector property'
AND x.Behavior = 'conveyed'
AND o.Object_Type = 'Signal');
when you find in diagram it will find the connector you desire to find

Edit: added the final code which you required
« Last Edit: January 04, 2023, 02:16:50 am by BobM »

Colin Coates

  • EA User
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
Thanks for your suggestion BobM; I translated it into the following query:

Code: [Select]
select
c.ea_guid  as CLASSGUID,
c.Connector_Type as CLASSTYPE,
't_connector' as CLASSTABLE,
ISNULL(c.Name,'NO_NAME') as ConnectorName,
os.Name as Source,
ot.Name as Target
from t_connector as c
left join t_Object as os
on c.Start_Object_ID = os.OBJECT_ID
left join t_Object ot
on c.End_Object_ID = ot.OBJECT_ID
where
c.Connector_Type = 'InformationFlow'
and c.ea_guid in (
select x.Client
from t_xref x
left join t_object o
on x.Description LIKE CONCAT('%',o.ea_guid,'%'));

Unfortunately, it still results in the same issue.

The thing is that this query does the right thing in a custom SQL query but does not work as a Focus window custom query. I have logged it as a bug, although maybe some people will choose to regard it as an enhancement... :-D

Takeshi K

  • EA User
  • **
  • Posts: 632
  • Karma: +43/-1
    • View Profile
    • Sparx Systems Japan
[AD]

Hello Colin,

Our Add-in ElementUsageEx can show this case and more other cases related to SysML models.

If you are interested in this case of trace, please try our Add-in.
https://www.sparxsystems.jp/en/trace/
--
t-kouno