Author Topic: Sort tables in alphabetical order in diagram  (Read 8379 times)

Timobkr

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Sort tables in alphabetical order in diagram
« on: August 22, 2020, 03:28:50 am »
I have quite a number of classes listed in the tree and I would like to generate a diagram of these tables sorted alphabetically.
This seems so obvious that I must be missing something. But I have searched the interface all-over :)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13065
  • Karma: +544/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Sort tables in alphabetical order in diagram
« Reply #1 on: August 22, 2020, 04:03:04 am »
There is nothing obvious about that at all.
I've never had that need, nor did I ever hear about something like that.

Maybe you should look into using the list view instead of a the diagram view.
Different tools for different goals.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8559
  • Karma: +254/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Sort tables in alphabetical order in diagram
« Reply #2 on: August 22, 2020, 09:19:57 am »
Have you tried the "Layout Tools"?  We use them to generate alpha sorted lists of items in a folder.

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

MichaelJ

  • EA User
  • **
  • Posts: 77
  • Karma: +14/-7
    • View Profile
Re: Sort tables in alphabetical order in diagram
« Reply #3 on: August 22, 2020, 08:19:55 pm »
I have quite a number of classes listed in the tree and I would like to generate a diagram of these tables sorted alphabetically.
This seems so obvious that I must be missing something. But I have searched the interface all-over :)
Hi,
There are a few options that you could try:
  • Use the "Box" layout found in the "Diagram Layout" panel and select the "Name (ascending)" for the Sort By option
  • Create a script that sorts the list of classes. You can reference this script either as a runtime script (right-click diagram, [Specialize]->[Scripts]->[xxxxx]) or in your report template
  • Manually move each element around the diagram until they are "sorted"
  • Right-click the diagram and select [Switch View]->[list View]. Then click on the "Name" column to sort
However, my preference is the "Box" layout approach. Simple and quick enough. :-)

[/list]

Timobkr

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Sort tables in alphabetical order in diagram
« Reply #4 on: August 26, 2020, 06:15:42 pm »
Hello everyone,
MichaelIJ, your solution number 1 seems ideal.
> Use the "Box" layout found in the "Diagram Layout" panel and select the "Name (ascending)" for the Sort By option
However, I can't find the sort by ascending functionality. Could you tell me where to find it ?
Kind regards,
Timothée

qwerty

  • EA Guru
  • *****
  • Posts: 13544
  • Karma: +395/-300
  • I'm no guru at all
    • View Profile
Re: Sort tables in alphabetical order in diagram
« Reply #5 on: August 26, 2020, 06:54:53 pm »
In V15 you need to open the Layout Tools window. This is not present in V13.5 (not checked V14).

q.
« Last Edit: August 26, 2020, 09:19:00 pm by qwerty »

MichaelJ

  • EA User
  • **
  • Posts: 77
  • Karma: +14/-7
    • View Profile
Re: Sort tables in alphabetical order in diagram
« Reply #6 on: August 26, 2020, 08:55:07 pm »
...However, I can't find the sort by ascending functionality. Could you tell me where to find it ?...
Sure.
  • Click on "Layout" in the Ribbon
  • Select "Diagram Layout" in "Tools" section
  • Click "Open Diagram Layout Tools" (the Diagram Layout tool window opens)
  • (in the diagram Layout Tool window) Select "Box" from the drop down list
  • Select "Name (Ascending)" from the "Sort By" drop down list

Timobkr

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Sort tables in alphabetical order in diagram
« Reply #7 on: August 27, 2020, 12:41:25 am »
Thanks MichaelIJ!
That works, as I am on v15.1.
Most tables are sorted correctly. However there are a few misteries.
The first class is called CLASSEMENT
Then there is a series of classes with names starting with the word JARDINS (JARDINS_ACCES_..., JARDINS_CATEGORIE_..., etc).
Then another series starting with the characters dvMonu_ (dvMonu_Categorie1, dvMonu_Categorie2, ..., dvMonu_ValeurSite, dvMonu_actualite, dvMonu_note)

So here's the list omitting many items which are correctly sorted :

CLASSEMENT
JARDINS_ACCES_ICOMOS
JARDINS_CATEGORIE_ICOMOS
...
dvMonu_Categorie1
dvMonu_Categorie2
...
dvMonu_TypeThematique
dvMonu_ValeurSite
dvMonu_actualite
dvMonu_note

Any idea why
- J comes before d?
- a of actualite comes before C of Categorie or V of ValeurSite.

APPARENTLY, uppercase and lowercase are sorted separately.
Is there any way to configure EA not to do that?
I see I'm not the only one to wish for a case insensitive sorting.
https://sparxsystems.com/forums/smf/index.php?topic=29124.0
Has this been implemented? I haven't found it yet.
Thanks again to all of you!

qwerty

  • EA Guru
  • *****
  • Posts: 13544
  • Karma: +395/-300
  • I'm no guru at all
    • View Profile
Re: Sort tables in alphabetical order in diagram
« Reply #8 on: August 27, 2020, 02:00:51 am »
It's the collation set in your database. Ask your DBA.

q.

MichaelJ

  • EA User
  • **
  • Posts: 77
  • Karma: +14/-7
    • View Profile
Re: Sort tables in alphabetical order in diagram
« Reply #9 on: August 27, 2020, 08:20:43 am »
...Any idea why
- J comes before d?
- a of actualite comes before C of Categorie or V of ValeurSite.
...
Definitely, the reason for this strange behavior is (as you correctly identified) CASE-SENSITIVE. For example, if "dvMonu_Categorie1" was cased as "DVMONUE_CATEGORIE1", then the Box layout will order the items correctly as you expect. BUT... because "dvMonu_Categorie1" is lowercase, it is sorted after the uppercase "JARDINS_...."

I am not aware of a way to enable case-insensitive sorting. I believe you might need to utilise custom diagram scripts to achieve this.