Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [ACCELEO] imput model type????(hi!! plz what is the type of imput model???)
[ACCELEO] imput model type???? [message #667238] Wed, 27 April 2011 11:07 Go to next message
radwane  is currently offline radwane
Messages: 27
Registered: April 2011
Junior Member
hi!! plz what is the type of imput model??? i tryed my file .xmi but nothing happned so what i should do???
Re: [ACCELEO] imput model type???? [message #667786 is a reply to message #667238] Mon, 02 May 2011 04:54 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1625
Registered: July 2009
Senior Member
Radwane,

As long as your model can be read by EMF, you can use it with Acceleo. File extension does not matter.

If "nothing happened", make sure the templates you try to generate code with are indeed defined for the metamodel of your input model.

Laurent Goubet
Obeo
Re: [ACCELEO] imput model type???? [message #668204 is a reply to message #667786] Wed, 04 May 2011 09:47 Go to previous messageGo to next message
radwane  is currently offline radwane
Messages: 27
Registered: April 2011
Junior Member
hi
it not worked with .xmi
Re: [ACCELEO] imput model type???? [message #668327 is a reply to message #668204] Thu, 05 May 2011 04:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26014
Registered: July 2009
Senior Member
You should consider that people can't answer your questions when you
don't provide any information. What specifically did you try?


radwane wrote:
> hi
> it not worked with .xmi
Re: [ACCELEO] imput model type???? [message #668338 is a reply to message #668327] Thu, 05 May 2011 05:25 Go to previous messageGo to next message
radwane  is currently offline radwane
Messages: 27
Registered: April 2011
Junior Member
hi ,
i tried to transformate model to text with acceleo tool .
i have my metamodel my.ecore and i instanciate a class in this metamodel nammed Root so now i have a file nammed Root.xmi and i have generate.mtl to generate java code so i have all files but the problem is::::
when i select Root.xmi as a input file nothing happned ( normally generate.mtl create another file.java but nothing happen) only when i choise my.ecore as input file (so i'm sur there no error in my generate.mtl) but that's can't help me because i must generate my file Root.xmi .
thx
Re: [ACCELEO] input model type???? [message #668793 is a reply to message #668338] Sat, 07 May 2011 10:14 Go to previous messageGo to next message
radwane  is currently offline radwane
Messages: 27
Registered: April 2011
Junior Member
hi
this is my file generator.mtl

[comment encoding = UTF-8 /]
[module generate('http://www.eclipse.org/uml2/3.0.0/UML')/]
[template public generate(aClass : Class)]
[file (aClass.name.concat('.java'), false)]
public class [aClass.name.toUpperFirst()/] {
[for (p: Property | aClass.attribute) separator('\n')]
private [p.type.name/] [p.name/];
[/for]

[for (p: Property | aClass.attribute) separator('\n')]
public [p.type.name/] get[p.name.toUpperFirst()/]() {
return this.[p.name/];
}
[/for]

[for (o: Operation | aClass.ownedOperation) separator('\n')]
public [o.type.name/] [o.name/]() {
// TODO should be implemented
}
[/for]
}
[/file]
[/template]


its ok if i choise input file .uml
but if i want to use my model .xmi i must change this ligne
[module generate('http://www.eclipse.org/uml2/3.0.0/UML')/]
but i dont know what i must write ?
Re: [ACCELEO] imput model type???? [message #668794 is a reply to message #668338] Sat, 07 May 2011 10:16 Go to previous message
radwane  is currently offline radwane
Messages: 27
Registered: April 2011
Junior Member
hi
this is my file generator.mtl

[comment encoding = UTF-8 /]
[module generate('http://www.eclipse.org/uml2/3.0.0/UML')/]
[template public generate(aClass : Class)]
[file (aClass.name.concat('.java'), false)]
public class [aClass.name.toUpperFirst()/] {
[for (p: Property | aClass.attribute) separator('\n')]
private [p.type.name/] [p.name/];
[/for]

[for (p: Property | aClass.attribute) separator('\n')]
public [p.type.name/] get[p.name.toUpperFirst()/]() {
return this.[p.name/];
}
[/for]

[for (o: Operation | aClass.ownedOperation) separator('\n')]
public [o.type.name/] [o.name/]() {
// TODO should be implemented
}
[/for]
}
[/file]
[/template]


its ok if i choise input file .uml
but if i want to use my model .xmi i must change this ligne
[module generate('http://www.eclipse.org/uml2/3.0.0/UML')/]
but i dont know what i must write ?
Previous Topic:[ACCELEO] new metamodel
Next Topic:[Acceleo3] How to process XML models?
Goto Forum:
  


Current Time: Sun Aug 31 00:32:34 EDT 2014

Powered by FUDForum. Page generated in 0.01850 seconds