Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » [OBEO] Create element based edge tool
[OBEO] Create element based edge tool [message #1796928] Mon, 22 October 2018 13:47 Go to next message
Arthur Depasse is currently offline Arthur DepasseFriend
Messages: 2
Registered: October 2018
Junior Member
Hello,

I am working on a tool to create FSM state charts in Sirius/Obeo designer
My (simplified) Ecore model is this :
https://i.imgur.com/xi77izx.png

I want to create a tool in my viewpoint to add an element-based edge.
I currently made this but it is not working :
https://i.imgur.com/gHvrzTU.png
I think I'm a bit lost regarding all the context changes and I don't know how to set correctly the fields in my transition object to point on states. Currently, the tool creates nothing. Can someone help me please ?

[Updated on: Tue, 23 October 2018 10:57]

Report message to a moderator

Re: [OBEO] Create element based edge tool [message #1796963 is a reply to message #1796928] Tue, 23 October 2018 08:50 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 253
Registered: August 2010
Senior Member
Hello,

I guess the tool will be applied by clicking on a source and target that represent a State. Following your MM, a transition is held by the "transitions" feature from FSM. That means the change context expression should return the FSM and the "Create Instance" field "Reference Name" value should be "transitions". This instance will be added on the "transitions" feature from the current context, a FSM. The FSM can be easily retrieved from the source or target variable: "aql:source.eContainer" for instance since State are contained by the states feature from FSM.

Regards,

Florian
Re: [OBEO] Create element based edge tool [message #1796970 is a reply to message #1796963] Tue, 23 October 2018 10:56 Go to previous messageGo to next message
Arthur Depasse is currently offline Arthur DepasseFriend
Messages: 2
Registered: October 2018
Junior Member
Hello,

First thanks you for your answer. I've tried what you proposed but it is not working. I currently have the following setup :
https://i.imgur.com/uEblXGs.png
Where :
the reference name in create_instance is "transitions" and the type of object is well defined as "Statechart_model::Transition"
and for the set values I use "var:source" as value expression and "feature:source" for the feature name. (same with target)
It still doesn't give anything when I try to draw such a transition in my diagram.

May I have poorly parametrised my model objects ? Or is it the fact that states accept reference to transitions and do not own them ?
Besides, I assumed that after I used create_instance, the Context is automatically changed to my new Transition instance, is that true ?
Re: [OBEO] Create element based edge tool [message #1797094 is a reply to message #1796970] Thu, 25 October 2018 07:53 Go to previous message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 253
Registered: August 2010
Senior Member
Regarding your screenshot, the Set feature are wrong. The expected value in the "Feature Name" field is "source" and "target" which are the name of the feature that you want to set on the new Transition object. The value expression will be "var:source" and "var:target" which are the selected source and target (the State). I suggest you to take a look on the ecoreTools project [1] which is a good example of modeler based on the Ecore. You can explore the odesign in the plugin org.eclipse.emf.ecoretools.design.

[1] http://git.eclipse.org/c/ecoretools/org.eclipse.ecoretools.git. You can clone the git repository (git clone git://git.eclipse.org/gitroot/ecoretools/org.eclipse.ecoretools.git)
Previous Topic:Multiple Instances of Same Viewpoint in representations.aird
Next Topic:How to programmatically Highlight an Node in Sirius Diagram representation
Goto Forum:
  


Current Time: Sun Jan 17 20:20:04 GMT 2021

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

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

Back to the top