Customizing markers location with EMF Validation [message #1736496] |
Wed, 29 June 2016 19:39 |
|
Hi,
I have a Sirius modeller, based on an EMF model. So far, so good.
My EMF model comes with constraints that are handled through EMF validation. So, no validation defined in my *.odesign file.
When I validate a diagram, these constraints are correctly invoked.
However, the messy part occurs with the markers location. Indeed, my diagram's links are based on relations (i.e. EMF references), and not on elements. It means that when Sirius looks for an edit part to display the marker, it can pick up the node... or one of the edges whose source is this node. The underlying model element is the same for all of them.
And that's what happens.
When an element contains an error, the marker is not always associated with the DNode part. It is sometimes on an edge. And not always the same edge, depending on their configuration. This is far from being convenient for users.
Is there any way to customize or intercept the resolution of markers location? Or said differently, is there any way to force validation markers to only appear on nodes?
I took a look at the odesign options. I also digged into the code (the wrong location is found in the ValidateAction class). I also noticed we can write our own handler for org.eclipse.sirius.diagram.ui.command.validateDiagram. But that would be a crazy job... Any help would be appreciated.
|
|
|
Re: Customizing markers location with EMF Validation [message #1736541 is a reply to message #1736496] |
Thu, 30 June 2016 09:28 |
|
This is so weird.
I have not modified anything in my code. And this morning, all the edit parts are resolved correctly.
Markers are on my nodes and not on edges. I cannot explain this, because, again, I did not change anything (apart restarting my computer). Anyway, unless the problem arises again, I guess we can ignore my initial message.
|
|
|
|
Re: Customizing markers location with EMF Validation [message #1736585 is a reply to message #1736570] |
Thu, 30 June 2016 13:05 |
|
Hi Vincent,
Le 30/06/2016 à 13:43, Vincent Zurczak a écrit :
> OK. I am spamming my own thread, but the issue is back. :/
> Markers now appear on my edges while I would expect them to be shown on
> the node.
When an edge has a mapping defined as "Relation" edge mapping, its
semantic element is the semantic element of its source.
Your issue really looks like a bug: it seems that EMF/GMF/Sirius takes
the first item it found with the good element to decorate and puts its
decorator. We should at least investigate to always have the same
behavior (node first or edge first or both) and maybe define another
approach to have a better solution.
Could you report a bug on the bugzilla [1] ?
--
Maxime - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
--
[1] https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Sirius
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.03244 seconds