Book a Demo

Author Topic: Relationhip matrix order with custom SQL  (Read 5696 times)

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Relationhip matrix order with custom SQL
« on: November 08, 2019, 04:12:01 am »
Hello

I have a relationship matrix with a selected package as the target, and a custom SQL in the source
The custom SQL sorts elements by Alias

Code: [Select]
select t_object.ea_guid AS CLASSGUID, t_object.Object_Type as CLASSTYPE, t_object.Name
from t_object
where t_object.Package_ID in (<Search Term>) ORDER BY t_object.Alias

Unfortunately the order in the Matrix does not match results in the Find in Project.

Is it a bug?
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Relationhip matrix order with custom SQL
« Reply #1 on: November 12, 2019, 10:44:47 am »
I think EA only gets the list of elements from your SQL. There's no attempt to match the order returned from the SQL.

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Relationhip matrix order with custom SQL
« Reply #2 on: November 12, 2019, 10:50:59 pm »
Hi Eve,

Thank you for your reply. It could be useful if it's supported it in the future.


Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


billf62

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Relationhip matrix order with custom SQL
« Reply #3 on: November 15, 2019, 10:08:19 am »
I don't know if it's a different in nomenclature, but I'm able to get a sorted list in my relationship matrix by using ORDER BY <column nbr>

Example:

SELECT
   objstart.ea_guid AS CLASSGUID,
   objstart.Object_Type AS CLASSTYPE,
   objstart.Name as [Start Name],
   objstart.Object_Type as [Start Type],
...
 
ORDER BY
   3

Hope this helps

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Relationhip matrix order with custom SQL
« Reply #4 on: November 15, 2019, 10:10:52 am »
I suspect you'll find that if you sort by a column other than the name it won't work. It's just that EA happens to be sorting by the name anyway.

HLidstrom

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Re: Relationhip matrix order with custom SQL
« Reply #5 on: November 22, 2019, 06:28:23 am »
I would like to propose an matrix improvement. (Irrespective of SQL)

I'd like to see a Don't Sort option, i.e., just list in the order the elements appear in the browser, with child elements indented.


I would also like to see a Frequency Sort option, i.e. the more relationships, the higher up and further to the left for an element. I have found this very useful in another tool.


Thanks,
- Håkan

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Relationhip matrix order with custom SQL
« Reply #6 on: November 22, 2019, 10:24:54 am »
I would like to propose an matrix improvement. (Irrespective of SQL)

I'd like to see a Don't Sort option, i.e., just list in the order the elements appear in the browser, with child elements indented.
 would also like to see a Frequency Sort option, i.e. the more relationships, the higher up and further to the left for an element. I have found this very useful in another tool.


Thanks,
- Håkan
Then, Håkan,
You'd better put in a feature request using one of the links at the bottom of the page.  If you do so, there is a theoretical possibility that your request may reach planet Sparx and be considered.  Without it, there is a non-zero, but a vanishingly small, possibility it might be considered.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Relationhip matrix order with custom SQL
« Reply #7 on: November 22, 2019, 02:55:29 pm »
I'd like to see a Don't Sort option, i.e., just list in the order the elements appear in the browser, with child elements indented.
Project browser sort is probably the hardest. It depends on a number of user options, explicit re-ordering and dynamic sorting. It's certainly not Don't Sort.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Relationhip matrix order with custom SQL
« Reply #8 on: November 22, 2019, 08:00:38 pm »
I'd like to see a Don't Sort option, i.e., just list in the order the elements appear in the browser, with child elements indented.
Project browser sort is probably the hardest. It depends on a number of user options, explicit re-ordering and dynamic sorting. It's certainly not Don't Sort.
Project Browser sort is difficult because of the way it is implemented and the little control we have over it.

In my simple mind, there are 2 types of sorts
  • alphabetical (either ascending or descending)
  • custom
With regards to the later, it would be great to have a sort order field that can be manually overridden. In other words, it will be nice if the sort order is persisted (it may already be), were visible and editable through the UI, and could be changed using some old fashion typing.

In general, sort in Sparx is a nightmare. For example, if I select Sort Axis on a matrix it sorts the elements in alphabetical (descending order). If I don’t sort a matrix it sorts it in alphabetical ascending order. So, in Sparxian Sort Axis = Alphabetical (descending), go wonder. None of the matrix sorts take into consideration the package names, just the element names. I can keep going on (and sorry for the rant).

Going back to the OPs question, if Sort Axis is disabled Sparx could order elements as per your SQL statement, I am not sure, or revert to alphabetical order.

P.S.: All observations based primarily on v13 but will try with v15 later.