How to specify in the rule that one element contain another [message #1065398] |
Tue, 25 June 2013 14:48 |
Félix SILINOU KAMDEM Messages: 96 Registered: April 2013 |
Member |
|
|
Hello,
I would like to know how to specify in the rule that one element contain another.
My input metamodels are M2 UML2 and the output is a specific Ecore model.
For example, in the code below, I can specify that the element name DocumentRoot contain Model Type element but I don't know how to specify that ModelType element contains PackageType element. See the code below and the snapshot I uploaded.
rule Model2DocumentRoot {
from
m : UML!Model
to
dr : XsdEcore!DocumentRoot (
comment <- 'le modèle que l\'on traite est '+m.name,
model <- mt
),
mt : XsdEcore!ModelType(
package <- m.packagedElement
)
}
rule Pack2Pack {
from
p : UML!Package
to
pt : XsdEcore!PackageType ()
}
[Updated on: Tue, 25 June 2013 14:57] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: How to specify in the rule that one element contain another [message #1065751 is a reply to message #1065723] |
Thu, 27 June 2013 11:34 |
Hugo Bruneliere Messages: 674 Registered: July 2009 |
Senior Member |
|
|
No, "m" is the "m : UML!Model" input model element.
Then, as I told before, ATL is going to make automatically the resolution according to the corresponding output elements created by other rules.
--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
|
|
|
Powered by
FUDForum. Page generated in 0.05560 seconds