| Summary: | Semantic models not automatically detected when converting into a Modeling Project | ||
|---|---|---|---|
| Product: | [Modeling] Sirius | Reporter: | Pierre-Charles David <pierre-charles.david> |
| Component: | Core | Assignee: | Maxime Porhel <maxime.porhel> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P2 | CC: | christian.pontesegger, maxime.porhel |
| Version: | 1.0.0M7 | Keywords: | triaged |
| Target Milestone: | 1.0.1 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 439791 | ||
|
Description
Pierre-Charles David
Note that an easy workaround is to explicitly add the semantic models to the session using eh "Project Dependencies", so this does not need to be fixed for 1.0.0. In ModelingProjectManagerImpl.doAddModelingNature(), the getSession call returns null (l339):
> if (optionalModelingProject.get().getSession() != null) {
> // add semantic resources if already existing in the project
> addSemanticResources(project, ..
> }
So it does not look for existing semantic resources.
org.eclipse.sirius.business.api.modelingproject.ModelingProject.getMainRepresentationsFileURI(IProgressMonitor) is called in getSession() , but we do not force the computation, and mainRepresentationUri is still null as it has not been computed yet.
During the add of the modeling nature, we should explicitely compute the main representationURi, it might be done in org.eclipse.sirius.ui.tools.internal.views.common.modelingproject.manager.ModelingProjectManagerImpl.createLocalRepresentationsFile(IProject, IProgressMonitor) juste after the session creation operation.
I think this previously worked because of a listener, adapter, or some asynchronous initialization of the project. But the safe way is to do it explicitely when the ModelingProjectManagerImpl creates the main aird.
I confirm my previous comment and analysis. In the current use case, when we create a new representation file, the ModelingProject is set as invalid and has no mainRepresentationURI, we known we have to compute it. Note that if an empty representation file is in the project, when use the convert action, all semantic resources are well added. Corrected by commit 9bf1a1e4b917d04e2c4f2222a8b59fcaccfa0874 *** Bug 442763 has been marked as a duplicate of this bug. *** Available in Sirius 1.0.1. |