My problem is very similar. I have one metamodel divided in different ecore files, with references between them. For example, a "property" references another metamodel file that has the concept of "metric", and so on.
In an ATL transformation I get an error when I try to access the object "metric" of a given "property". I think that the problem is related with this, with the fact that it is in another file.
org.eclipse.m2m.atl.engine.emfvm.VMException: The value of type 'class it.cnr.isti.labse.connect.metrics.Metrics.impl.MetricsImpl' must be of type 'org.eclipse.emf.ecore.impl.EClassImpl@13b0fe0 (name: Metrics) (instanceClassName: null) (abstract: false, interface: false)'
The metamodels are provided by someone else, so I cannot unify them.
Federico Toledo Messages: 97 Registered: April 2012 Location: Ciudad Real, Spain
yes, the stack trace shows this:
org.eclipse.m2m.atl.engine.emfvm.VMException: The value of type 'class it.cnr.isti.labse.connect.metrics.EventSet.impl.EventSetImpl' must be of type 'org.eclipse.emf.ecore.impl.EClassImpl@e273f6 (name: EventSet) (instanceClassName: null) (abstract: false, interface: false)'
what refers to my code here:
where I have accessed to other attributes of this element before, like
name <- prop.name,
So, the prop model is loaded and I can access their elements without problem, but when I try to access to an attribute that it is in another file it fails as mentioned
Nevertheless if you just want to test and run your transformation you can try to register manually your metamodels (it is not the proper way to work with ecore models but it should work).
For this, you should go in ATL perspective and then right click and select the "register metamodel" action on each of your ecore files.
It will add all of your metamodels to the global EMF registry, and you will need to do it each time you restart Eclipse.