Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Transfering a diagram to a service function
Transfering a diagram to a service function [message #1824354] Tue, 14 April 2020 08:54 Go to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 116
Registered: October 2019
Senior Member
Hi,

I want to use the identity of a specific diagram as an input parameter to a service function.
Specifically, I want to implement a function find(EObject, Diagram) that is defined on a semantic object and finds its representational element in the specific diagram.

Any advice?

Regards,
Avi
Re: Transfering a diagram to a service function [message #1824355 is a reply to message #1824354] Tue, 14 April 2020 09:25 Go to previous messageGo to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 116
Registered: October 2019
Senior Member
I have succeeded doing this by doing the following:

public void encapsulateElements(Process process, DDiagram diagram) {
Collection<EObject> result = new EObjectQuery(process).getInverseReferences(ViewpointPackage.Literals.DSEMANTIC_DECORATOR__TARGET);
result.removeIf(n->!(((DDiagramElement) n).getParentDiagram().equals(diagram)));

I would love to know if there's an easier way.
Re: Transfering a diagram to a service function [message #1824488 is a reply to message #1824355] Thu, 16 April 2020 07:33 Go to previous message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 246
Registered: August 2010
Senior Member
Hi,

Depending on where your service is called, you might have access to the view variable (elementView, containerView etc) in your odesign. This view variable references a DDiagramElement.

Regards,

Florian
Previous Topic:Instation of models - can lower bound for composition relations be used?
Next Topic:Java services doesn't work
Goto Forum:
  


Current Time: Sun Oct 25 23:18:55 GMT 2020

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

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

Back to the top