Skip to main content



      Home
Home » Archived » AMW » Extract Model Element Type with getReferredElement(Get element type information starting from a weaving model)
Extract Model Element Type with getReferredElement [message #897068] Sat, 21 July 2012 08:19 Go to next message
Eclipse UserFriend
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] by Moderator

Re: Extract Model Element Type with getReferredElement [message #897100 is a reply to message #897068] Sat, 21 July 2012 15:19 Go to previous message
Eclipse UserFriend
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!
Previous Topic:Problems - AMW and XML Schemas
Next Topic:Problems with 'generateModelRef()' from output model.
Goto Forum:
  


Current Time: Fri Mar 21 07:09:22 EDT 2025

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

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

Back to the top