Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 08:11 Go to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

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 08:56 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

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 06:51 Go to previous messageGo to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

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 07:49 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

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: Fri Apr 19 19:32:03 GMT 2024

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

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

Back to the top