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

Bug 343847

Summary: [M2x IDE Integration] Use Xtend MetaModels configured in project settings when running BasicM2xAction or M2xConfigurationWizard
Product: [Automotive] Sphinx Reporter: Stephan Eberle <stephaneberle9>
Component: CoreAssignee: Stephan Eberle <stephaneberle9>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: ali.akar82, idydieng, quoclan, r.sezestre
Version: 0.7.0   
Target Milestone: 0.7.0   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 343844    
Bug Blocks:    

Description Stephan Eberle CLA 2011-04-26 10:09:50 EDT
= Problem description =
Currently the BasicM2MAction, BasicM2TAction, M2MConfigurationWizard, and M2TConfigurationWizard use an instance of SphinxManagedEmfMetaModel as basis for running M2x transformation operations. This is good for automatically determining the Xtend MetaModels required for processing the model files in the project from where the M2x transformation operation is invoked. If this is not sufficient, e.g., when transforming an existing model file to a metamodel where no instances exist as files in the same project yet, applications must subclass BasicM2xAction and programatically provide the required Xtend MetaModel(s). As this can become necessary quite quickly - in particular in the case of M2M transformation operations - a more intelligent Xtend MetaModel provision strategy should be provided at generic level. 

This can be easily achieved by retrieving and using the Xtend MetaModels that are configured via the Xtend/Xpand settings of the underlying project. BasicM2xAction and M2xConfigurationWizard will then automatically be initialized with the same Xtend MetaModels as the user has selected to get her Xtend extenstions and/or Xpand templates compiled.

= Resolution approach =
* Enhance BasicM2MAction and BasicM2TAction so as to retrieve the MetamodelContributorRegistry#getActiveMetamodelContributors() of underlying project and use the Xtend MetaModels exposed by the same.
* Use SphinxManagedEmfMetaModel only if no such can be found.
Comment 1 Stephan Eberle CLA 2011-05-02 12:17:41 EDT
Fixed as proposed in description.
Comment 2 Balazs Grill CLA 2021-07-14 02:15:23 EDT
Mass-closing Resolved tickets