Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Link between 2 ecore?
Link between 2 ecore? [message #1781097] Thu, 01 February 2018 11:05 Go to next message
Jim 20100 is currently offline Jim 20100Friend
Messages: 69
Registered: June 2016
Member
Hello,

I found some messages in forums, but I am not able to reproduce what I want.

I have an ecore representing a quote model.
I have another quote representing an output model.

I would like that from my output model I can get a reference to a quote object in my quote model.

My user has to create an output model, which will generate an output for a specific quote model.
How to achieve that easily for my users?

To create references to a Quote object (quote model) I tried to load the quote ecore in my output ecore, but I don't know how to do?
I don't have the "Load resources" action?

Here it is documented:
https://stackoverflow.com/questions/9384813/can-i-reuse-ecore-models-by-importing-them-into-other-models

Rgds
Re: Link between 2 ecore? [message #1781100 is a reply to message #1781097] Thu, 01 February 2018 12:13 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5625
Registered: July 2009
Senior Member
Hi

The stackoverflow answer seems to answer your question directly.

The Sample Ecore Model Editor context menu action that you require is actually "Load Resource..." and is typically about three entries from the bottom (just above Refresh and Show Properties View). Use it to load Quote.ecore while editing Ouput.ecore.

Regards

Ed Willink
Re: Link between 2 ecore? [message #1781114 is a reply to message #1781100] Thu, 01 February 2018 15:33 Go to previous messageGo to next message
Jim 20100 is currently offline Jim 20100Friend
Messages: 69
Registered: June 2016
Member
Yes, I saw that I have to use the Sample Ecore Model Editor instead of the ecore editor.

But Now I have a problem in the gen model.

I have now 2 packages:
- Output
- Quoting (ref to the existing Quote.ecore)

of course I don't want to generate anything for Quoting because everything is located in my other existing Quoting model plugin.
if I select only "Output" to generate ALL, MANIFEST contains invalid entries for Quoting classes and a lot of extensions are as well generated in plugin.xml.

ex:
Export-Package: biz.astron.output,
biz.astron.output.impl,
biz.astron.output.util,
biz.astron.sales.quoting, -> WRONG
biz.astron.sales.quoting.impl, -> WRONG
biz.astron.sales.quoting.util -> WRONG

or example in plugin.xml
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated output -->
<package
uri="http://www.astron.biz/sales/quoting/1.0"
class="biz.astron.sales.quoting.QuotingPackage"
genModel="model/output.genmodel"/>
</extension>
Re: Link between 2 ecore? [message #1781124 is a reply to message #1781114] Thu, 01 February 2018 16:26 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29184
Registered: July 2009
Senior Member
On the last page of the wizard, "Package Selection" there is a "Referenced generator models:" section. If you don't see your Quoting model in there, you should check it and not check it in the "Root packages:" section. If you don't see it there that probably means the Quoting model does properly register its GenModel in it's own plugin.xml. In any case, you can use Add... to load the Quoting *.genmodel so that it does appear in the bottom section and you should check it there, and not in the top section. You be able to use Reload... from the context menu or from the "Generator" menu bar with the output.genmodel open to fix it.
Re: Link between 2 ecore? [message #1781165 is a reply to message #1781124] Fri, 02 February 2018 08:51 Go to previous message
Jim 20100 is currently offline Jim 20100Friend
Messages: 69
Registered: June 2016
Member
Perfect Ed
Thx it works.
Previous Topic:Disabling Notifications on ResourceSet.clear
Next Topic:[CDO] - CDOResource
Goto Forum:
  


Current Time: Mon Feb 19 14:51:06 GMT 2018

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

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