Book a Demo

Author Topic: Custom MDG: How to set defaultAttributeType to <none>?  (Read 4477 times)

Jacob Vos

  • EA User
  • **
  • Posts: 108
  • Karma: +0/-0
    • View Profile
Custom MDG: How to set defaultAttributeType to <none>?
« 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?
« Last Edit: December 24, 2021, 02:29:43 am by Jacob Vos »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Custom MDG: How to set defaultAttributeType to <none>?
« Reply #1 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.

Jacob Vos

  • EA User
  • **
  • Posts: 108
  • Karma: +0/-0
    • View Profile
Re: Custom MDG: How to set defaultAttributeType to <none>?
« Reply #2 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.