Skip to main content



      Home
Home » Modeling » Epsilon » Adapting IModel to reveal EMF(Reusing the Epsilon repository with EMF)
Adapting IModel to reveal EMF [message #1843308] Fri, 23 July 2021 04:11 Go to next message
Eclipse UserFriend
It is simple to access an EMF model loaded into a repository in ant workflow. The trivial code is below. However, it is hard to subsequently use it as an EMF class, as the interface only presents EMC -level API.

How can an IModel be adapted, to reveal the underlying EMF model instance?

try {
	final IModel model = getProjectRepository().getModelByName("");
	if (model instanceof EmfModel) {
		EmfModel emfModel = (EmfModel) model;				
	}
} catch (EolModelNotFoundException e) { ... }
Re: Adapting IModel to reveal EMF [message #1843309 is a reply to message #1843308] Fri, 23 July 2021 04:56 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jörn,

emfModel.getResource() should do the trick (I've added a note about this in [1]).

Best,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/epsilon-emf
Re: Adapting IModel to reveal EMF [message #1843344 is a reply to message #1843309] Sat, 24 July 2021 02:51 Go to previous messageGo to next message
Eclipse UserFriend
Thanks! That is excellent and will substantially simplify things for us.
Re: Adapting IModel to reveal EMF [message #1843347 is a reply to message #1843344] Sat, 24 July 2021 03:49 Go to previous message
Eclipse UserFriend
Great - I'm pleased to hear that!

Best,
Dimitris
Previous Topic:Compatibility issue between Epsilon and RoboTool
Next Topic:Model Validation from Java Code
Goto Forum:
  


Current Time: Mon Jul 07 09:32:20 EDT 2025

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

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

Back to the top