Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Multiple inputs with references
Multiple inputs with references [message #1099861] Mon, 02 September 2013 06:06 Go to next message
Federico Toledo is currently offline Federico Toledo
Messages: 97
Registered: April 2012
Location: Ciudad Real, Spain
Member
Hi,

I am facing a problem that was already posted in an archived forum

http://www.eclipse.org/forums/index.php/m/683910/?srch=Multiple+input+with+references#msg_683910

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.

Any suggestion would be appreciated!
Re: Multiple inputs with references [message #1099895 is a reply to message #1099861] Mon, 02 September 2013 07:04 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 601
Registered: July 2009
Senior Member
Hello,

Are you sure this error is actually raised when accessing to the input model?
Can you identify more precisely which instruction/expression of your transformation this error is raised on?

Best regards,


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: Multiple inputs with references [message #1099902 is a reply to message #1099895] Mon, 02 September 2013 07:15 Go to previous messageGo to next message
Federico Toledo is currently offline Federico Toledo
Messages: 97
Registered: April 2012
Location: Ciudad Real, Spain
Member
yes, the stack trace shows this:


<unknown>!coverageReachingGuard
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)'
at __applygetTestContext#88(MAIN.atl[110:4-110:14])


what refers to my code here:

prop.metrics.debug();


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


Thank you for your time!
Re: Multiple inputs with references [message #1099905 is a reply to message #1099902] Mon, 02 September 2013 07:16 Go to previous messageGo to next message
Federico Toledo is currently offline Federico Toledo
Messages: 97
Registered: April 2012
Location: Ciudad Real, Spain
Member
Another thing: I'm using Juno, and I tried again after updating all the components to the latest version
Re: Multiple inputs with references [message #1100212 is a reply to message #1099905] Mon, 02 September 2013 17:16 Go to previous messageGo to next message
Guillaume Doux is currently offline Guillaume Doux
Messages: 56
Registered: July 2009
Member
Hello Federico,

I wanted to know how do you select your metamodels when you launch the transformation ?

Are they already in memory ? (embedded in plugin and selected by the EPackage uri)
Or did you load them by selecting the files ?

If you are using directly the metamodels files, may be it can be the reason, and you
should try to load the metamodels by URI (I mean in memory URI).

If your metamodels are already embedded in plugins and you are already loading them this way, in that case I don't know...

Best regards,

Guillaume
Re: Multiple inputs with references [message #1100524 is a reply to message #1100212] Tue, 03 September 2013 04:10 Go to previous messageGo to next message
Federico Toledo is currently offline Federico Toledo
Messages: 97
Registered: April 2012
Location: Ciudad Real, Spain
Member
Hi!

I am loading the files, I am not developing a plugin, only the ATL transformations.
How can I try what you mentioned? (sorry for my ignorance)
Re: Multiple inputs with references [message #1100612 is a reply to message #1100524] Tue, 03 September 2013 06:43 Go to previous messageGo to next message
Guillaume Doux is currently offline Guillaume Doux
Messages: 56
Registered: July 2009
Member
Hi,

The problem is that here ATL and EMF do not know how to access the elements in the other ecore files because they are not registered.

The best thing to do would be to generate the plugins corresponding to your metamodels (you can find a tutorial on EMF here http://www.vogella.com/articles/EclipseEMF/article.html).

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.

Best regards,

Guillaume
Re: Multiple inputs with references [message #1100682 is a reply to message #1100612] Tue, 03 September 2013 08:44 Go to previous message
Federico Toledo is currently offline Federico Toledo
Messages: 97
Registered: April 2012
Location: Ciudad Real, Spain
Member
I will try, thank you!
Previous Topic:loop
Next Topic:Refactoring transformation by seprating into modules
Goto Forum:
  


Current Time: Wed Aug 20 01:12:05 EDT 2014

Powered by FUDForum. Page generated in 0.03032 seconds