Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » References to other models
References to other models [message #744099] Fri, 21 October 2011 23:31 Go to next message
José Miguel P. is currently offline José Miguel P.Friend
Messages: 66
Registered: March 2010
Member

Hello!

My name is José Miguel, and I would like to send a question to the forum. First to all, thanks you for your help.

I have two metamodels, one of they is a "normal metamodel" and in the other, some Eclases have EReferences to Eclass defined in the first metamodel.

* Metamodel 1 => normal
* Metamodel 2 => with Ereferences to Eclases in Metamodel 1

I'm trying do a test for to instance each metamodel and obtain two model, one for each metamodel, using EOL. In my test, I instance metamodel 1 obviously without problem, but when I try instance this Ereferences, I obtain the follow message:

Called feature source on undefined object (..../prueba.eol@67:13)


The question is: Is possible do it using Epsilon?. What is the way of do it?

Thanks you very much for you help!

Best regards.
José Miguel
Re: References to other models [message #748255 is a reply to message #744099] Mon, 24 October 2011 15:36 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Dear José Miguel,

Welcome to the forums, and thank-you for your interest in Epsilon.

It is possible to navigate (and even change the values of) cross-model references with any of the Epsilon languages. I've put together an example Eclipse project that demonstrates this. Please import the attached ZIP file as a project into your Eclipse workspace, and then see the README for further instructions.

Hope this helps,
Louis.
Re: References to other models [message #748556 is a reply to message #748255] Mon, 24 October 2011 19:05 Go to previous messageGo to next message
José Miguel P. is currently offline José Miguel P.Friend
Messages: 66
Registered: March 2010
Member

Hello Louis.

First to all, thanks you very much, your example has been very usefull for me.

I have checked my test again and I have compared it with your example, and I have found my mistake.

Only one note for futures people reading this thread. In your example, the file banks.ecore is not synchronized with banks.emf, because in your banks.emf don't exits the ref ref people.Person[*] customers; in the metaclass Bank. I have generate the emf from the ecore, and this is the results:

@namespace(uri="banks", prefix="banks")
package banks;

import "platform:/resource/CrossModelReference/metamodels/people.ecore";

class World {
  val Bank[*] banks;
}

class Bank {
  attr String[1] name;
  ref people.Person[*] customers;
}


Thanks you very much for your help and congratulations for Epsilon. It's really great.

José Miguel.
Re: References to other models [message #753298 is a reply to message #748556] Wed, 26 October 2011 18:01 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi José Miguel,

I'm glad it helped, and thanks for the correction! (I think that I forgot the Emfatic syntax for a cross-model reference, specified it in the Ecore, and forgot to regenerate the Emfatic).

Thanks for feedback, and for using Epsilon!

Cheers,
Louis.
Previous Topic:[Eugenia] Diagram partitioning
Next Topic:[EuGENia] Ordering of Tools, Adding custom menus, Drag'n'Drop
Goto Forum:
  


Current Time: Thu Apr 25 10:42:45 GMT 2024

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

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

Back to the top