Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Newbie question: not all classes of the ecore available in the editor
Newbie question: not all classes of the ecore available in the editor [message #1064001] Mon, 17 June 2013 08:40 Go to next message
Sabina EH is currently offline Sabina EHFriend
Messages: 2
Registered: May 2013
Junior Member
Hi,

I am new to EMF and trying to learn by means of a tutorial (the forum prevents me from posting the link Sad it's a tutorial from the University of Kiel, part of the "Eclipse Practical (winter term 2012/13)").
My ecore model corresponds to a turing machine modelled as a finite state machine. So basically I have the classes "TuringMachine" and the classes "State" and "Transition". Each TuringMachine has at least one State and 0-n transitions.
I generated the genmodel and from it the .edit and .editor code. According to my tutorial I am now supposed to use the editor to create an instance of a the turingmachine.ecore model.
Using the "Example EMF Model Creation Wizard " --> "Turingmachine Model" I created a new instance named myTM.turingmachine and chose a turingmachine-Object to be the root of the instance. Now as I try to create new States and Transitions, the context menue provides only "State" as possible new child of the turingmachine root object (see attached screenshot). But how can I create new Transitions?

I tried to add another class to my ecore model, to see if it will be displayed in the context menu. And same problem occurs: the new class is not available in the context menu, the only possible child of the root object is "State".
Thanks, Sabina
Re: Newbie question: not all classes of the ecore available in the editor [message #1064077 is a reply to message #1064001] Mon, 17 June 2013 13:51 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26237
Registered: July 2009
Senior Member
Sabina,

Does a TuringMachine as a containment reference of type Transition?
Perhaps it's a State that has that type of containment reference. By
default the generated editors will only have creation commands for each
object's containment reference.


On 17/06/2013 2:17 PM, Sabina EH wrote:
> Hi,
>
> I am new to EMF and trying to learn by means of a tutorial (the forum prevents me from posting the link :( it's a tutorial from the University of Kiel, part of the "Eclipse Practical (winter term 2012/13)").
> My ecore model corresponds to a turing machine modelled as a finite state machine. So basically I have the classes "TuringMachine" and the classes "State" and "Transition". Each TuringMachine has at least one State and 0-n transitions.
> I generated the genmodel and from it the .edit and .editor code. According to my tutorial I am now supposed to use the editor to create an instance of a the turingmachine.ecore model.
> Using the "Example EMF Model Creation Wizard " --> "Turingmachine Model" I created a new instance named myTM.turingmachine and chose a turingmachine-Object to be the root of the instance. Now as I try to create new States and Transitions, the context menue provides only "State" as possible new child of the turingmachine root object (see attached screenshot). But how can I create new Transitions?
>
> I tried to add another class to my ecore model, to see if it will be displayed in the context menu. And same problem occurs: the new class is not available in the context menu, the only possible child of the root object is "State".
> Thanks, Sabina
Re: Newbie question: not all classes of the ecore available in the editor [message #1064190 is a reply to message #1064077] Tue, 18 June 2013 07:36 Go to previous messageGo to next message
Sabina EH is currently offline Sabina EHFriend
Messages: 2
Registered: May 2013
Junior Member
Thank you, Ed. The reference from TuringMachine to Transition is no containment reference. But form State there is a containment reference called "outgoingTransitions" to Transition.
It seems to have been some Eclipse problem (bug?). What now worked for me is the following: I made a backup of my .ecore file. Then I deleted the whole project in Eclipse and created it again from scratch. I added the (unchanged) .ecore file, generated the .genmodel and from it the the code. Now it works!

Anyways, thanks a lot.
Sabina
  • Attachment: editor2.jpg
    (Size: 77.90KB, Downloaded 38 times)
Re: Newbie question: not all classes of the ecore available in the editor [message #1064194 is a reply to message #1064190] Tue, 18 June 2013 08:00 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26237
Registered: July 2009
Senior Member
Sabina,

Comments below.

On 18/06/2013 9:36 AM, Sabina EH wrote:
> Thank you, Ed. The reference from TuringMachine to Transition is no containment reference. But form State there is a containment reference called "outgoingTransitions" to Transition.
So I'd expect the create action for a transition to be on the context
menu for a State.
> It seems to have been some Eclipse problem (bug?). What now worked for me is the following: I made a backup of my .ecore file. Then I deleted the whole project in Eclipse and created it again from scratch. I added the (unchanged) .ecore file, generated the .genmodel and from it the the code. Now it works!
Probably it works the same as before. In this image you show the State
being selected, in the other, you showed the TuringMachine being
selected. Each has a different context menu with different create actions.
>
> Anyways, thanks a lot.
> Sabina
Previous Topic:No name when attribute=class name
Next Topic:[Teneo] On delete child, parent id is set to null before actual delete statement
Goto Forum:
  


Current Time: Sat Nov 29 03:42:08 GMT 2014

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

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