Book a Demo

Author Topic: Showing attributes in a diagram  (Read 7860 times)

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Showing attributes in a diagram
« on: June 04, 2024, 11:48:11 pm »
I have an existing diagram containing elements that is refusing to change its behaviour after changing a number of settings.

Originally, the diagram was configured not to show attributes or inherited attributes. It also contains a number of classes stereotyped through MDG with the following feature visibility settings: public attributes = true, private attributes = false.

Changing the diagram setting to show attributes results on no attributes displayed. Converting 1 element into a vanilla class - i.e., not stereotyped class - also results on no attributes being displayed.

What am I missing?

P.S.: Sparx EA is version 16.1.1628 (64-bit).
P.S. 2: All attributes are public.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Showing attributes in a diagram
« Reply #1 on: June 04, 2024, 11:51:45 pm »
I would simply create a new diagram and copy the contents there

Geert

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Showing attributes in a diagram
« Reply #2 on: June 04, 2024, 11:55:11 pm »
I was hoping for a less laborious answer. This is not just one diagram, there are several with the same problem.

ea0522

  • EA User
  • **
  • Posts: 134
  • Karma: +5/-0
    • View Profile
Re: Showing attributes in a diagram
« Reply #3 on: June 04, 2024, 11:57:31 pm »
Did you check the type of the diagram?
Some diagam types have specific features.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Showing attributes in a diagram
« Reply #4 on: June 05, 2024, 12:12:18 am »
There must be a reason why it isn't showing attributes. Create a second diagram of the same type, and start comparing.

Geert

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Showing attributes in a diagram
« Reply #5 on: June 05, 2024, 02:29:18 am »
Well, the exercise suggested by Geert has revealed some very interesting Sparx EA behaviour.

Step 1 - Create a new diagram with the same content but with attributes visible - i.e., a simple class diagram. Result got the same behaviour.
Step 2 - Add a UML class to this diagram. Result the attributes appear in the diagram for the new class.
Step 3 - Revert the original elements to an out-of-the box class, UML class, by removing the MDG stereotype. Result the attributes for these elements do not show.
Step 4 - Remove 1 element from the diagram, after double checking it is now a non stereotyped UML class, save and close the diagram, reopen the diagram again and add the removed element, the attributes appear.


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Showing attributes in a diagram
« Reply #6 on: June 05, 2024, 08:35:32 am »
Check the per object visibility settings (Ctrl+Shift+Y)

Check if your stereotype is shape scripted, if it is, see if it offers the option for rectangle notation.

Check if your stereotype defines _AttInh, _AttPkg, _AttPri, _AttPro, and _AttPub. (See https://sparxsystems.com/enterprise_architect_user_guide/16.1/modeling_frameworks/supportedattributes_2.html)

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Showing attributes in a diagram
« Reply #7 on: June 07, 2024, 12:35:10 am »
Check the per object visibility settings (Ctrl+Shift+Y)

Check if your stereotype is shape scripted, if it is, see if it offers the option for rectangle notation.

Check if your stereotype defines _AttInh, _AttPkg, _AttPri, _AttPro, and _AttPub. (See https://sparxsystems.com/enterprise_architect_user_guide/16.1/modeling_frameworks/supportedattributes_2.html)
Thank you Eve, object visibility settings are as follows Attribute (Public) False, Attribute (Protected) True, Attribute (Private) False, and Attribute (Package) False. But the MDG defines the feature visibility of the element as follows Attribute (Public) True, Attribute (Protected) Blank, Attribute (Private) False, and Attribute (Package) Blank.

The stereotype is shapescripted as below, and does not offer the option for rectangle notation.
Code: [Select]
shape main{
setpencolor(0,0,0);
setpenwidth(3);
setfillcolor(255,255,255);
drawnativeshape();
}


Disabling the "Show Shape Scripts" under Diagram Properties\Elements does not have an impact on how attributes are displayed for this stereotype.


The  stereotype does not define any of the following _AttInh, _AttPkg, _AttPri, _AttPro, and _AttPub.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Showing attributes in a diagram
« Reply #8 on: June 07, 2024, 09:00:52 am »
Attribute (Public) False
This is overriding all of the other settings.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Showing attributes in a diagram
« Reply #9 on: June 07, 2024, 07:02:08 pm »
Attribute (Public) False
This is overriding all of the other settings.
I get that but where does it come from, it is not part of the stereotype definition.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Showing attributes in a diagram
« Reply #10 on: June 11, 2024, 09:03:05 am »
I get that but where does it come from, it is not part of the stereotype definition.
I would have assumed it was set by a user.

Originally, the diagram was configured not to show attributes or inherited attributes.
But maybe you're just expecting a change to that option in your technology to be updated dynamically instead of setting values during creation.
« Last Edit: June 11, 2024, 05:25:53 pm by Eve »

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Showing attributes in a diagram
« Reply #11 on: June 18, 2024, 09:13:23 pm »
Since all elements with that particular stereotype and diagrams containing them are affected, I am suspecting that the technology is responsible for this. If this is the case, there could be an issue with Sparx EA v17 because in the technology this stereotype is set with  public attributes = true, private attributes = false and somehow this gets reversed.