"Edge Creation" tool with external Nodes [message #1443200] |
Sun, 12 October 2014 05:46  |
Eclipse User |
|
|
|
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 #1453377 is a reply to message #1443200] |
Sun, 26 October 2014 18:16  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 1.27115 seconds