Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Container Drop, Move Operation
Container Drop, Move Operation [message #1613387] Thu, 12 February 2015 16:19 Go to next message
Studs Terkel is currently offline Studs TerkelFriend
Messages: 27
Registered: July 2011
Junior Member
Hello,

i have a model, where a Container have 0..* activities of type Activity. The Container itself is also of type Activity. In my Diagram i want to be able to move activities in and out the Containers. In my odesign i use a Container Drop together with a Move operation:

https://dl.dropboxusercontent.com/u/4062763/containerDrop1.png

The Move operation is specifed like this:

https://dl.dropboxusercontent.com/u/4062763/containerDrop2.png

However, when i drag and drop an Activity on a Container, like this:

https://dl.dropboxusercontent.com/u/4062763/containerDrop3.png

Eclipse freezes and i have to kill it. So i got no error msg. Any idea what is going wrong? I am not sure if my odesign file is even valid ... Rolling Eyes
Re: Container Drop, Move Operation [message #1614838 is a reply to message #1613387] Fri, 13 February 2015 14:30 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 253
Registered: August 2010
Senior Member
> Hello,


Hi,
>
> i have a model, where a Container have 0..* activities of type Activity.
> The Container itself is also of type Activity. In my Diagram i want to
> be able to move activities in and out the Containers. In my odesign i
> use a Container Drop together with a Move operation:
>
Instead of define a "Move" operation, you should perform the move
"semantically".
I don't know your meta-model but if the relation between a Container and
an Activity is a containment relation, you just need to affect the
Activity to the container relation where it has been dropped. That
should look like something like that:

Begin
Change Context [newSemanticContainer/]
Set
Feature name : yourContainementFeature
Value Expression : var:element


A good example is the "Ecore Tools" modeler:
http://git.eclipse.org/c/ecoretools/org.eclipse.ecoretools.git/tree/org.eclipse.emf.ecoretools.design/description/ecore.odesign

You can take a look on the "Drop EClassifier into EPackage" Container
Drop for instance.

>
>
> The Move operation is specifed like this:
>
>
>
> However, when i drag and drop an Activity on a Container, like this:
>
>
>
> Eclipse freezes and i have to kill it. So i got no error msg. Any idea
> what is going wrong? I am not sure if my odesign file is even valid ...
> :roll:


Regards,

--
Florian - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Container Drop, Move Operation [message #1614876 is a reply to message #1614838] Fri, 13 February 2015 15:04 Go to previous messageGo to next message
Studs Terkel is currently offline Studs TerkelFriend
Messages: 27
Registered: July 2011
Junior Member
Quote:

Begin
Change Context [newSemanticContainer/]
Set
Feature name : yourContainementFeature
Value Expression : var:element


Works like a charm!

Btw.: In which case do you use the 'Move Operation' then?
https://www.eclipse.org/sirius/doc/specifier/general/Model_Operations.html#move
Re: Container Drop, Move Operation [message #1619503 is a reply to message #1614876] Mon, 16 February 2015 16:29 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 500
Registered: July 2009
Location: Nantes, France
Senior Member
Le 13/02/2015 16:04, Studs Terkel a écrit :
> Quote:
>> Begin
>> Change Context [newSemanticContainer/]
>> Set
>> Feature name : yourContainementFeature
>> Value Expression : var:element
>
>
> Works like a charm!
>
> Btw.: In which case do you use the 'Move Operation' then?
> https://www.eclipse.org/sirius/doc/specifier/general/Model_Operations.html#move
>

Given a newContainer, an element to add and the name if a containing
feature, it is up to you to choose between both constructions:

Set operation:
. changeContext newContainer
. set containmentFeatureName element

Move operation:
. changeContext element
. move newContainer containmentFeatureName

The move operation will log an error if the feature upper bound is 1 and
if a value is already specified for the new container.

Regards


--
Maxime - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Can't find the target of the diagram
Next Topic:Unrecognized variables in .odesign
Goto Forum:
  


Current Time: Thu Jan 28 06:24:33 GMT 2021

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

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

Back to the top