Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 324068

Summary: Template isn't called from UI Launcher in case of dynamic models
Product: [Modeling] Acceleo Reporter: Templier Thierry <templth>
Component: CoreAssignee: Project Inbox <acceleo-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: laurent.goubet, stephane.begaudeau, templth
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Templier Thierry CLA 2010-08-31 05:07:43 EDT
Build Identifier: 20100617-1415

All plugins (metamodel, generator and ui launcher) are defined within the same workspace. My template references the metamodel using the ecore file as following:

[module generate('platform:resource/[metamodel.plugin]/model/metamodel.ecore')/]

My template works fine since I can generate code through Run Configurations with an Acceleo Application within the same workspace.

However, after having started a new eclipse instance (Eclipse Application from the Run Configurations), the template isn't called from UI Launcher. It seems to be caused by dynamic models. After having debugging processing, there is no match between the argumentType (input of template) and elements of model.

while (targetElements.hasNext()) {
  final EObject potentialTarget = targetElements.next();
  if (argumentType.isInstance(potentialTarget)) { <-------
    (...)
  }
}

The argumentType instance in my case is not null, of type EClass but all 
its fields are null...

See exhanges related to this problem in m2t forum: http://www.eclipse.org/forums/index.php?t=tree&goto=553352&S=b7a3cd0775d4971a67dc186d9712b376#page_top

Thierry

Reproducible: Always
Comment 1 Laurent Goubet CLA 2010-08-31 08:11:56 EDT
Thanks for bringing the issue here Thierry, this will make a great reminder that we need to look into generation on dynamic models.
Comment 2 Templier Thierry CLA 2010-08-31 09:26:11 EDT
You're welcome, Laurent! Don't hesitate to tell me if you want me to make some tests with my code...
Thierry
Comment 3 Stephane Begaudeau CLA 2011-04-21 10:59:21 EDT
The major problem with dynamic metamodel has been fixed and the Acceleo documentation of the generated Java launcher has been updated accordingly. You have to register the path of your metamodel as its uri and it will work in Acceleo 3.1.0 starting with Acceleo 3.1 M7 next month.