Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Unresolved Proxies for EMF Model in EGL
Unresolved Proxies for EMF Model in EGL [message #1782491] Sat, 24 February 2018 15:10 Go to next message
Eric Domeshek is currently offline Eric DomeshekFriend
Messages: 10
Registered: October 2016
Junior Member
Hi there,

I'm new to Epsilon. I've been working based on the egldoc EMF example of EGL usage. My situation is that I have an EMF metamodel (originally defined using XCore) and a model1.xmi that contains objects of that metamodel. The model1.xmi refers to some objects in a second model file model2.xmi, also based on the same metamodel.

When I attempt to use EGL on model1, my code fails at points where a model1 object refers to an object defined in the model2 file. By putting in a println() I see there are proxy objects. When I try to access the field I need from those proxy objects, I'm getting back null, so I'm guessing the system is failing to resolve those proxies.

Some notes on things I've tried:

In order to get the code to see my EMF model at all, I've inserted the following before the call to loadModel() in my equivalent of the example's EglDocFacade.java:

EPackage.Registry.INSTANCE.put(MetamodelPackage.eINSTANCE.getNsURI(), MetamodelPackage.eINSTANCE);

In an attempt to make sure my referenced model2 is known to the system, I've tried to add another call to loadModel() in the Facade class for that 2nd model file, hoping it would then end up in the same ResourceSet as model1 and facilitate proxy resolution. That didn't seem to work.


Can you provide guidance as to how I'm supposed to get cross-model proxies to resolve in an EGL program?

For instance, is there a way I can explicitly put the two model files as Resources into a common ResourceSet, pass that ResourceSet into my EGL templates, and then explicitly call EcoreUtil.resolve() in my EGL code where it's needed? That seems like a long way around for something like proxy resolution that is supposed to happen auto-magically, but I'll take it if it gets me past this stuck point.

Thanks for any help you can provide,

--Eric
Re: Unresolved Proxies for EMF Model in EGL [message #1782495 is a reply to message #1782491] Sat, 24 February 2018 17:45 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1613
Registered: July 2009
Location: York, UK
Senior Member

Hi Eric,

Cross-file EMF references should work out of the box with Epsilon. Could you please provide a minimal example [1] we can use to reproduce this?

Cheers,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/minimal-examples/
Re: Unresolved Proxies for EMF Model in EGL [message #1782791 is a reply to message #1782495] Thu, 01 March 2018 14:09 Go to previous message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 199
Registered: October 2009
Location: UK
Senior Member

Hi Eric,

If you are working from java make sure that the "expand" attribute of your EMF model is set to true. It's value is "true" by default, but perhaps you are changing his inadvertently.
From a launch configuration there is a checkbox to set this flag.

Cheers,


Horacio Hoyos Rodriguez
Epsilon Committer
Research Assistant
University Of York

[Updated on: Thu, 01 March 2018 14:10]

Report message to a moderator

Previous Topic:Issue with using Haetae
Next Topic:Identifying a capsule which is connected to a particular capsule via eol code
Goto Forum:
  


Current Time: Mon Nov 19 03:13:37 GMT 2018

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

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

Back to the top