Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » get the address of input(EOL)
get the address of input [message #1768520] Wed, 19 July 2017 16:22 Go to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 261
Registered: July 2016
Senior Member
Hi,

How can I get the addresses of input model and input metamodel in eol program?
I want to pass these addresses to java.
Re: get the address of input [message #1768526 is a reply to message #1768520] Wed, 19 July 2017 17:22 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1484
Registered: July 2009
Location: York, UK
Senior Member

Hi,

If you're using an EMF-based named M you can get its path using M.getResource().getURI(). If you're using a file-based metamodel for it you can use M.getMetamodelFiles().

Cheers,
Dimitris
Re: get the address of input [message #1768539 is a reply to message #1768526] Wed, 19 July 2017 19:15 Go to previous messageGo to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 261
Registered: July 2016
Senior Member
Thanks a lot.
Is it also possible to use Aliases for Metamodel? e.g., Is something like "IN_MM!EPackage.allInstances() -> first()" true?

As another question, I created a model in my eol program. Then I pass the URI of the model as you said to java. However, before the contents of model is completely loaded the java function runs. It causes the java function works with empty model and get error. What should I do?

and also how can I check the model is empty or not?

[Updated on: Wed, 19 July 2017 19:18]

Report message to a moderator

Re: get the address of input [message #1768543 is a reply to message #1768539] Wed, 19 July 2017 19:37 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1484
Registered: July 2009
Location: York, UK
Senior Member

> Is it also possible to use Aliases for Metamodel? e.g., Is something like "IN_MM!EPackage.allInstances() -> first()" true?

I'm not sure what you're trying to achieve but give this a go and see what happens.

> It causes the java function works with empty model and get error. What should I do?

Please attach a minimal example [1] I can use to reproduce the behaviour you're encountering.

Cheers,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/minimal-examples/
Re: get the address of input [message #1768571 is a reply to message #1768543] Thu, 20 July 2017 07:02 Go to previous messageGo to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 261
Registered: July 2016
Senior Member
Using eclipse Mars.2 (4.5.2) on mac os x.
epsilon 1.3
import Test plugin to eclipse. run it as eclipse application. In the new eclipse, import test1 project and run it.

Thanks for your time.
Re: get the address of input [message #1768656 is a reply to message #1768571] Fri, 21 July 2017 05:39 Go to previous messageGo to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 261
Registered: July 2016
Senior Member
I have also another question. When I pass the EPackage of metamodel from Epsilon to Java, how can I register it?
Re: get the address of input [message #1768720 is a reply to message #1768656] Sat, 22 July 2017 11:32 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1484
Registered: July 2009
Location: York, UK
Senior Member

Hi,

If you need to register it in the global EPackage Registry, EPackage.Registry.INSTANCE.put(...) should do the trick.

Cheers,
Dimitris
Re: get the address of input [message #1769086 is a reply to message #1768720] Wed, 26 July 2017 11:48 Go to previous messageGo to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 261
Registered: July 2016
Senior Member
Thanks.

Don't you have any comment on my minimal Example?

[Updated on: Wed, 26 July 2017 11:52]

Report message to a moderator

Re: get the address of input [message #1769180 is a reply to message #1769086] Thu, 27 July 2017 09:57 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1484
Registered: July 2009
Location: York, UK
Senior Member

I think that you're missing an r.load(...); after Resource r = rs.getResource(path, true); in your Test1 method.

Cheers,
Dimitris
Re: get the address of input [message #1769185 is a reply to message #1769180] Thu, 27 July 2017 11:01 Go to previous messageGo to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 261
Registered: July 2016
Senior Member
Thank you very much indeed. My problem was solved.
Re: get the address of input [message #1769512 is a reply to message #1769185] Tue, 01 August 2017 09:15 Go to previous messageGo to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 261
Registered: July 2016
Senior Member
I'm sorry. It sometimes works correctly and many times works incorrectly.
Do you have any idea?
Re: get the address of input [message #1769525 is a reply to message #1769512] Tue, 01 August 2017 10:04 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1484
Registered: July 2009
Location: York, UK
Senior Member

I'd start by finding a subset of the program that can be used to consistently reproduce the problem you're encountering.

Cheers,
Dimitris
Re: get the address of input [message #1769919 is a reply to message #1769525] Sat, 05 August 2017 17:21 Go to previous message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 261
Registered: July 2016
Senior Member
It seems if I pass the "Resource" instead of "URI" the program works correctly.
Thanks.
Previous Topic:Epsilon: How to measure a program's execution time
Next Topic:EWL wizard in GMF editor not showing up after first usage
Goto Forum:
  


Current Time: Tue Nov 21 02:54:43 GMT 2017

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

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