Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » NodeMappingImport loses bordered nodes of imported node
NodeMappingImport loses bordered nodes of imported node [message #1719939] Wed, 13 January 2016 11:11 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 392
Registered: December 2015
Senior Member
Hi,

I am trying to understand the Sirius Documentation, more specifically
the section on node mapping imports:

https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#diagram_extension

I have attached an example that's based on the sample family model from
sirius:

I added two additional classes Wallet and Lover, and two new containment
references to the Man class: wallet, lovers.

I then added a BorderedNode to the existing Man mapping, so that a Man's
wallet is displayed as a BorderedNode in a family diagram. This works fine.

I now add a Diagram Extension that defines an additional layer which
should also display a Man's lover as a bordered node. To do so, I create
a NodeMappingImport which imports the original Man mapping. I then add a
new BorderedNodeMapping child that will create bordered nodes for a
man's lover.

Now, from the documentation I understand that if I enable the extension
layer, a Man should display both, bordered nodes for wallets, and
bordered nodes for lovers. What happens however is that when I enable
the extension layer, the lovers nodes appear but the wallets nodes
disappear. If this is expected behaviour, then the documentation is
quite misleading.

Thanks for comments,
Felix
Re: NodeMappingImport loses bordered nodes of imported node [message #1720836 is a reply to message #1719939] Thu, 21 January 2016 10:46 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 270
Registered: August 2010
Senior Member
Hi Felix,

By default the sub-nodes of an imported mapping are not displayed. You
need to explicitly add the border node you want to reuse in "Reused
Bordered Node Mappings" in the "Import" tab.

Regards,


--
Florian - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: NodeMappingImport loses bordered nodes of imported node [message #1720969 is a reply to message #1720836] Fri, 22 January 2016 09:14 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 392
Registered: December 2015
Senior Member
Hi Florian,

On 21-Jan-16 11:46, Florian Barbin wrote:
> By default the sub-nodes of an imported mapping are not displayed. You
> need to explicitly add the border node you want to reuse in "Reused
> Bordered Node Mappings" in the "Import" tab.

I see. So if I am the maintainer of an extension like that, I have to
continuously monitor the extended .odesign files for additions/removals
of its child bordered nodes, or I risk that my extension doesn't show
nodes that have been newly added, or also that my extension shows nodes
that have been removed.

So I have this crazy idea to avoid this problem, maybe you have
comments: Shouldn't it be possible that I 'fix' my extension dynamically
at runtime by updating its mapping model so that it always reuses
exactly the bordered nodes of the imported mapping plus my own added
borded node.

Felix
Re: NodeMappingImport loses bordered nodes of imported node [message #1720984 is a reply to message #1720969] Fri, 22 January 2016 09:42 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 270
Registered: August 2010
Senior Member
Hi Felix,

On 01/22/2016 10:14 AM, Felix Dorner wrote:
> Hi Florian,
>
> On 21-Jan-16 11:46, Florian Barbin wrote:
>> By default the sub-nodes of an imported mapping are not displayed. You
>> need to explicitly add the border node you want to reuse in "Reused
>> Bordered Node Mappings" in the "Import" tab.
>
> I see. So if I am the maintainer of an extension like that, I have to
> continuously monitor the extended .odesign files for additions/removals
> of its child bordered nodes, or I risk that my extension doesn't show
> nodes that have been newly added, or also that my extension shows nodes
> that have been removed.

I agree with that. Ideally, the specifier should have the possibility to
add all imported mapping sub-node by default. That sounds like a good
feature request.
>
> So I have this crazy idea to avoid this problem, maybe you have
> comments: Shouldn't it be possible that I 'fix' my extension dynamically
> at runtime by updating its mapping model so that it always reuses
> exactly the bordered nodes of the imported mapping plus my own added
> borded node.

It is a possibility. But you have to make sure the VSM model is properly
updated before opening any representation to avoid a refresh with the
"old" VSM.

>
> Felix


--
Florian - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: NodeMappingImport loses bordered nodes of imported node [message #1720999 is a reply to message #1720984] Fri, 22 January 2016 11:41 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 392
Registered: December 2015
Senior Member
On 22-Jan-16 10:42, Florian Barbin wrote:
> Hi Felix,
>
> On 01/22/2016 10:14 AM, Felix Dorner wrote:
>> Hi Florian,
>>
>> On 21-Jan-16 11:46, Florian Barbin wrote:
>>> By default the sub-nodes of an imported mapping are not displayed. You
>>> need to explicitly add the border node you want to reuse in "Reused
>>> Bordered Node Mappings" in the "Import" tab.
>>
>> I see. So if I am the maintainer of an extension like that, I have to
>> continuously monitor the extended .odesign files for additions/removals
>> of its child bordered nodes, or I risk that my extension doesn't show
>> nodes that have been newly added, or also that my extension shows nodes
>> that have been removed.
>
> I agree with that. Ideally, the specifier should have the possibility to
> add all imported mapping sub-node by default. That sounds like a good
> feature request.

You mean in the specifier editor? That would save some time, but still
keep the maintenance burden, since the imported mapping might change
over time.

>>
>> So I have this crazy idea to avoid this problem, maybe you have
>> comments: Shouldn't it be possible that I 'fix' my extension dynamically
>> at runtime by updating its mapping model so that it always reuses
>> exactly the bordered nodes of the imported mapping plus my own added
>> borded node.
>
> It is a possibility. But you have to make sure the VSM model is properly
> updated before opening any representation to avoid a refresh with the
> "old" VSM.

I will have a look, but IIRC the ViewpointRegistry API will give me a
hard time to transform/update a VSM model before it's registered (or used..)

>
>>
>> Felix
>
>
Previous Topic:Make diagram readonly and hide pallet
Next Topic:Enable layer programatically
Goto Forum:
  


Current Time: Fri Apr 26 00:29:20 GMT 2024

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

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

Back to the top