|
Re: Container Drop, Move Operation [message #1614838 is a reply to message #1613387] |
Fri, 13 February 2015 14:30 |
|
> 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 #1619503 is a reply to message #1614876] |
Mon, 16 February 2015 16:29 |
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04215 seconds