Community
Participate
Working Groups
When using a ToolFilter which selects multiple "elements to listen" Sirius creates a NotificationFilter which is impossible to match: The filter expression is thus never evaluated. The contradiction is in line 123 of org.eclipse.sirius.business.api.tool.ToolFilterDescriptionListener: for (final EObject eObject : elementsToListen) { notificationFilter = notificationFilter.and(NotificationFilter.createNotifierFilter(eObject)); } The problem is the conjunction 'and'. If I have k "elements to listen", this filter matches a given notification only if its notifier is k1, k2, ..kn at the same time. This makes no sense, since a notification cannot have more than one notifier. The fix would be to use 'or', rather than 'and' so that the filter matches if any of the 'elements to listen' fires a notification.
New Gerrit change created: https://git.eclipse.org/r/70627
Thanks Felix for your detailed bug report. We consider this issue as valid. Nevertheless, although there is a gerrit, there is currently no plan to include this issue in the following releases.
The documentation says: "The Elements To Listen is evaluated in the context of the diagram’s semantic element, and should return a set of semantic elements." But it seems that in runtime the context is the diagram itself. We have to state clearly on how this functionality works before going forward.
Context/available variables is for me always a try/repeat game, the documentation is just a hint that I regard with suspicion. Often I verify with the debugger until I get to see the available variables in some Map. Maybe the context/available variables could be added/documented by using annotations in the sirius ecore model. You could then exploit this in the documentation and maybe also in unit tests, or even try to set the context automagically. Not releasing a fix is not a showstopper for me. However, the documentation should be updated to mention this bug, or at least that multiple elements to listen currently don't work as expected, whatever expected means ^^