Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » gmf(gmf)
gmf [message #520464] Fri, 12 March 2010 13:52 Go to next message
Lishan is currently offline LishanFriend
Messages: 9
Registered: March 2010
Junior Member
I'm a bit stuck and I wondered if you might have some ideas.

I am developing a dsl with EMF/GMF that has states that can have nested states and transitions between the states. I am happy with the ecore model but the final diagramming tool isnt working properly. It wont allow me to draw transitions between states that are nested within another state. eg. I have state1 containing state2 and state3 and I want to draw a transition between state2 and state3.

When you run the diagram tool it creates 2 files, the diagram file and the ecore model file. If I edit the data model to add a transition between nested states, then redisplay the diagram it displays the new nested transition correctly but when I am using the diagram application it prohibits me from creating a transition between nested states.

I guess I need to change one of gmfgraph, gmftool, gmfmap.

emf description of model
@namespace(uri="SMNEW1", prefix="SMNEW1")
package SMNEW1;

class StateMachine {
!ordered val State[*] states;
}

class State {
attr String name;
!ordered ref Transition[*]#source outgoing;
!ordered val Transition[*]#target incoming;
!ordered val State[*] substates;
}

class Transition {
attr String name;
!ordered ref State#outgoing source;
!ordered ref State#incoming target;
}

In gmfgraph I define Figure descriptors for State and Transition and specify Transition as a Connection and State as a Node.
In gmftool I specify a creation tool for State
In gmfmap there is a topnode reference for State with a child Node Mapping for State this has a child reference with substates as the containment feature.
There is link mapping from source to target for Transition with state.incoming as the containment feature and the Diagram Link is the connection Transition


I have done exactly as suggested here http://wiki.eclipse.org/GMF_MapModel_Hints for "Show children elements from non-containment feature" and "Endless/recursive hierarchies" and the states are nesting perfectly but I am not able to create transitions between the nested states in the generated diagramming application. I am able to create them in the data model however and they display correctly in the diagramming application.

Thanks

[Updated on: Fri, 12 March 2010 14:37]

Report message to a moderator

Re: gmf [message #520689 is a reply to message #520464] Sun, 14 March 2010 12:17 Go to previous messageGo to next message
Ali Koudri is currently offline Ali KoudriFriend
Messages: 118
Registered: July 2009
Senior Member
Can you tell us more about your gmfgraph model ? Have you used
compartments ? Which layout ?

Le 12/03/2010 14:52, Lishan a écrit :
> I'm a bit stuck and I wondered if you might have some ideas.
>
> I am developing a dsl with EMF/GMF that has states that can have nested
> states and transitions between the states. I am happy with the ecore
> model but the final diagramming tool isnt working properly. It wont
> allow me to draw transitions between states that are nested within
> another state. eg. I have state1 containing state2 and state3 and I want
> to draw a transition between state2 and state3.
>
> When you run the diagram tool it creates 2 files, the diagram file and
> the ecore model file. If I edit the data model to add a transition
> between nested states, then redisplay the diagram it displays the new
> nested transition correctly but when I am using the diagram application
> it prohibits me from creating a transition between nested states.
>
> I guess I need to change one of gmfgraph, gmftool, gmfmap.
>
> emf description of model
> @namespace(uri="SMNEW1", prefix="SMNEW1")
> package SMNEW1;
>
> class StateMachine {
> !ordered val State[*] states;
> }
>
> class State {
> attr String name;
> !ordered ref Transition[*]#source outgoing; !ordered val
> Transition[*]#target incoming;
> !ordered val State[*] substates;
> }
>
> class Transition {
> attr String name;
> !ordered ref State#outgoing source;
> !ordered ref State#incoming target; }
>
> In gmfgraph I define Figure descriptors for State and Transition and
> specify Transition as a Connection and State as a Node.
> In gmftool I specify a creation tool for State
> In gmfmap there is a topnode reference for State with a child Node
> Mapping for State this has a child reference with substates as the
> containment feature.
> There is link mapping from source to target for Transition with
> state.incoming as the containment feature and the Diagram Link is the
> connection Transition
>
>
> Thanks
Re: gmf [message #521111 is a reply to message #520689] Tue, 16 March 2010 13:47 Go to previous message
Lishan is currently offline LishanFriend
Messages: 9
Registered: March 2010
Junior Member
When I was using an older version of Eclipse I didn't use compartments and everything worked ok. But it doesn't with Galileo. The good news is that I have now tried using compartments and it all works ok. Thank you for your reply.
Previous Topic:Create GMFGen using multiple ecore models / genmodels
Next Topic:Java Heap Space error during code generation
Goto Forum:
  


Current Time: Thu Apr 25 07:00:01 GMT 2024

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

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

Back to the top