Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: Palm on January 16, 2020, 08:59:15 pm
-
Hi,
A similar question was posted some years ago, but as I understand it, not answered.
I want to extend the abstract metaclass EnumerationLiteral as a specific stereotype with tagged values. This does not seem to work. It works for core elements but as I understand not for the Abstarct Metatypes. Is this a correct assumption? What should I do to make it work? That is, how to extend the Abstract Metaclass EnumerationLiteral?
Thanks,
Paul
-
Are you sure EnumerationLiteral is an Abstract metatype?
I wouldn't know any concrete sub-meta-classes of this type.
Geert
-
It is mentioned as an abstract metatype in the extend Metaclass window:
(http://)
-
I think EnumerationLiteral should not be in that list, but that doesn't mean it shouldn't work.
I haven't extended an abstract metaclass yet, but I guess it should work just the same.
Have you tried to change from EnumerationLiteral to Attribute, just to see if that works?
When developing MDG's there's a ton of things that can break it. In most cases it just silently fails to do anything, and it's up to you to figure out what's wrong by trial and error.
Geert
-
I think EnumerationLiteral should not be in that list, but that doesn't mean it shouldn't work.
I haven't extended an abstract metaclass yet, but I guess it should work just the same.
Have you tried to change from EnumerationLiteral to Attribute, just to see if that works?
When developing MDG's there's a ton of things that can break it. In most cases, it just silently fails to do anything, and it's up to you to figure out what's wrong by trial and error.
Geert
(My emphasis) As I experienced over a few fruitless hours yesterday. This is SO infuriating. "I know what's wrong! But why should I tell you, poor punter?"
Paolo
-
Have you tried to change from EnumerationLiteral to Attribute, just to see if that works?
Years earlier we had done that - use Attribute as the base metaclass which our stereotype for enumeration literals extends. But when I look at it today, I wonder why we did that - an enumeration literal is not an attribute, it's a literal which is a totally different kind of thing, and it's totally unrelated in the UML metamodel and in realisations in code. About the only similarity I can see is a that adding a literal to an enum in a UML diagram is a bit like adding an attribute to a class. However I cannot see any suitable EA metaclass to choose as the base for a stereotype for enumeration literals.
-
Years earlier we had done that - use Attribute as the base metaclass which our stereotype for enumeration literals extends. But when I look at it today, I wonder why we did that - an enumeration literal is not an attribute, it's a literal which is a totally different kind of thing, and it's totally unrelated in the UML metamodel and in realisations in code. About the only similarity I can see is a that adding a literal to an enum in a UML diagram is a bit like adding an attribute to a class. However I cannot see any suitable EA metaclass to choose as the base for a stereotype for enumeration literals.
I agree, it should not be necesarry.
However I suspect EA has internally implemented literals as a type of attributes.
You could try to send in a bug report about this, but I'm not sure if the response won't be "it's a feature, not a bug".
Geert
-
For what it's worth (maybe for others with the same problem), we have solved it by extending "Element" instead of "EnumerationLiteral". Not ideal, I know, since the stereotype is then applicable to all model elements, not just to enumeration literals, but it works. Extending EnumerationLiteral still does not work as expected in EA 16.1.
Johannes