Author Topic: Relationship Matrix use with "apply Model search" and SQL query (EA 14.1)  (Read 1707 times)

Pegasus

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Hallo,

in 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 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

Helmut Ortmann

  • EA User
  • **
  • Posts: 937
  • Karma: +39/-1
    • View Profile
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.

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

Regards,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Pegasus

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
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
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.

Thorn

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9542
  • Karma: +275/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
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


Thorn

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Hi Geert,

thanks, that helped. Solved

Tomas