Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » [ATL] how to set up the association after transformatin by ATL
[ATL] how to set up the association after transformatin by ATL [message #105075] Sun, 17 May 2009 04:17 Go to next message
Eclipse UserFriend
Hi

I am trying an scenario as belonw

============================================================

source model after target model
transformation
============================================================
Class A Class A
--------------------> Class B
B hasGeneralization
to A
============================================================

my ATL code will be writed as below


rule Class {
from s : UML2!"uml::Class" (
to t : UML2!"uml::Class" (
name <- 'classA'),

addclass: UML2!"uml::class" mapsTo s (
name<-'classB'),

addGeneralization: UML2!"uml::Generalization" mapsTo s (
// what should I do at this section???
)

I don't know how to assign the Generalization's property
"General" to "ClassA"

Anyone can give me some suggestion??

Thanks very much

micromilua
Re: [ATL] how to set up the association after transformatin by ATL [message #105098 is a reply to message #105075] Sun, 17 May 2009 07:06 Go to previous messageGo to next message
Eclipse UserFriend
micromilua a écrit :
> Hi
>
> I am trying an scenario as belonw
>
> ============================================================
>
> source model after target model
> transformation
> ============================================================
> Class A Class A
> --------------------> Class B
> B hasGeneralization
> to A
> ============================================================
>
> my ATL code will be writed as below
>
>
> rule Class {
> from s : UML2!"uml::Class" (
> to t : UML2!"uml::Class" (
> name <- 'classA'),
>
> addclass: UML2!"uml::class" mapsTo s (
> name<-'classB'),
>
> addGeneralization: UML2!"uml::Generalization" mapsTo s (
> // what should I do at this section???
> )
>
> I don't know how to assign the Generalization's property "General" to
> "ClassA"
>
> Anyone can give me some suggestion??
>
> Thanks very much
>
> micromilua
>
>
>
>
>
>

Hi micromilua,

Are you tried :

"general <- t" or also "superClass" in addclass target?
You don't need create a Generatization UML element.
Re: [ATL] how to set up the association after transformatin by ATL [message #105481 is a reply to message #105098] Thu, 21 May 2009 02:54 Go to previous message
Eclipse UserFriend
Hi:

I use a not optimal method as below

from s...
to t... ,

addGeneralization: UML2!"uml::Generalization" mapsTo s (
specific <- t,
general <- (UML2!Class.allInstances()->select(st | st.name =
'///class's name/// ').first()))

The select() method help me to solve the problem
but It is really really not a good solution I thought

micromilua

> Hi micromilua,

> Are you tried :

> "general <- t" or also "superClass" in addclass target?
> You don't need create a Generatization UML element.
Previous Topic:[ATL] Can input model variables be referred to in rules?
Next Topic:Nested Packages Ecore
Goto Forum:
  


Current Time: Wed May 07 15:10:10 EDT 2025

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

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

Back to the top