Skip to main content


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 14:27 Go to next message
Fy Za is currently offline Fy ZaFriend
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 #763210 is a reply to message #762087] Fri, 09 December 2011 11:07 Go to previous messageGo to next message
giovi disanto is currently offline giovi disantoFriend
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 13:37 Go to previous messageGo to next message
Fy Za is currently offline Fy ZaFriend
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 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 13: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 14:53 Go to previous message
giovi disanto is currently offline giovi disantoFriend
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: Wed Apr 24 18:08:33 GMT 2024

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

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

Back to the top