Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to use diagram extension
How to use diagram extension [message #1708675] Fri, 18 September 2015 14:57 Go to next message
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 195
Registered: June 2010
Senior Member
Hi,

I have two languages (related to each other) and want to present one editor to my users. However I want to create two VSP projects such that the mappings and tools related to the two languages can be developed separately.

So I have a language L1, containing the notion of System. In language L2 I have the notion of ComposedSystem which extends L1::System.

In VSP1, I create a diagram description (ModelDiagram) with a layer allowing visualisation of System nodes and a tool that allows creation of Systems.

In VSP2, I create a diagram extension which adds another layer: ComposedSystem. This layer contains a Tool section with a tool that creates a Composed System.

I can verify that this works to some extent in the sense that after creating a Model and a ModelDiagram, I can activate the ComposedSystem layer; the tool appears.

However, I am not capable of creating a new ComposedSystem. My problem is that, on the ModelDiagram, a ComposedSystem should be rendered by the same mapping as the System. So I would like to refer to a Node Mapping of VSP1 in a tool that is defined in a VSP2. I don't seem to be able to do that. I created a separate Node Mapping for ComposedSystem in VSP2. Now the tool definition can be completed but the editor does not allow creation of the ComposedSystem node mappings on the diagram defined by VSP1.

How do I reuse a Node mapping defined in VSP1 in a layer defined in VSP2; or am I conceptually on the wrong track?

Greetings,
Wilbert.
Re: How to use diagram extension [message #1708916 is a reply to message #1708675] Tue, 22 September 2015 13:05 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 554
Registered: July 2009
Senior Member
Le 18/09/2015 16:57, Wilbert Alberts a écrit :
> However, I am not capable of creating a new ComposedSystem. My problem
> is that, on the ModelDiagram, a ComposedSystem should be rendered by the
> same mapping as the System. So I would like to refer to a Node Mapping
> of VSP1 in a tool that is defined in a VSP2. I don't seem to be able to
> do that.

You should be able to if you first make the first VSM (from VSP1)
available in the context of the editor for VSP2. Inside the VSM editor
(with VSP2 loaded), right-click and select "Load resource...". Enter the
"viewpoint:" URI you used in the Diagram Extension (something like
viewpoint:/vsp1.design/V1). The VSM from VSP1 should now be available,
and all the tools and mappings it defines become visible in the relevant
UIs, for example in the "Reused Mappings" property of your additional
layer (accessible on the "Import" property section).

PS: Make sure you load the referenced VSM using a "viewpoint:/" URI,
which will work whether you are at development-time with all your VSPs
in your workspace, or at runtime with the modelers deployed.

--
Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to use diagram extension [message #1709241 is a reply to message #1708916] Fri, 25 September 2015 08:04 Go to previous messageGo to next message
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 195
Registered: June 2010
Senior Member
Hi Pierre-Charles,

Thank you for your answer. Especially the tip to use the viewpoint uri will increase the robustness.

I have an additional question (out of curiosity).

Assume Language L1 and L2. Both are supported by an editor specified in separate VSP's being VSP1 and VSP2.

Language L2 depends on L1. VSP2 extends VSP1 by diagram extension mechanisms.

I expected no dependency form VSP1 to VSP2. However, when I added a diagram representation creation tool in VSP2, I noticed that VSP1 was changed (and become dependent on VSP2). (More detail: the diagram extension allowed creation of a 'VSP2-ish' diagram from a diagram node mapping defined in VSP1. As I would like to be able to have two teams working on VSP1 and VSP2, such (cyclic) dependency might become unhandy.

Why did VSP1 become dependent on VSP2?


Greetings,
Wilbert.

Re: How to use diagram extension [message #1709278 is a reply to message #1709241] Fri, 25 September 2015 14:36 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 554
Registered: July 2009
Senior Member
Le 25/09/2015 10:04, Wilbert Alberts a écrit :
> Assume Language L1 and L2. Both are supported by an editor specified in
> separate VSP's being VSP1 and VSP2.
> Language L2 depends on L1. VSP2 extends VSP1 by diagram extension
> mechanisms.
> I expected no dependency form VSP1 to VSP2. However, when I added a
> diagram representation creation tool in VSP2, I noticed that VSP1 was
> changed (and become dependent on VSP2). (More detail: the diagram
> extension allowed creation of a 'VSP2-ish' diagram from a diagram node
> mapping defined in VSP1. As I would like to be able to have two teams
> working on VSP1 and VSP2, such (cyclic) dependency might become unhandy.
>
> Why did VSP1 become dependent on VSP2?

This is probably because of some leftover bi-directional references in
our VSM metamodel. When an element in VSP2 references an element in
VSP1, because the reference is declared bi-directional EMF ensures the
eOpposite reference is also added from VSP1 to VSP2.

We've removed most of these kinds of references over the years, exactly
for the reason you describe, but there are a few left that we haven't
tackled yet.

--
Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to use diagram extension [message #1710533 is a reply to message #1709278] Wed, 07 October 2015 10:46 Go to previous message
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 195
Registered: June 2010
Senior Member
Hi Pierre-Charles,

Should I consider these remaining bi-directional dependencies as bugs? Are there plans to remove them? I really appreciate the ability to develop various viewpoints in parallel and these dependencies might complicate integration of them. I am willing to document them as I find them and file a bug report if desired.

The one that I did encounter is related with a Diagram Extension containing a Diagram Creation tool. Adding such tool seems to add a dependency in the mapping that allows creation of the new diagram. That mapping is defined viewpoint owning the extended diagram.

Greetings,
Wilbert.

[Updated on: Wed, 07 October 2015 10:52]

Report message to a moderator

Previous Topic:Diagram layout is still kept when closed editor without saving
Next Topic:Sirius based Editor with several tabs
Goto Forum:
  


Current Time: Thu Jan 21 09:27:32 GMT 2021

Powered by FUDForum. Page generated in 0.01709 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top