| Extract Model Element Type with getReferredElement [message #897068] |
Sat, 21 July 2012 08:19  |
Giacomo Lamonaco Messages: 2 Registered: July 2012 |
Junior Member |
|
|
Hi all!
I need to create an ATL trasformation that, starting from a weaving model and two generic model, allows to generate a new weaving model.
My interested is related to the instances of the two input model.
In the weaving model i have information about the metaclass relation, and i want to generate all'instance starting from this relation, not knowing the metamodels of the input models.
I've founded this function, getReferredElement, that seems to be right for me, but when i call it i receive an oclundefined element.
Starting from this result, i can call allInstancesFrom('left or right model') n order to obtain the instances.
Where i'm wronging?
Thanks
[Updated on: Sat, 21 July 2012 08:20] Report message to a moderator
|
|
|
| Re: Extract Model Element Type with getReferredElement [message #897100 is a reply to message #897068] |
Sat, 21 July 2012 15:19  |
Giacomo Lamonaco Messages: 2 Registered: July 2012 |
Junior Member |
|
|
Maybe i've an answer.
If you wanna generate all instances of a model m which is conforms to a metamodel mm (mm is conforms to Ecore) not knowing the metamodel at 'compile time', you can use this strategy:
(create .. from .. ART : ARTMM) -- ART is artifact
s.debug(MOF!EClass.allInstancesFrom('ARTMM')->collect(i | i.allInstancesFrom('ART')));
Naturally we can play with the desidered MOF type (in this case EClass) in order to be more generic
I hope this is right!
|
|
|
Powered by
FUDForum. Page generated in 0.01427 seconds