Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » how select elements in a specific element
how select elements in a specific element [message #762087] Wed, 07 December 2011 09:27 Go to next message
Fi Fi is currently offline Fi Fi
Messages: 133
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 09:35]

Report message to a moderator

Re: how select elements in a specific element [message #763210 is a reply to message #762087] Fri, 09 December 2011 06:07 Go to previous messageGo to next message
giovi disanto is currently offline giovi disanto
Messages: 58
Registered: September 2011
Member
i don't understand your question... you must select this elements in the from part of a rule? your metamodel have opposite reference?
Re: how select elements in a specific element [message #763275 is a reply to message #763210] Fri, 09 December 2011 08:37 Go to previous messageGo to next message
Fi Fi is currently offline Fi Fi
Messages: 133
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 Sad
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 08:40]

Report message to a moderator

Re: how select elements in a specific element [message #763776 is a reply to message #763275] Sat, 10 December 2011 09:53 Go to previous message
giovi disanto is currently offline giovi disanto
Messages: 58
Registered: September 2011
Member
if you have a unique variable for select the specific B class, you can use select form allInstances of B class and navigate reference of C classes inside...
Previous Topic:ATL transformation programmatically inter model reference
Next Topic:Re: [M2M] model2xhtml QVT problem
Goto Forum:
  


Current Time: Tue Jul 29 23:04:00 EDT 2014

Powered by FUDForum. Page generated in 0.01653 seconds