|
Re: Diagrams based on multiple/shared resource [message #1696055 is a reply to message #1695279] |
Thu, 21 May 2015 12:44 |
|
Hi Koen
Le 13/05/2015 11:33, Koen Staal a écrit :
> My current representation is created using a "main" file that uses other
> files. These files are defined in the main file as "import". When the
> representation is created i programmatically add these files using
> Session.addSemanticResource.
> Currently when someone adds an import after the creation the session
> resources does not get updated. Also In the same session there might be
> a different representation with the same import.
>
Using import simply imports a file into your project.
If you want representations on your semantic models, rather than making
code calling Session.addSemanticResource, you can simply use "Add Model"
in contextual menu on your aird file. [1]
> My question: How do i correctly update the resources of the session?
>
>
> A trick could be to add the import to the representation but never draw
> them, this will give the opportunity to call Session.addSemanticResource
> if the resouce/file was not already added. But then when deleting a
> resource from the session i will have to check all representations
> within the session to check if the resource is used by any
> representation, this seems kinda heavy on the workload.
>
> Maybe i can point sirius to a method where it described which
> resources/files are used for a representation.
To remove a semantic model use "Remove model" on your model under
"Project dependencies" tree node.
Regard
Laurent
[1]
https://www.eclipse.org/sirius/doc/user/general/Modeling%20Project.html#ProjectDependencies
Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Re: Diagrams based on multiple/shared resource [message #1696127 is a reply to message #1696055] |
Fri, 22 May 2015 08:53 |
Koen Staal Messages: 70 Registered: October 2014 |
Member |
|
|
Thanks for your response. It helped in some way.
I came to the conclusion that adding the resources is not the problem but rather the way the diagram gets updated.
I am using xtext to write my own language, where it is able to import another file. I will try to explain my problem with a simplified situation below:
--------
MainFile.txt
import secondFile.txt
class Patrick extends Parent
..
secondFile.txt
class Suzanne extends Parent
..
--------
Both files are in the project in the same folder.
When creating a (parent)diagram of the mainfile, this will show Patrick and Suzanne.
When changing the name of Suzanne to Suz in secondFile and saving it, the diagram will show an error. It can no longer find the reference to suzanne.
When saving the mainfile the diagram gets updated correctly, suzanne is now changed to suz. (Saving the mainfile to add changes in an other file is not what i want my users to do)
How can i make sure the diagram gets updated when a referenced resource gets changed?
[Updated on: Fri, 22 May 2015 08:57] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03288 seconds