Hi Jens,
in you example model, the applied stereotype manifests as such an
element:
<UMLsec:Internet xmi:id="_RbsbkAl1EeKqzsm1UJxSIA"
base_CommunicationPath="_EDoDwAiwEeKU97Orryn2zQ"/>
So this is an object of type 'Internet', where this type is
defined in the UML profile. Specifically it is defined like this:
<eClassifiers xmi:type="ecore:EClass"
xmi:id="__wdvF7FCEeCXHfYhNhPYCw" name="Internet">
<eAnnotations xmi:id="__wdvGLFCEeCXHfYhNhPYCw"
source=
"http://www.eclipse.org/uml2/2.0.0/UML"
references="_mlK9gDtJEeCP85Qan380IQ"/>
...
</eClassifiers>
So 'Internet' really is an ordinary EClass. I think, however, it
is not the own that you created when you specified your stereotype
in your UML profile. It is rather *generated* from your profile
description. This process is explained at
http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Introduction_to_UML2_Profiles/article.html
in the section 'Defining Profiles'.
If you look at the 'Internet' EClass above you can see that it has
a UML-eAnnotation which points to some other element. If you look
up the ID of this element, you find in the profile specification:
<packagedElement xmi:type="uml:Stereotype"
xmi:id="_mlK9gDtJEeCP85Qan380IQ" name="Internet">
This is the 'real' stereotype that you created in the first place.
To make a long story short: the UML profile mechanism uses a
somewhat bizarre 'definition' process to make the UML and the
Ecore world compatible (that is at least my guess). I do not see
how you could match and modify stereotypes in a generic way. This
holds for Henshin but also generally. If you want to work with a
stereotype, you have to use it explicitly using the EClass
generated in the definition process. The only way out I see would
be to use reflection -- but that would be a hack.
I am by no means an expert in this area. You could also ask the
Eclipse UML developers for help.
Cheers,
Christian
PS: you have multiple EClass called 'Internet' in you profile.
Could it be that you repeated the definition process a couple of
times? I would expect that you get exactly one EClass for every
Stereotype.
On 11/05/2012 04:21 PM, Jens Bürger wrote: