Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Generating edit code for referenced models(How can you generate edit/editor code for referenced models?)
Generating edit code for referenced models [message #1831456] Thu, 20 August 2020 08:37 Go to next message
Wernke zur Borg is currently offline Wernke zur BorgFriend
Messages: 42
Registered: December 2011
Member
We have a project A that exports a few Ecore models and the generated model code but does not generate any edit or editor code. Note that the term "project" does not mean Eclipse projects in the same workspace but higher level projects with separate workspaces, which may even be run by different companies.

There is a project Project B (let's say in a different company) with an own Ecore model, importing/referencing the models from project A. Now we have to generate the edit/editor code for the own model plus the referenced Ecore models. However, the related menu items for the code generation are disabled, so we are stuck at this point.

index.php/fa/38798/0/

We would have to copy the ecore files out of the referenced plug-in into our workspace, which we don't like for maintainability reasons.

Of course, the edit code could be generated by project A, but there is a clear separation of concerns between the projects. I think it is a legal use case having multiple different edit/editor implementations for the same external model, implemented by different projects.

How would you address this issue? Are there any technical limitations preventing the edit code generation for referenced models?

Thanks for any hints
Wernke

[Updated on: Thu, 20 August 2020 08:44]

Report message to a moderator

Re: Generating edit code for referenced models [message #1831472 is a reply to message #1831456] Thu, 20 August 2020 12:32 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
You can only generate for the contained GenPackages. The one you show selected is a referenced GenPackage. You must open that GenPackage's *.genmodel and generate from that. The generated item providers are registered against the package's nsURI and you can only have one such thing deployed without conflicts.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Generating edit code for referenced models [message #1831507 is a reply to message #1831456] Fri, 21 August 2020 09:11 Go to previous messageGo to next message
Wernke zur Borg is currently offline Wernke zur BorgFriend
Messages: 42
Registered: December 2011
Member
Thank you again Ed, this makes it clear.

Cheers, Wernke
Re: Generating edit code for referenced models [message #1831509 is a reply to message #1831507] Fri, 21 August 2020 09:59 Go to previous message
Wernke zur Borg is currently offline Wernke zur BorgFriend
Messages: 42
Registered: December 2011
Member
As a late add-on:

You can open the genmodel of a referenced/imported model from the Plug-In Dependencies and generate code for it. You can even make changes to the genmodel and they will be taken into account for the code generation! But they are of course (and luckily!) not written back to the jar in the bundle_pool. There is an exception on saving.

index.php/fa/38799/0/
  • Attachment: genmodel2.png
    (Size: 44.01KB, Downloaded 154 times)

[Updated on: Fri, 21 August 2020 10:10]

Report message to a moderator

Previous Topic:ECoreUtil.resolveAll on multi-file ecore meta-model results in "unresolved proxy" errors.
Next Topic:Showing Properties of EObjects without Selection
Goto Forum:
  


Current Time: Fri Apr 26 22:03:42 GMT 2024

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

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

Back to the top