[solved] getApplicableStereotypes() is empty [message #1798464] |
Mon, 19 November 2018 14:37 |
Jan Vlug Messages: 5 Registered: November 2018 |
Junior Member |
|
|
I try to apply a UML profile programatically to a UML model.
I load the model and profile, apply the profile to the model.
Next I get all packages of the model and try to get the applicable stereotypes for the packages.
But the call:
pack.getApplicableStereotypes();
returns always an empty list.
Do you have any idea why I do not get the list of applicable stereotypes?
I attached my example code and the UML profile and UML model that I am using.
[Updated on: Thu, 22 November 2018 07:59] Report message to a moderator
|
|
|
Re: getApplicableStereotypes() is empty [message #1798496 is a reply to message #1798464] |
Mon, 19 November 2018 21:22 |
|
Hi,
The getApplicableStereotypes() operation computes, for any element, the stereotypes that are available in applied profiles that extend the element's metaclass, that are not yet applied to it.
So, in your case, do you (a) have in any applied profile any stereotypes that extend the Package metaclass (because you're asking a package for its applicable stereotypes) and (b) that package does not already have all stereotypes applied to it that can be applied? Note that a stereotype that is already applied to an element is not applicable, because stereotypes cannot be applied more than once.
HTH,
Christian
|
|
|
|
Re: getApplicableStereotypes() is empty [message #1798560 is a reply to message #1798498] |
Tue, 20 November 2018 12:59 |
|
Looking into the profile attached to the original post, I see that the only stereotypes that extend any kind of package metaclass are ODService and ODAnnotations, which both extend the Model metaclass. So, it's no surprise that Packages that are not Models do not have any applicable stereotypes.
HTH,
Christian
|
|
|
|
Powered by
FUDForum. Page generated in 0.03223 seconds