Iteratin on 0-n reference [message #63186] |
Sat, 29 September 2007 00:42 |
Eclipse User |
|
|
|
Originally posted by: felouerkhaoui.gmail.com
Hello ,
I want to transform a collection to another type of collection in a atl
file. I'm new to atl scripts and I don't know where to put exactly the
code who will transform entites to datalayer.
Thanks.
transform.atl:
module transform; -- Module Template
create OUT : detailed from IN : itarone;
rule Domaine {
from
a : itarone!Domaine
to
b : detailed!Domaine (
name <- a.name
)
}
My source ecore is represented by the following mk3 content :
package source{
class Domaine {
attribute name[0-1] : ;
reference entites[0-1000] ordered container : Entite;
reference usecases[0-1000] ordered container : UseCase;
reference subDomaines[0-100] ordered container : Domaine;
}
class Entite {
attribute name[0-1] : ;
reference usecases[0-1000] ordered container : UseCase;
}
class UseCase {
attribute name[0-1] : ;
reference entites[0-1000] ordered : Entite;
}
}
My destination ecore :
package destination{
class Domaine {
attribute name[0-1] : ;
reference dataLayer[0-n] container : DataLayer;
}
class DataLayer {
attribute name[0-1] : ;
}
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.02432 seconds