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