Bug 533688 - Bad interaction between mapping filter and select model filter variable in a same composite filter
Summary: Bad interaction between mapping filter and select model filter variable in a ...
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 5.1.1   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2018-04-17 10:02 EDT by Pierre Guilet CLA
Modified: 2018-04-24 07:01 EDT (History)
1 user (show)

See Also:


Attachments
project to reproduce (3.05 KB, application/x-zip-compressed)
2018-04-17 10:02 EDT, Pierre Guilet CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Guilet CLA 2018-04-17 10:02:55 EDT
Created attachment 273647 [details]
project to reproduce

When a composite filter contains both a mapping filter and a variable select model element filter, activating the composite and cancelling the filter selection from the wizard also cancel the mapping filter activation.

Whereas the mapping filter should be activated.

If a composite contains only a select filter, it does not make sense to activate it when doing cancel. But with a mapping filter it does. So we should adapt behavior regarding the context.

Step to reproduce:
1-Import attached project


Another problem is when you have two composites A and B with A containing a select model element filter.

If we activate the composite filter B, then we launch A activation but cancel it from the selection wizard, then both A and B are disabled.

Only A should be disabled.
Comment 1 Pierre Guilet CLA 2018-04-17 10:11:28 EDT
Steps to reproduce 1:

1-Import attached project
2-open representation
3-Activate filter composite
4-Click cancel 

Ko filter is deactivated whereas a mapping filter exists and should hide all EClass.


Steps to reproduce 2:

1-Import attached project
2-open representation
3-Activate filter "Composite"
4-Click OK, filter is activated
5-Activate filter Composite2 but click on cancel on the select wizard.
KO "Composite" is also deactivated
Comment 2 Bo Zhang CLA 2018-04-24 07:01:30 EDT
Hi, 
I check the source code:
http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/tree/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/handler/ChangeFilterActivation.java

In line 157
ConcernService.setCurrentConcern(diagram, oldConcern); in this function clears the activated Filters.
So I add some codes after it, add the activatedFiltersCopy.
            if (activatedFiltersCopy.size() > 0) {
                activatedFilters.addAll(activatedFiltersCopy);
            }
It works well now.
But I'm not sure is it right, and I don't know do I need to deal rules and behaviors.
Please give me some suggestions.
Thank you.