Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo 3.1] fail to generate
[Acceleo 3.1] fail to generate [message #698452] Tue, 19 July 2011 13:53 Go to next message
stuart mackey is currently offline stuart mackey
Messages: 7
Registered: July 2009
Junior Member
Since upgrading from 3.0 to 3.1.0.v20110607-0602 my Acceleo project has begun failing to generate. I get this message in the log:

The generation fail to generate any file because there are no model elements that matches at least the type of the first parameter of one of your main templates.


This same template worked fine in 3.0. The specific point of failure appears to be in AcceleoService in this block of code where it's looking for the main template to invoke:

for (Template template : mainTemplates) {
	// Calls the template with each potential arguments
	final EClassifier argumentType = template.getParameter().get(0).getType();
	if (argumentType.eIsProxy()) {
		throw new AcceleoEvaluationException(AcceleoEngineMessages.getString(
				"AcceleoService.TypeIsProxy", templateName)); //$NON-NLS-1$
	}

	// The input model itself is a potential argument
	if (argumentType.isInstance(model)) {



and specifically that last line:
	if (argumentType.isInstance(model)) {


That line fails. 'model' there is the instance of my model that I passed into the constructor of my generator. And argumentType is a dynamic EClass that Acceleo is using to represent what should be the type of my model object. But they aren't matching up.

Perhaps in 3.1 I now need to override registerPackages in my generator and manually specify my model location? If so what should this look like for platform URIs? And is it needed for all packages in the model or just the root?


Some other noteworthy factors:
We refer to our model in the template using a platform uri, e.g.:

platform://a.b.c/model/mymodel.ecore

We're using CDO and EMF together in case that matters. And I'm passing in a pre-existing model instance to the generator, not a URI.

Also, looks like my Acceleo project's compiler settings are set to use binary resource. Not sure of the impact of that. That's what it was by default.
Re: [Acceleo 3.1] fail to generate [message #698763 is a reply to message #698452] Wed, 20 July 2011 07:46 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 413
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi Stuart,

You should try with XMI resources instead of binary resources since you have a case with complex uri. (right click on the Acceleo project -> properties -> acceleo).

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo



Re: [Acceleo 3.1] fail to generate [message #698892 is a reply to message #698763] Wed, 20 July 2011 12:35 Go to previous message
stuart mackey is currently offline stuart mackey
Messages: 7
Registered: July 2009
Junior Member
Thanks Stephane, switching to XMI resources in the project's Acceleo Compiler properties page fixed my problem.
Previous Topic:launching .chain doesn't generate hibernate code
Next Topic:Help/Doc reference for "file" directive
Goto Forum:
  


Current Time: Tue Oct 21 05:31:21 GMT 2014

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

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