Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 12:19 Go to next message
Giacomo Lamonaco is currently offline Giacomo LamonacoFriend
Messages: 5
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 12: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 19:19 Go to previous message
Giacomo Lamonaco is currently offline Giacomo LamonacoFriend
Messages: 5
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!
Previous Topic:Problems - AMW and XML Schemas
Next Topic:Problems with 'generateModelRef()' from output model.
Goto Forum:
  


Current Time: Thu Mar 28 18:50:15 GMT 2024

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

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

Back to the top