[ATL]UML Transformation [message #70369] |
Thu, 03 January 2008 20:59  |
Eclipse User |
|
|
|
Originally posted by: heiyuchuanxia.163.com
Hi, I'm confused with a question of using ATL transforming UML to some
PSM model. I want to development a MDA software for business process,
and want to realize this using model transformation.
My problem is: now I define some uml profiles to add platform specific
information to uml diagrams, and since ATL transformation rule is
defined using metamodel (or at the metamodel level, I use eclipse UML2
as the uml metamodel ), how can i confirm those stereotype (defined in
the profile) is applied to some of the model, and how can I get the
values of those properties defined in the stereotype.
More a example to explain my question: I plan to mapp a
CallOperationAction applied a stereotype <<Invoke>> to a invoke element
in the process, and the stereotype <<Invoke>> defines several
properties to add more platform specific information to the
CallOperationAction. Now, can I determine a CallOperationAction applied
<<Invoke>> or not? When it applied, can I tranform the properties
defined in the stereotype to my invoke element with the properties of
CallOperationAction?
Should I using two metamodel input in this transformation, one is the
uml metamodel, the other is the profile?
Thank you very much for caring about my question, I'm appreciated if you
reply me some way to solve this question.
Stefanie
|
|
|
|
|
Re: [ATL]UML Transformation [message #70728 is a reply to message #70603] |
Tue, 08 January 2008 03:24  |
Eclipse User |
|
|
|
Hi Stefanie, you have to import the profile as metamodel if you want to
apply some stereotype to your output elements.
This is the header of a sample transformation from profile A to profile B:
module moduleName;
create OUT : UML2 from IN : UML2, PRO : UML2;
IN and OUT are the UML2 metamodel and PRO is the .uml definition of
profile B.
The following is a rule that matches a stereotyped UML Component and
generates a stereotyped UML Class:
rule comp2class{
from
s : UML2!Component
(
s.isStereotypeApplied('<stereotypeName>') )
to
t : UML2!Class(
-- bindings
)
do {
t.applyStereotype(<here you put the Stereotype definition contained in
PRO>);
t.setValue(<Stereotype definition contained in PRO>, '<propertyName>',
<propertyValue>);
}
}
helper context UML2!Element def: isStereotypeApplied(name : String) :
Boolean =
not self.getAppliedStereotypes()->select(p |
p.name = name
).isEmpty();
This is how I tackled the problem of applying stereotypes to UML elements
and set the values of UML Tagged values.
I hope this will be useful, regards
Ivano
|
|
|
Powered by
FUDForum. Page generated in 0.04686 seconds