Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Flattening a UML model with "refining"
Flattening a UML model with "refining" [message #97167] Wed, 17 December 2008 15:13 Go to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
Hi i wanted to flatten the package structure of a UML model,
does anybody know the best solution to do that?
i read a little bit about the "refining" execution mode, but it seems that
with a refinement i still have to write all the rules that copy a UML
model.
I also will have to deal with a huge amount of references that will
change, is there a solution that ATL provides for that?

Thanks.
Re: Flattening a UML model with "refining" [message #97183 is a reply to message #97167] Wed, 17 December 2008 17:01 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Hi skander

i don't really remember how works the refines mode but i think you can
use a UML2Copy transformation (download :
http://ssel.vub.ac.be/viewvc/*checkout*/UML2CaseStudies/uml2 cs-transformations/UML2Copy.atl
; generated with :
http://ssel.vub.ac.be/viewvc/*checkout*/UML2CaseStudies/uml2 cs-transformations/EModelCopyGenerator.atl)

if you want to flatten you drop the rules for packages (Package2Package)

and in model rule (Model2Model)

you can change the rule into :

-- s is the source model

packagedElements <- s.packagedElements->union(
UML!Element.allInstances()->select(e | e.owner.oclIsTypeOf(UML!Package)
and e.owner <> s)
)

with this kind of rule ATL will copy each elements
except packages
and will be stored in packagedElement in top level model

do you want this kind of behaviour ?

Skander a écrit :
> Hi i wanted to flatten the package structure of a UML model,
> does anybody know the best solution to do that?
> i read a little bit about the "refining" execution mode, but it seems
> that with a refinement i still have to write all the rules that copy a
> UML model.
> I also will have to deal with a huge amount of references that will
> change, is there a solution that ATL provides for that?
>
> Thanks.
>




Re: Flattening a UML model with "refining" [message #97199 is a reply to message #97183] Thu, 18 December 2008 10:34 Go to previous message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
thanks a lot for this very clear and quick help, i found another solution
by using UML2!Package.allInstances() in my original transformation, which
forgets about the hierarchy of packages, i found this very powerful in
ATL, but i will also try your solution.
Thanks a lot
Previous Topic:[ATL] Relate two target model constructs
Next Topic:[QVTO] Split a target model in several parts
Goto Forum:
  


Current Time: Fri Apr 19 05:31:23 GMT 2024

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

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

Back to the top