Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Incorrect output HOT
Incorrect output HOT [message #757633] Sun, 20 November 2011 17:26 Go to next message
Ravenlord  is currently offline Ravenlord Friend
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.
Re: Incorrect output HOT [message #757729 is a reply to message #757633] Mon, 21 November 2011 11:34 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
An ATL transformation is just the textual version of an ATL model.
When you create a HOT, you create an ATL model that is stored in XMI. To transform it to its corresponding textual version, you have to use the ATL extractor.

For example in ANT you'd do :
<atl.saveModel model="myATL" path="outputs/SavingMySample.atl">
<extractor name="ATL"/>
</atl.saveModel>
Re: Incorrect output HOT [message #757765 is a reply to message #757729] Mon, 21 November 2011 15:06 Go to previous message
Ravenlord  is currently offline Ravenlord Friend
Messages: 5
Registered: August 2011
Junior Member
Sylvain EVEILLARD wrote on Mon, 21 November 2011 12:34
An ATL transformation is just the textual version of an ATL model.
When you create a HOT, you create an ATL model that is stored in XMI. To transform it to its corresponding textual version, you have to use the ATL extractor.

For example in ANT you'd do :
<atl.saveModel model="myATL" path="outputs/SavingMySample.atl">
<extractor name="ATL"/>
</atl.saveModel>


Ok I am feeling rather stupid now. Many thanks for the help.
Previous Topic:[ATL] Problems with EMF-Specific VM and Regular VM
Next Topic:[ATL] Unicode string literals in transformation
Goto Forum:
  


Current Time: Fri Apr 19 04:17:06 GMT 2024

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

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

Back to the top