Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Operation acton: how to get to the semantic element
Operation acton: how to get to the semantic element [message #1713461] Wed, 04 November 2015 09:40 Go to next message
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 209
Registered: June 2010
Senior Member
Hi,

I've created various editors using Sirius by now. However there is something that keeps bogging me.

When you create a OperationAction, a variable ( by default called 'views') is defined that provides the elements on which the OperationAction is to be performed. Actually, the views variable is a set of RepresentationElements (so nodes/edges or anything else on a diagram that has been selected).

Typically, you want the operation to act on the semantic element represented by the RepresentationElements in view. In general, I do this like:
| Container Views Variable 'views'
| begin
|- For tg // views.target
|- - // do something with tg


So I dereference the views variable by the 'target' property. This property is provided as views typically is a set of DSemanticDecorators. However, when I validate the odesign model, a warning is created stating that 'target' is unknown. A better expression would be: views.oclAsType(DSemanticDecorator).target. This however requires me to add a dependency on the Sirius metamodel.

Why isn't an additional variable created that holds the semantic elements on which the operation is to be invoked? If you have a node creation tool for instance, also two variables exist: one representing the container (as semantic element) and one representing the containerView (the graphical element representing the container). A similar approach for the OperationAction sounds reasonable to me.

What do you think?

Greetings,
Wilbert

Re: Operation acton: how to get to the semantic element [message #1713572 is a reply to message #1713461] Thu, 05 November 2015 09:07 Go to previous messageGo to next message
Esteban Dugueperoux is currently offline Esteban DugueperouxFriend
Messages: 472
Registered: July 2009
Senior Member
Hi Wilbert,

I understand your remarks, you can raise a bugzilla about either have
Sirius metamodels available natively or have a new variable for this tool.

Best Regards.


Le 04/11/2015 10:40, Wilbert Alberts a écrit :
> Hi,
>
> I've created various editors using Sirius by now. However there is
> something that keeps bogging me.
>
> When you create a OperationAction, a variable ( by default called
> 'views') is defined that provides the elements on which the
> OperationAction is to be performed. Actually, the views variable is a
> set of RepresentationElements (so nodes/edges or anything else on a
> diagram that has been selected).
>
> Typically, you want the operation to act on the semantic element
> represented by the RepresentationElements in view. In general, I do this
> like:
>
> | Container Views Variable 'views'
> | begin
> |- For tg // views.target
> |- - // do something with tg
>
>
> So I dereference the views variable by the 'target' property. This
> property is provided as views typically is a set of DSemanticDecorators.
> However, when I validate the odesign model, a warning is created stating
> that 'target' is unknown. A better expression would be:
> views.oclAsType(DSemanticDecorator).target. This however requires me to
> add a dependency on the Sirius metamodel.
>
> Why isn't an additional variable created that holds the semantic
> elements on which the operation is to be invoked? If you have a node
> creation tool for instance, also two variables exist: one representing
> the container (as semantic element) and one representing the
> containerView (the graphical element representing the container). A
> similar approach for the OperationAction sounds reasonable to me.
>
> What do you think?
>
> Greetings,
> Wilbert
>
>



--
Esteban Dugueperoux - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Operation acton: how to get to the semantic element [message #1713574 is a reply to message #1713572] Thu, 05 November 2015 09:22 Go to previous messageGo to next message
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 209
Registered: June 2010
Senior Member
Raised bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=481481

Greetings,
Wilbert.
Re: Operation acton: how to get to the semantic element [message #1716151 is a reply to message #1713574] Tue, 01 December 2015 17:47 Go to previous message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Hi,
I should really thank you for your post here! I've been struggling with the same problem for days ! your post helped me a lot !

Thanks,
Cheers,
Parsa
Previous Topic:AQL query for the "create view" action
Next Topic:Internal error when trying to open an aird file
Goto Forum:
  


Current Time: Thu Apr 25 11:15:14 GMT 2024

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

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

Back to the top