Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Eclipse 2019-03 EMF.Editor] : regression ?(EMF Generation process doesn't create all source code it used to. Some EMF editors features are absent.)
[Eclipse 2019-03 EMF.Editor] : regression ? [message #1806394] Wed, 08 May 2019 12:03 Go to next message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 67
Registered: April 2013
Member
I don't know why but while my EMF.edit and EMF.editor are installed as plugin, my example wizard item doesn't appear.

I note that some java file in EMF.editor are not generated (nevertheless, all compile well) as in the past. Extensions are missing too.
For example,
presentation/*EditorAdvisor.java (new)
presentation/*EditorPlugin.java

but not :

presentation/*ActionBarContributor.java
presentation/*Editor.java
presentation/*ModelWizard.java

Absence of ModelWizard could explain but why is it absent ?

What's wrong, please ?

[Updated on: Wed, 08 May 2019 14:30]

Report message to a moderator

Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806408 is a reply to message #1806394] Wed, 08 May 2019 14:51 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30559
Registered: July 2009
Senior Member
It sounds as if you've accidentally you changed your GenModel's Runtime Platform property from IDE (the default) to RCP (or RAP).
Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806415 is a reply to message #1806408] Wed, 08 May 2019 16:43 Go to previous messageGo to next message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 67
Registered: April 2013
Member
Yes, I've corrected and now, presentation/*EditorAdvisor.java has deseappered.
But,
presentation/*ActionBarContributor.java
presentation/*Editor.java
presentation/*ModelWizard.java
are still missing.

I've tried to redo from scratch. And same result.

FYI, the .ecore and .genmodel files, here, attached.

I can't understand what happens.
Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806416 is a reply to message #1806415] Wed, 08 May 2019 17:20 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30559
Registered: July 2009
Senior Member
You seem to have a UML2-based GenModel. It's best to ask about that on the UML2 forum:

https://www.eclipse.org/forums/eclipse.modeling.mdt.uml2



Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806418 is a reply to message #1806416] Wed, 08 May 2019 17:59 Go to previous messageGo to next message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 67
Registered: April 2013
Member
Humm, strange ... sounds like being a defeact from EMF generator as it doesn't perform generation as usual and without error.

[Updated on: Wed, 08 May 2019 18:00]

Report message to a moderator

Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806421 is a reply to message #1806418] Wed, 08 May 2019 18:38 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6481
Registered: July 2009
Senior Member
Hi

There is something wrong with digital.uml or your conversion thereof. Without the relevant file, it is hard to comment usefully.

When you write that it used to work was that before UML 2.5, because the problem seems to be that you have created a clone of the standard (new in UML 2.5) Primitive Types package, which might account for the subsequent trouble.

Regards

Ed Willink
Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806425 is a reply to message #1806421] Wed, 08 May 2019 19:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30559
Registered: July 2009
Senior Member
If there is a problem with the EMF generator itself I'll need to see such a problem occur (a test case) without having to install UML2's generator extensions to reproduce it. And of course I use EMF's generator in many other places, e.g, to generator Oomph's setup editor so a problem as glaringly obvious as you describe would not be easily overlooked.
Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806493 is a reply to message #1806421] Thu, 09 May 2019 20:16 Go to previous messageGo to next message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 67
Registered: April 2013
Member
Ed Willink wrote on Wed, 08 May 2019 18:38
Hi

There is something wrong with digital.uml or your conversion thereof.


Conversion is performed by 'New EMF generation model wizard'.

Ed Willink wrote on Wed, 08 May 2019 18:38

When you write that it used to work was that before UML 2.5, because the problem seems to be that you have created a clone of the standard (new in UML 2.5) Primitive Types package, which might account for the subsequent trouble.


types imported (through 'New EMF generation model wizard') are all of type EDataType.

And here is the original uml file.
  • Attachment: digital.uml
    (Size: 10.51KB, Downloaded 45 times)

[Updated on: Thu, 09 May 2019 20:17]

Report message to a moderator

Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806495 is a reply to message #1806425] Thu, 09 May 2019 20:21 Go to previous messageGo to next message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 67
Registered: April 2013
Member

[Updated on: Thu, 09 May 2019 21:58]

Report message to a moderator

Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806502 is a reply to message #1806495] Fri, 10 May 2019 03:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30559
Registered: July 2009
Senior Member
If I create a new GenModel direct from your *.ecore files, indeed no editor is generated. But that's because there are no insubstantial ECasses in either model. All the EClasses you do have are marked as Interface = true so they don't even generate implementation classes. There's nothing to edit if there's nothing that can be created to edit, so no editors. Perhaps there is a regression in UML2 to Ecore conversion, though from the names (even in the digital package), this just looks like a bunch of "data type" definitions to me, so there's nothing you could possibly edit, and even programmatically, there are no EObjects you can create.
Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806515 is a reply to message #1806502] Fri, 10 May 2019 06:34 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6481
Registered: July 2009
Senior Member
Hi

I think you've confused us by titling the message "regression".

There seems to be absolutely nothing wrong; everything is working as intended.

However you are being caught by the EMF's surprisingly high bar between interesting/boring. It has caught me out before too, and it takes some time to debug why generation works for one model and not another.

The solution is to add a dummy 'interesting' Class so that your 'boring' Interface / Enumeration content is not ignored.

Regards

Ed Willink
Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806524 is a reply to message #1806515] Fri, 10 May 2019 07:16 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30559
Registered: July 2009
Senior Member
It's not an issue of interesting versus boring it's an issue of there being any object that can be created and hence edited. After all, the wizard to create a resource for the model needs to put some root object in that resource, but there aren't any. Of course a dummy class could be edited, but then the editor only edits a dummy thing and nothing else from these models are used by that dummy thing, so it's hard to imagine how that would be useful. This just all looks bogus to me.
Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806536 is a reply to message #1806524] Fri, 10 May 2019 09:05 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6481
Registered: July 2009
Senior Member
Hi

IIRC I hit the problem when generating a model that only had enumerations. Nothing was generated so another model that referenced them hit missing classes. A dummy class fixed the limitation.

In this case, I suspect that another model whose editor tries to use this model may be disappointed that some of the edit support is missing.

Regards

Ed Willink
Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806597 is a reply to message #1806502] Sat, 11 May 2019 09:51 Go to previous messageGo to next message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 67
Registered: April 2013
Member
Ed Merks wrote on Fri, 10 May 2019 03:33
If I create a new GenModel direct from your *.ecore files, indeed no editor is generated. But that's because there are no insubstantial ECasses in either model.


To say, no concrete class. OK. I totally agree with you. I've missed that.

Because no editor source code is generated, it means that somewhere in the EMF generator , a control-flow instruction controls creation of such java files depending on the presence of concrete class, I imagine something like :

if (!concreteClasses.isEmpty())
// Create *Editor.java, ...

It would be nice, as usual in software, at the contrary, to notify user by a warning, there is no concrete class in the model :

if (!concreteClasses.isEmpty())
// Create *Editor.java, ...
else
// Emit a warning : "no concrete class => no editor"

A good idea ?
Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806598 is a reply to message #1806394] Sat, 11 May 2019 10:45 Go to previous messageGo to next message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 67
Registered: April 2013
Member
I've corrected my UML model by replacing uml:Interface by uml:Class.

I must confess I'm surprised by the resulting Ecore model.
For instance, I can't understand why UML composite relationships are not renewed in the Ecore model (they are totally ometted).

Suggestions ?
  • Attachment: digital.uml
    (Size: 7.21KB, Downloaded 14 times)
  • Attachment: digital.ecore
    (Size: 2.68KB, Downloaded 14 times)

[Updated on: Sat, 11 May 2019 10:46]

Report message to a moderator

Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806602 is a reply to message #1806598] Sat, 11 May 2019 12:02 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30559
Registered: July 2009
Senior Member
The generator just generates. It doesn't report to the user about all the optional /conditional things that aren't created nor do I plan to rework the generator framework to produce a report of what it did.

And when it comes to UML2, Ed W might help, but this in not the UML2 forum an I'm far from an expert in UML2 to comment on what it should or shouldn't do.
Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806610 is a reply to message #1806602] Sat, 11 May 2019 18:38 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6481
Registered: July 2009
Senior Member
Hi

If you want to continue this correspondence, it is really time that you moved to the UM2 newsgroup as Ed M directed, in his second response.

Regards

Ed Willink
Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806632 is a reply to message #1806610] Sun, 12 May 2019 21:28 Go to previous messageGo to next message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 67
Registered: April 2013
Member
Doesn't seem to be a UML2 defeact but EMF generator one.
I've understood...
My understanding is that UML -> Ecore translation is experimental and at the contrary, Ecore -> UML seems working better (I can make a mistake too).

As a result, I give up by this way.

Thank you.

Have a nice week.
Regards

[Updated on: Sun, 12 May 2019 21:58]

Report message to a moderator

Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806638 is a reply to message #1806632] Mon, 13 May 2019 04:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30559
Registered: July 2009
Senior Member
No, UML -> Ecore is not experimental, but you're welcome to believe that without bothering to ask in the appropriate forum about it. Although why you take that approach is beyond my understanding.

There are a great many technologies that extend the basic ones provided by EMF, with code generation starting from a UML2 model being just one such example. I can't know about them all nor investigate all issues relating to all downstream technologies, but there is a forum where you can ask, but you just don't seem to want to go there for no apparent good reason.
Re: [Eclipse 2019-03 EMF.Editor] : regression ? [message #1806639 is a reply to message #1806638] Mon, 13 May 2019 05:19 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6481
Registered: July 2009
Senior Member
Hi

UML to Ecore is far from experimental.
UML is a standard model specification language and so is more powerful paradigm than EMF. UML offers more opportunities for misunderstandings. UML has no direct implementation. UML to Ecore has many conversion options.
Ecore is a very practical model implementation language that can also be used as a specification.
If you just want an implementation then Ecore may well be a better choice.

Regards

Ed Willink
Previous Topic:Cross Reference in Ecore Editor
Next Topic:Serializing attribute defined ad EDataType
Goto Forum:
  


Current Time: Wed Oct 23 12:50:37 GMT 2019

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

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

Back to the top