Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL]UML Transformation
[ATL]UML Transformation [message #70369] Fri, 04 January 2008 01:59 Go to next message
Eclipse UserFriend
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 #70388 is a reply to message #70369] Fri, 04 January 2008 09:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tristan.faure.c-s.fr

Hi !
when you match you match your element in an ATL rule you can add some
condition example
from o : UML!Operation(myCondition)
and it exists the function getAppliedStereotypes()
you can do getAppliedStereotypes()->select(s | s.name = "Invoke")
Re: [ATL]UML Transformation [message #70603 is a reply to message #70388] Mon, 07 January 2008 02:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: heiyuchuanxia.163.com

Hi, Thanks very much, it's really helpful.

But I have another question, can I set the stereotype properties, just
in the same procedure as i set the basic properties of this element. I
need to set some properties defined in the stereotype to refine my PIM
to get a PSM.

Should I import the profile as a metamodel?

Thanks again.



Tristan FAURE 写道:
> Hi !
> when you match you match your element in an ATL rule you can add some
> condition example
> from o : UML!Operation(myCondition)
> and it exists the function getAppliedStereotypes()
> you can do getAppliedStereotypes()->select(s | s.name = "Invoke")
>
>
>
Re: [ATL]UML Transformation [message #70728 is a reply to message #70603] Tue, 08 January 2008 08:24 Go to previous message
Ivano is currently offline IvanoFriend
Messages: 35
Registered: July 2009
Member
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
Previous Topic:[ATL] performance tips
Next Topic:[ATL] run configuration cannot select ATL file
Goto Forum:
  


Current Time: Sun Apr 11 02:01:56 GMT 2021

Powered by FUDForum. Page generated in 0.02587 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top