Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » "Edge Creation" tool with external Nodes( unable to navigate to containing feature)
"Edge Creation" tool with external Nodes [message #1443200] Sun, 12 October 2014 09:46 Go to next message
Nikolay Manolov is currently offline Nikolay ManolovFriend
Messages: 24
Registered: June 2012
Junior Member
I have to two semantic models.
The first one contains nodes.
The second one contains connections (that connect/reference nodes from the other model).
My diagram is defined on the second model.

My diagram allows the nodes and the edges. Preexisting elements are displayed correctly.
I can drag more nodes into the diagram in order to connect them, however I run into a problem with the Edge Creation tool. Since the (semantic) nodes are outside the diagram's root/model I cannot navigate to the Edge's expected container, hence an instance cannot be created.
For the preconditions section several variables are available, such as "diagram" that lets you access the semantic root of the diagram, however those are not available in the Begin operation when creating an instance.

I could access for example the sourceView variable and from there possibly get the root graphical element of the diagram but then I do not know how to access its semantic element.

Do you have any suggestions on resolving this problem?

Best Regards,
Nikolay
Re: "Edge Creation" tool with external Nodes [message #1452157 is a reply to message #1443200] Fri, 24 October 2014 22:02 Go to previous messageGo to next message
Nikolay Manolov is currently offline Nikolay ManolovFriend
Messages: 24
Registered: June 2012
Junior Member
bump
Re: "Edge Creation" tool with external Nodes [message #1453377 is a reply to message #1443200] Sun, 26 October 2014 22:16 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 482
Registered: July 2009
Location: Nantes, France
Senior Member
Hi,

Le 12/10/2014 11:46, Nikolay Manolov a écrit :
> I have to two semantic models.
> The first one contains nodes. The second one contains connections (that
> connect/reference nodes from the other model).
> My diagram is defined on the second model.
>
> My diagram allows the nodes and the edges. Preexisting elements are
> displayed correctly. I can drag more nodes into the diagram in order to
> connect them, however I run into a problem with the Edge Creation tool.
> Since the (semantic) nodes are outside the diagram's root/model I cannot
> navigate to the Edge's expected container, hence an instance cannot be
> created. For the preconditions section several variables are available,
> such as "diagram" that lets you access the semantic root of the diagram,
> however those are not available in the Begin operation when creating an
> instance.
> I could access for example the sourceView variable and from there
> possibly get the root graphical element of the diagram but then I do not
> know how to access its semantic element.
>
> Do you have any suggestions on resolving this problem?

org.eclipse.sirius.viewpoint.DSemanticDecorator.getTarget() in a Java
service or the target EReference in an Acceleo expression should solve
your problem
[yourExpressionToTheDiagram.oclAsType(DSemanticDecorator).target/] and
return the domain EObject. DDiagramElement inherits from
DSemanticDecorator and so does DSemanticDiagram which should be the
EClass of your current "root graphical elemet of the diagram".

>
> Best Regards,
> Nikolay
>

Kind 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

Join the Sirius community at SiriusCon. Register for free: Nov. 9th Paris
http://www.siriuscon.org/
Previous Topic:Developer Documentation
Next Topic:Validation rule on root
Goto Forum:
  


Current Time: Thu Apr 09 22:36:37 GMT 2020

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

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

Back to the top