Incorrect output HOT [message #757633] |
Sun, 20 November 2011 17:26 |
Ravenlord Messages: 5 Registered: August 2011 |
Junior Member |
|
|
Hello all
I am currently trying to to write a HOT that takes as input a weaving model (conforming to my own weaving meta model) and two uml class diagrams. (These two diagrams are also the left and right models for the weaving model.) As output an ATL transformation should be created. But this does not work. As output I get an ATL file but on opening I am presented with the XMI version of the transformation instead of ATL code. Consequently the ATL file does not compile.
I am assuming that there is some sort of syntax error in the resulting transformation causing this behaviour. Is this a correct assumption?
The used HOT looks as follows:
-- @path AMW=/WeavingToTransformation%20HOT/WeavingMetaModel.ecore
-- @path ATL=platform:/plugin/org.eclipse.m2m.atl.common/org/eclipse/m2m/atl/common/resources/ATL.ecore
module weavingToTransformation;
create transformation : ATL from weavingModel : AMW, left : UML, right : UML;
rule ModuleCreation {
from
input: AMW!Module
to
output: ATL!Module (
name <- input.name,
inModels <- input.leftModel,
outModels <- input.rightModel,
elements <- input.rules,
isRefining <- false,
commentsBefore <- Set {'-- @atlcompiler atl2010'}
)
}
rule LeftModelRef {
from
input: AMW!LeftModelRef
to
output: ATL!OclModel (
name <- input.name,
metamodel <- ametamodel
),
ametamodel: ATL!OclModel (
name <-'UML',
elements <- UML!Classifier.allInstancesFrom('left')
)
}
rule RightModelRef {
from
input: AMW!RightModelRef
to
output: ATL!OclModel (
name <- input.name,
metamodel <- ametamodel
),
ametamodel: ATL!OclModel (
name <- 'UML',
elements <- UML!Classifier.allInstancesFrom('right')
)
}
rule Classifiers {
from
element: UML!Classifier
to
atl: ATL!OclModelElement (
name <- element.name
)
}
This HOT is based on examples I found on the web and the WeavingSpectoATL HOT included in AMW. The only differences are that I use UML as metamodel instead of MOF and that I us a different weaving meta model, although it has mostly a similar structure as mmw_qatl.
I am aware that this HOT is not yet complete and it misses, among other things, a rule to create rules. This HOT is a work in progress but since I don't get a valid atl file as output I thought I try to solve this problem first.
Any pointers in the right direction would be appreciated.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02692 seconds