how select elements in a specific element [message #762087] |
Wed, 07 December 2011 14:27 |
Fy Za Messages: 245 Registered: March 2010 |
Senior Member |
|
|
Hi All,
generally, when we want to select all instances of a meta-class,
we do : MetaModel! ClassA.allInstances (). asSequence ()
but, if we have like this
ClassA : has_B 0..* ClassB
ClassB : has_c 0..* ClassC
ClassC : has_c_children 0..* ClassC --recursive reference
and I want to select all ClassC elements but in a specific ClassB element
and not in all the model
How do It ??
PLZ help me
thanks
[Updated on: Wed, 07 December 2011 14:35] Report message to a moderator
|
|
|
|
Re: how select elements in a specific element [message #763275 is a reply to message #763210] |
Fri, 09 December 2011 13:37 |
Fy Za Messages: 245 Registered: March 2010 |
Senior Member |
|
|
Hi giovi,
It can be a part from a rule or also helper.
if I have opposite references, the problem is solved but I haven't
for Example, I have a XMI model like this
<a:A>
<b:B>
<c:C>
<c1:C>
<c3:C>
<c:C>
<c1:C>
<c2:C>
<c3:C>
<c1:C>
<c3:C>
</b>
<b:B>
<c:C>
<c2:C>
<c1:C>
<c:C>
<c2:C>
<c1:C>
<c2:C>
<c3:C>
<c:C>
</b>
</a>
I have a metamodel similar to this
class A :
reference b to Class B
class B :
reference c to Class C
Class C :
reference c1 to Class C
reference c2 to Class C
reference c3 to Class C
for example if a apply my helper named getAllC to the first B element
the helper returs a Sequence of C elements : {c, c1,c3,c,c1,c2,c3,c1,c3}
[Updated on: Fri, 09 December 2011 13:40] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03305 seconds