[ATL] EMFInjector and Resource [message #755400] |
Tue, 08 November 2011 11:07 |
butch.piranda 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
|
|
|
Powered by
FUDForum. Page generated in 0.02550 seconds