Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Using registered meta model
Using registered meta model [message #636929] Wed, 03 November 2010 12:04 Go to next message
Henning is currently offline HenningFriend
Messages: 32
Registered: October 2010
Member
Hello!

I'm doing some model transformation with ETL and at the end I would like to add some notation elements from the GMF notation.ecore enabling me to open the resulting model in my editors.
During the transformation development I realized that the EPackageRegistryView is packed with other registered meta models and that the notation meta model is already listed there. So, I went ahead and added to my ant file the following:
<epsilon.emf.loadRegisteredMetamodel
name="gmfNotation" 
metamodeluri="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>


However, I cannot access any types of gmfNotation (like Diagram) - I get a type-not-found-exception. To make sure that I set up everything correctly I also tried a similar ant file as provided in the epsilon blog:
<epsilon.eol>
	new gmfNotation!Diagram;
	<model ref="gmfNotation"/>
</epsilon.eol>



But without any success. What do I need to do to use the meta model in my transformation?

Thanks for your help,

Henning
Re: Using registered meta model [message #636936 is a reply to message #636929] Wed, 03 November 2010 12:27 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

At the moment, you're loading the GMF notation metamodel itself. What
you need to do is to load a model that conforms to that metamodel instead.

Cheers,
Dimitris

On 03/11/2010 12:04, Henning wrote:
> Hello!
>
> I'm doing some model transformation with ETL and at the end I would like
> to add some notation elements from the GMF notation.ecore enabling me to
> open the resulting model in my editors. During the transformation
> development I realized that the EPackageRegistryView is packed with
> other registered meta models and that the notation meta model is already
> listed there. So, I went ahead and added to my ant file the following:
> <epsilon.emf.loadRegisteredMetamodel
> name="gmfNotation"
> metamodeluri="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
>
>
> However, I cannot access any types of gmfNotation (like Diagram) - I get
> a type-not-found-exception. To make sure that I set up everything
> correctly I also tried a similar ant file as provided in the
> http://epsilonblog.wordpress.com/2009/05/24/new-in-epsilon-0 -8-5/:
>
> <epsilon.eol>
> new gmfNotation!Diagram;
> <model ref="gmfNotation"/>
> </epsilon.eol>
>
>
> But without any success. What do I need to do to use the meta model in
> my transformation?
>
> Thanks for your help,
>
> Henning
Re: Using registered meta model [message #636942 is a reply to message #636936] Wed, 03 November 2010 13:33 Go to previous messageGo to next message
Henning is currently offline HenningFriend
Messages: 32
Registered: October 2010
Member
Quote:
At the moment, you're loading the GMF notation metamodel itself.

This exactly what I want to do! Because I want to use the notation::Diagram type in my target model.

My setup is like that: I use a source model (compliant to a Source meta model) to transform it to a target model (compliant to Target meta model). In order to use my GMF editors to edit models compliant to the target meta model I need the Notation:Diagram element.

Another way to put it is: I need to have two models (each is conform to a different meta model) but to be serialized in one (XMI) file.

How can I do that?

Best regards,

Henning

Re: Using registered meta model [message #636949 is a reply to message #636942] Wed, 03 November 2010 14:02 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Henning,

Henning wrote:
> Quote:
>> At the moment, you're loading the GMF notation metamodel itself.
>
> This exactly what I want to do! Because I want to use the
> notation::Diagram type in my target model.

Not quite I'm afraid. What you're doing with this is loading the
registered metamodel as an EMF Ecore model. Therefore, the metamodel
you're coding against in your EOL is Ecore (e.g. gmfNotation!EClass.all
should return all the classes in the registered notation metamodel).

>
> My setup is like that: I use a source model (compliant to a Source meta
> model) to transform it to a target model (compliant to Target meta
> model). In order to use my GMF editors to edit models compliant to the
> target meta model I need the Notation:Diagram element.

At the moment the EMF driver doesn't support multiple metamodelURIs per
model but what you can do is to create a 3rd metamodel which somehow
references the 2 metamodels (target and notation) (e.g. by containing 2
dummy classes which inherit from classes in the target and notation
metamodels), register it and then use its URI as the metamodelURI of
your combined target model.

>
> Another way to put it is: I need to have two models (each is conform to
> a different meta model) but to be serialized in one (XMI) file.
>
> How can I do that?
>
> Best regards,
>
> Henning
>
>

If none of these make sense, please let me know and I can come up with a
concrete example.

Cheers,
Dimitris
Re: Using registered meta model [message #637167 is a reply to message #636949] Thu, 04 November 2010 12:54 Go to previous message
Henning is currently offline HenningFriend
Messages: 32
Registered: October 2010
Member
Hi Dimitris,

I have decided to solve the problem with Java. I will just do some post processing of my created model and simply append the needed notation:diagram element.
But still: Thanks for making clear what the EMF driver is capable of right now!

Best regards,

Henning
Previous Topic:Installation Error
Next Topic:EMF Register breaking GMF Editors?
Goto Forum:
  


Current Time: Thu Apr 25 16:58:09 GMT 2024

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

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

Back to the top