Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Jacob Vos on December 24, 2021, 02:23:41 am

Title: Custom MDG: How to set defaultAttributeType to <none>?
Post by: Jacob Vos on December 24, 2021, 02:23:41 am
When you add an attribute to an element and manually type '<none>' as type, then the attribute type will be blank. So I thought to arrange that in a custom MDG by adding '_defaultAttributeType' with the initial value '<none>'.

The MDG file has now:
defaultAttributeType="&lt;none&gt;"

However, when adding an attribute, the type is still 'int'.

Who knows the solution?
Title: Re: Custom MDG: How to set defaultAttributeType to <none>?
Post by: qwerty on December 24, 2021, 06:43:51 am
Report a bug. According to the help this should work.

Maybe you could try applying an empty string instead.

q.
Title: Re: Custom MDG: How to set defaultAttributeType to <none>?
Post by: Jacob Vos on January 05, 2022, 05:46:59 pm
I found that the behavior of this functionality is different than I expected. Because it only works when dragging a custom defined attribute type from my own MDG toolbox to a class.

(In the UML Profile, I wrongly defined _defaultAttributeType at a stereotype that extends the metaclass Class, expecting that when adding an attribute to a class with that stereotype, that default attribute type would be used. However, after closer reading I know now that _defaultAttributeType has to be set at a stereotype that extends the metaclass Attribute.)

When adding a new attribute to the list of attributes of a class, before you can fill in the stereotype of it, EA filled the 'Type' with 'int'. So when adding attributes in that way, it doesn't make sense to set _defaultAttributeType.