Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] EMFInjector and Resource
[ATL] EMFInjector and Resource [message #755400] Tue, 08 November 2011 11:07
butch.piranda is currently offline butch.pirandaFriend
Messages: 5
Registered: April 2011
Junior Member
Hello,

I have a strange behavior while switching my code from serialized (xmi) resource to the resource object.

Everything works perfect with this setup
IReferenceModel myMetamodel
EMFModel myModel;
String myModelPath= "model/model.ecore"
File xmi = "model/modelinstance.xmi"

1) EMFInjector injector = (EMFInjector) CoreService.getInjector("EMF");
2) injector.inject(myMetamodel, getPluginRessourceInputStream(myModelPath), null );
3) load the xmi, FileInputStream fis = new FileInputStream(xmi);
3a) injector.inject( myModel, fis , null );

... then launch the ATL transformation.

While the ATL transformation is executed at runtime, i don't need to seralize and access any file, so I switched to this:
1) EMFInjector injector = (EMFInjector) CoreService.getInjector("EMF");
2) injector.inject(myMetamodel, getPluginRessourceInputStream(myModelPath), null );
3) injector.inject(myModel, MyModelResource);
The ATL transformation is not executed.

Comparing the two versions in debug, I found the reason but since my steps are ok and no warning or errors occrurs, I am asking the community if it's a bug (or feature:-))

When it comes to this
EMFModel.getElementsByType(Object) line: 111
EMFModelAdapter$10.exec(AbstractStackFrame) line: 409
ASMOperation.exec(AbstractStackFrame, IProgressMonitor) line: 391

my Object is of org.eclipse.emf.ecore.impl.EClassImpl instead of org.eclipse.emf.ecore.impl.DynamicEObjectImpl, so the method getElementByType found nothing. As a consequence, the rule do not match, nothind is executed.

Any feedback will be apreciated,
Christian





Previous Topic:[ATL] Inter model references
Next Topic:[ATL] Atl plugin problem ecore with referenced ecore
Goto Forum:
  


Current Time: Thu Oct 10 01:52:34 GMT 2024

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

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

Back to the top