Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 497469

Summary: Export representations action from aird close the session of the modeling project
Product: [Modeling] Sirius Reporter: Maxime Porhel <maxime.porhel>
Component: CoreAssignee: Florian Barbin <florian.barbin>
Status: CLOSED FIXED QA Contact: Julien Dupont <julien.dupont>
Severity: normal    
Priority: P3 CC: florian.barbin, julien.dupont, pierre-charles.david
Version: 3.1.0Keywords: triaged
Target Milestone: 5.1.2   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/116859
https://git.eclipse.org/r/116837
https://bugs.eclipse.org/bugs/show_bug.cgi?id=530850
https://git.eclipse.org/c/.git/commit/?id=85a7df28ad2e45c9ab2580fafe71a7ef8974b499
https://git.eclipse.org/c/sirius/org.git/commit/?id=a225bf13e81605751bb3dce80c362755109f86e3
https://git.eclipse.org/r/117268
https://git.eclipse.org/r/117267
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=cbe0d76108e5142c81e9f2ea8de2ce5a197c2a39
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=42ee8ff9babc9d50ff3e7a700c1b18bc3007e7bf
https://git.eclipse.org/r/117940
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=3029a61d6edb5c1f0ebe4c2424e6bdc75743d367
Whiteboard:
Bug Depends on:    
Bug Blocks: 530817, 530875, 531144    

Description Maxime Porhel CLA 2016-07-07 06:12:22 EDT
Steps to reproduce: 
. Create/open any modeling project with a semantic model and some representation
. Right clic the aird, clic "Export representations as images" and OK
. The session is closed, there is no decorator or children displayed under the aird and the semantic resources.
. The user needs to close/open or collapse/expand the ModelingProject to reopen it.

Note that if the project does not have the modeling project nature, it is also disturbing, the aird file has no more children as the session has been closed by the action and the user need to double click the aird or use the open menu to reopen the session. 

Looking at the code of org.eclipse.sirius.ui.tools.internal.actions.export.ExportRepresentationsFromFileAction, it looks like we get the current session or open a session on the selected aird (line 68:   Session session = SessionManager.INSTANCE.getSession..)

Then we take all representations and display the directory/imageType dialog and we execute a WorkspaceModifyingOperation in which we call SessionManager.openSession() (line 90) before calling the exportAction. 

After the export, ExportRepresentationsFromFileAction closes the session (line 98). 


There is a !isOpen check which seems to be here to avoid to close the session if it was already open before running the action but it is initalized at false and never updated. 
Before calling SessionManager.openSession line 90, we should get the status of the session created or retrieved line 68.
Comment 1 Pierre-Charles David CLA 2016-07-07 11:26:07 EDT
Confirmed, thanks for the report.
Comment 2 Eclipse Genie CLA 2018-02-07 09:24:50 EST
New Gerrit change created: https://git.eclipse.org/r/116859
Comment 3 Eclipse Genie CLA 2018-02-13 09:36:49 EST
Gerrit change https://git.eclipse.org/r/116837 was merged to [v5].
Commit: http://git.eclipse.org/c/.git/commit/?id=85a7df28ad2e45c9ab2580fafe71a7ef8974b499
Comment 5 Eclipse Genie CLA 2018-02-13 10:00:19 EST
New Gerrit change created: https://git.eclipse.org/r/117268
Comment 6 Eclipse Genie CLA 2018-02-13 10:00:21 EST
New Gerrit change created: https://git.eclipse.org/r/117267
Comment 7 Florian Barbin CLA 2018-02-14 07:37:41 EST
Merged on 5.1.x.
Comment 10 Eclipse Genie CLA 2018-02-22 07:41:10 EST
New Gerrit change created: https://git.eclipse.org/r/117940
Comment 12 Laurent Redor CLA 2018-06-28 12:11:20 EDT
Available in Sirius 5.1.2, see https://wiki.eclipse.org/Sirius/5.1.2 for details