[ATL] execution order and UML profiles [message #537185] |
Tue, 01 June 2010 10:56  |
Eclipse User |
|
|
|
Hello,
I have a transformation that copies UML elements and adds stereotypes to some elements. In the do-block of the rule to copy uml::Model elements I apply the profile containing the stereotypes. Unfortunately some other rules (matched rules for elements contained in the uml::Model) are called before the profile gets applied. So I cannot apply stereotypes in the matched rules, because the profile is not applied yet. I tried to walk up the containment hierarchy (from the contained element up to the uml::Model) to apply the profile in the rule for the contained element, but it seems the container-attribute is not set at the time the do-block is executed.
So how can I ensure, a profile is applied BEFORE a subsequent matched rule is called? Or is that impossible?
Thanks in advance,
Max
|
|
|
|
|
|
|
Re: [ATL] execution order and UML profiles [message #537503 is a reply to message #537389] |
Wed, 02 June 2010 12:34   |
Eclipse User |
|
|
|
Sylvain EVEILLARD wrote on Wed, 02 June 2010 12:44 | To manage profiles and stereotypes, you can alternatively use the Ecore definition of profiles instead of the UML one.
To do this, you create a fake metamodel that makes the "sum" of UML2 and all your profiles. To do this you just create a fake EClass that inherits from one EClass of UML2 and one EClass of each profile.
You then use this metamodel as metamodel of the transformation. This will then allow you to apply stereotypes by creating instances of the stereotype metaclass :
t : UML2!MyStereotype(
base_Class <- u
)
Tagged Values are then attributes of the instances :
t : UML2!MyStereotype(
base_Class <- u,
myTaggedValue <- 'myValue'
)
I find that solution much clearer than the use of UML2 APIs in the transformation plus it might solve your problem.
|
Hi all,
can you please explain your idea more, actually I hope to use my profile as metamodel with the UML metamodel
and this trick will escape many checks for stereotype and will use the stereotype as a type, which is the desired solution,
please Sylvain I need you help if you do not mind
[Updated on: Wed, 02 June 2010 12:36] by Moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.85500 seconds