Book a Demo

Author Topic: From a Search result set row jumping-to a diagram  (Read 6491 times)

peigee

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
From a Search result set row jumping-to a diagram
« on: November 20, 2015, 09:31:20 am »
I wrote a search using SQL accessing EA repository database to find any broken connectors/relationships under a package (per below). Would like to know what additional result set items need to be included so that when double-clicking a row in the result set, a diagram containing the connector would be opened:

--find broken or mismatching relationships (due to source or target key dropped, renamed or mismatching between key column(s) data type or counts):
select [highlight]c.ea_guid as CLASSGUID, 'Connector' as CLASSTYPE[/highlight], c.sourcerole as "FromConstrName",o1.name as "FromTable", p1.name as "FromPkg", c.destrole as "ToConstrName", o2.name as "ToTable", p2.name as "ToPkg"
from (((t_package p1 inner join t_object o1 on o1.package_id=p1.package_id) left join t_package p12 on p12.package_id=p1.parent_id) left join t_package p13 on p13.package_id=p12.parent_id)
inner join t_connector c on o1.object_id=c.start_object_id inner join t_operation op on op.name=c.sourcerole
inner join t_object o2 on o2.object_id=c.end_object_id inner join t_package p2 on o2.package_id=p2.package_id left join t_package p22 on p22.package_id=p2.parent_id left join t_package p23 on p13.package_id=p22.parent_id  
where o1.stereotype='table' and o2.stereotype='table' and (p12.package_id=8433 or p13.package_id=8433) and (p22.package_id=8433 or p23.package_id=8433)
and (c.sourcerole+','+c.destrole) not in (select cp1.name+','+cp2.name from
(select tt1.name, stuff((SELECT ',' + to1.type FROM t_operationparams as to1 where to1.operationid=tto1.operationid order by to1.pos FOR XML PATH('')),1,1,'') as frmKeyColType
from t_operationparams as tto1, t_operation as tt1 where tto1.operationid=tt1.operationid and tt1.name=c.sourcerole and tt1.object_id=c.start_object_id) cp1,
(select tt2.name, stuff((SELECT ',' + to2.type FROM t_operationparams as to2 where to2.operationid=tto2.operationid order by to2.pos FOR XML PATH('')),1,1,'') as toKeyColType
from t_operationparams as tto2, t_operation as tt2 where tto2.operationid=tt2.operationid and tt2.name=c.destrole and tt2.object_id=c.end_object_id) cp2
where cp1.frmKeyColType=cp2.toKeyColType);

Is this possible?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: From a Search result set row jumping-to a diag
« Reply #1 on: November 20, 2015, 10:04:52 am »
I guess you can't choose Connector as classtype since it's not an element and can not be navigated. Connectors are only 2nd class citizens in EA :(

Instead try putting one of the ends there which certainly can be navigated.

q.
« Last Edit: November 20, 2015, 10:05:45 am by qwerty »

peigee

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: From a Search result set row jumping-to a diag
« Reply #2 on: November 20, 2015, 10:28:12 am »
If I select t_operation.ea_guid and use 'Operation' as CLASSTYPE, I can get to the one end with the operation property window popped up as you had suggested, but that is not ideal as fixing a broken connector requires seeing both ends.

So not possible of jumping to a diagram if I provide both ends' operations' ea_guid of a connector?

BTW, It appears 'Connector' CLASSTYPE is accepted as the thumbnail in a result set row showing the connector icon when I changed the CLASSTYPE from 'Operation' to 'Connector' (and from operation ea_guid to connector ea_guid).

peigee

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: From a Search result set row jumping-to a diag
« Reply #3 on: November 20, 2015, 11:27:44 am »
I gather, unlike other items, such as elements, attributes and operations etc, there are unique matching property windows that can be opened, while for a connector, its associated diagram(s) may not be unique hence the implementation difficulty for EA.

I hope, as a desirable feature, EA can pop up a relationship dialog window (as one can see when double click a connector in a diagram) when a pair of operations ea_guids are given and with the CLASSTYPE specified as 'Connector'.

So my original post title shall really be changed to '...jumping-to a relationship dialog'.

peigee

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: From a Search result set row jumping-to a diag
« Reply #4 on: November 20, 2015, 03:10:43 pm »
Based on the following webpage description about selecting connector type:
http://sparxsystems.com/enterprise_architect_user_guide/12.1/building_models/creating_filters.html
I have made the change to my SQL, however, double-clicking over the result row goes to no where.

select [highlight]c.ea_guid as CLASSGUID, c.Connector_Type as CLASSTYPE, 't_connector' CLASSTABLE[/highlight], c.sourcerole as "FromConstrName",o1.name as "FromTable", p1.name as "FromPkg", c.destrole as "ToConstrName", o2.name as "ToTable", p2.name as "ToPkg"
from ...

Had anyone tried this?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: From a Search result set row jumping-to a diag
« Reply #5 on: November 20, 2015, 09:44:19 pm »
They use a dbl-quote. Haven't tried that myself.

q.

P.S. Just pasted the example as test and it shows a connector symbol. But of course you can not use it for navigation (see my first reply)
« Last Edit: November 20, 2015, 09:46:16 pm by qwerty »

peigee

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: From a Search result set row jumping-to a diag
« Reply #6 on: November 23, 2015, 08:38:59 am »
In scripts, either single or double quotes can be used for a string value, however, in SQL, only single-quotes can be used for string values, while double-quotes are used for database object names (particularly when containing special characters). Therefore, the online document I had mentioned is incorrect in using the double-quotes for the database table name string 't_connector'.

I believe the document description is intended for the navigation to the connector property dialog (technically very easy to implement), in my case, the connector type is 'Association', therefore a FK constraint dialog should have been popped up.

I noticed the online document is meant for 12.1, while my version of EA is 12.0.1210. I gather the feature may not be available for my version. I hope someone can verify this.