|
Re: Loading Representation File(s) [message #1781821 is a reply to message #1781806] |
Tue, 13 February 2018 15:05 |
|
Hi Muhammad,
You should load only the Sirius session, it will load all the necessaray resources (semantic, representation, ... ) in the same resource set (and in the same way than Capella if you open the aird by double clic or with the contextual menu)
After calling
Session session = SessionManager.INSTANCE.getSession(URI.createURI(projectName+"/"+airdFile), new NullProgressMonitor());
You need to call session.open()
Note that you do not need to call your loadModel method (it would load the semantic model in your own resourceSet without any reference to/from the session)
Note also that if your Capella project is open, SessionManager.INSTANCE.getSession() will return the loaded session, and you will manipulate the same object than the workbench. In this case, calling session.open will do nothing, but you should avoid to close it at the end of your generation to keep the session in the same state than before your action.
Regards
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: Loading Representation File(s) [message #1781900 is a reply to message #1781845] |
Wed, 14 February 2018 12:32 |
|
Hi,
Note that you will have a DView for each activated Viewpoint and then each DView will contain a DRepresentation or a DRepresentationDescriptor regarding the Sirius version used to create the aird.
Note that the current behavior of the SessionFactory is to create the aird file if the uri you pass to the session manager does not exits. As the aird your provide is not empty and as in debug you see a DAnalysis with an empty DView collection, it seems that the uri you give to the session manager is not the one you expect : you should check the construction of the aird file uri. You should look at org.eclipse.emf.common.util.URI.createPlatformResourceURI(String, boolean) instead of createURI.
For example, with file an org.eclipse.core.resources.IFile:
String path = file.getFullPath().toOSString();
URI uri = URI.createPlatformResourceURI(path, true);
Regards
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.01844 seconds