Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Unable to get hierarchy in table
Unable to get hierarchy in table [message #1231402] Tue, 14 January 2014 10:41 Go to next message
Wilbert Alberts is currently offline Wilbert Alberts
Messages: 91
Registered: June 2010
Member
Hi,

I try to put a bounded recursive structure in a table. The meta model contains a class C which on its turn might contain another instance of type C.

C <>---> [0..1] C

I created an model instance looking like: c1{c2{c3}}. So c1 contains c2 which contains c3 which does not contain any C instance anymore.

I would like to visualize this in a table like:

c1
+--c2
   +--c3

Therefore I created a linemapping CLineMapping which imports itself in order to facilitate the recursion.

However I end up with a table looking like:

c1
+--c2
   +--c3
c2
+--c3
c3


So c2 and c3 are present multiple times. How do I limit them? I suppose that this is a rather trivial task and I must be overlooking something but I don't see it.

Any ideas?

Greetings,
Wilbert.

Re: Unable to get hierarchy in table [message #1231409 is a reply to message #1231402] Tue, 14 January 2014 11:00 Go to previous messageGo to next message
Florian Barbin is currently offline Florian Barbin
Messages: 31
Registered: August 2010
Member
Hi Wilbert,

It seems that your 'Semantic Candidates Expression' on your line mapping
is not restrictive enough. Try to restrict the semantic candidates to
the first containment level with this expression for example:
[eContents()/]

Best regards,

Florian

On 14/01/2014 16:41, Wilbert Alberts wrote:
> Hi,
> I try to put a bounded recursive structure in a table. The meta model
> contains a class C which on its turn might contain another instance of
> type C.
>
> C <>---> [0..1] C
>
> I created an model instance looking like: c1{c2{c3}}. So c1 contains c2
> which contains c3 which does not contain any C instance anymore.
>
> I would like to visualize this in a table like:
>
> c1
> +--c2
> +--c3
> Therefore I created a linemapping CLineMapping which imports itself in
> order to facilitate the recursion.
>
> However I end up with a table looking like:
>
> c1
> +--c2
> +--c3
> c2
> +--c3
> c3
>
> So c2 and c3 are present multiple times. How do I limit them? I suppose
> that this is a rather trivial task and I must be overlooking something
> but I don't see it.
>
> Any ideas?
>
> Greetings,
> Wilbert.
>
>
Re: Unable to get hierarchy in table [message #1231412 is a reply to message #1231409] Tue, 14 January 2014 11:08 Go to previous message
Wilbert Alberts is currently offline Wilbert Alberts
Messages: 91
Registered: June 2010
Member
Marvellous!

That did the trick. I knew it had to be something simple.

Thanks!

Greetings,
Wilbert.
Previous Topic:Unable to show derived values in table colum
Next Topic:Edge connections to list elements
Goto Forum:
  


Current Time: Thu Aug 28 07:33:03 EDT 2014

Powered by FUDForum. Page generated in 0.02051 seconds