Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Pegasus on January 15, 2019, 01:34:46 am

Title: Relationship Matrix use with "apply Model search" and SQL query (EA 14.1)
Post by: Pegasus on January 15, 2019, 01:34:46 am
Hallo,

in https://www.sparxsystems.com/enterprise_architect_user_guide/14.0/model_navigation/settingsourceandtargetpack.html (https://www.sparxsystems.com/enterprise_architect_user_guide/14.0/model_navigation/settingsourceandtargetpack.html) method 3 describes using model search within relationshsip matrix

I just try to apply model search (target) but do have problem to get a simple self defined example SQL query running, like e.g.
select ea_guid as CLASSGUID, t_object.Object_Type , t_object.Name, t_object.Version from t_object where t_object.Object_Type = "Activity"

not to talk about more complex SQL-queries that results only the latest version of the activities (version number). If I call this from "find in Project" the query works fine

In https://www.sparxsystems.com/forums/smf/index.php/topic,40493.msg247612.html#msg247612 (https://www.sparxsystems.com/forums/smf/index.php/topic,40493.msg247612.html#msg247612) it seems to work, but I get search running only that bases on searches defined in "Query Builder"

Where I'm wrong? short-term recommendations greatly appreciated
Thanks in advance
Pegasus
Title: Re: Relationship Matrix use with "apply Model search" and SQL query (EA 14.1)
Post by: Helmut Ortmann on January 17, 2019, 09:32:19 pm
Hello,

you missed:
t_object.Object_Type as [CLASSTYPE]

You can test your SQL by checking if you can navigate found elements/connectors to Browser or Diagram. For connectors you additional need something like 't_connector as [CLASSTABLE]'. It's all described at https://sparxsystems.com/enterprise_architect_user_guide/14.0/model_navigation/creating_filters.html (https://sparxsystems.com/enterprise_architect_user_guide/14.0/model_navigation/creating_filters.html).

I've tested SQL with Relationship-Matrix and it works. The Script Searches for Relatitionship-Matrixes are currently under investigation by SPARX.

Regards,

Helmut
Title: Re: Relationship Matrix use with "apply Model search" and SQL query (EA 14.1)
Post by: Pegasus on March 07, 2019, 12:04:53 am
Thanks Helmut for feedback,

meanwhile I asked sparx and got following answer
As described on:
https://www.sparxsystems.com/enterprise_architect_user_guide/14.0/model_navigation/settingsourceandtargetpack.html (https://www.sparxsystems.com/enterprise_architect_user_guide/14.0/model_navigation/settingsourceandtargetpack.html)
Custom SQL searches are supported if they are returning elements; the SQL must include ea_guid AS CLASSGUID (case sensitive).

With this little difference query works.
Title: Re: Relationship Matrix use with "apply Model search" and SQL query (EA 14.1)
Post by: Thorn on August 06, 2019, 04:21:40 pm
Hi,

I'm trying to use model search within the relationship matrix. I'm searching all objects, which have specific Tagged value
My select is:
select c.ea_guid as CLASSGUID, c.object_type as CLASSTYPE, c.name as Name, c.alias as Alias, c.stereotype as Stereotype
from (t_object c
inner join t_objectproperties op on op.Object_ID = c.Object_ID)
where op.Property = 'domain'
and op.Value like 'Customer'

I'm able to navigate from the search into Project Browser, but unfortunately it won't retrieve list of objects in Relationship matrix.

I'm using SparX EA Corporate edition version 14.1

Thanks for heplp
Title: Re: Relationship Matrix use with "apply Model search" and SQL query (EA 14.1)
Post by: Geert Bellekens on August 06, 2019, 07:07:59 pm
In some cases EA insists on uppercase AS for "AS CLASSGUID" and "AS CLASSTYPE"

Not sure if this is one of these cases, but I would give it a try.

Geert

Title: Re: Relationship Matrix use with "apply Model search" and SQL query (EA 14.1)
Post by: Thorn on August 09, 2019, 09:01:42 pm
Hi Geert,

thanks, that helped. Solved

Tomas