Home » Modeling » Epsilon » Error in importing Epsilon project example
| | | | | | |
Re: Error in importing Epsilon project example [message #1776640 is a reply to message #1776030] |
Sun, 19 November 2017 14:55   |
Eclipse User |
|
|
|
Hi Dimitris,
I am reopening this topic because now I am facing another type of problem, however, in the same project [1].
I'm using a specific part of this sample project, which is the EVL part (package -> org.eclipse.epsilon.examples.standalone.evl). Summarizing what I did:
I changed the models and metamodels that were inside the package org.eclipse.epsilon.examples.standalone.models to the models and metamodels of another example project [2]. This project [2] where I took the models (and metamodels), is an example of how to use the ModeLink [3] editor to create a "relationship model".
So I changed the class EvlStandaloneExample (belonging to the package org.eclipse.epsilon.examples.standalone.evl ) so that I could add the models and metamodels of the project [2]. I had no difficulty running the project [1] after adding the models "persons.model" and "houses.model", as well as their respective metamodels. However, I'm not able to add the model "personshouses.model". I believe this is happening because it has attributes that are references to other models (persons.model and houses.model). The error happens in the method getModels() of the EvlStandaloneExample class, when I try to add the model "personshouses.model" in the list of models that this method returns.
I would be very happy if you could give me a direction.
Cheers,
Marcelo
[1] https://git.eclipse.org/c/epsilon/org.eclipse.epsilon.git/tree/examples/org.eclipse.epsilon.examples.standalone
[2] https://git.eclipse.org/c/epsilon/org.eclipse.epsilon.git/tree/examples/org.eclipse.epsilon.examples.modelink.personshouses
[3] https://www.eclipse.org/epsilon/doc/modelink/
[Updated on: Sun, 19 November 2017 15:10] by Moderator
|
|
| | | | |
Re: Error in importing Epsilon project example [message #1776993 is a reply to message #1776979] |
Thu, 23 November 2017 08:26   |
Eclipse User |
|
|
|
Hi Marcelo,
Since you're using a metamodel (personshouses.ecore) that refers to other metamodels by URI you need to load your models using metamodel URIs instead of the metamodel .ecore files. Replacing your three models.add(...) statements with the following should do the trick.
EmfUtil.register(URI.createURI(getFileURI("models/persons.ecore").toString()), EPackage.Registry.INSTANCE);
EmfUtil.register(URI.createURI(getFileURI("models/houses.ecore").toString()), EPackage.Registry.INSTANCE);
EmfUtil.register(URI.createURI(getFileURI("models/personshouses.ecore").toString()), EPackage.Registry.INSTANCE);
models.add(createEmfModelByURI("persons", "models/persons.model", "http://persons", true, true));
models.add(createEmfModelByURI("houses", "models/houses.model", "http://houses", true, true));
models.add(createEmfModelByURI("personshouses", "models/personshouses.model", "personshousesexample", true, true));
Cheers,
Dimitris
|
|
| |
Goto Forum:
Current Time: Wed Jul 23 11:05:12 EDT 2025
Powered by FUDForum. Page generated in 0.10882 seconds
|