Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Load ressources in UML model
[ATL] Load ressources in UML model [message #528090] Mon, 19 April 2010 10:22 Go to next message
Damien Chapon is currently offline Damien ChaponFriend
Messages: 5
Registered: April 2010
Location: Toulouse - France
Junior Member
Hi all,

I am coding in ATL a model transformation to a UML model. In my targeted .uml model I got a UML class with some properties inside. I would like to type these properties with other UML class that I defined in another .uml file. How can I do that in ATL???

When creating a .uml model, I can load another .uml file with a "load resources" function and then apply the new loaded types in my .uml models... Is there a similar function or a way to do that in ATL?

Thank you for your help!
Damien
Re: [ATL] Load ressources in UML model [message #528102 is a reply to message #528090] Mon, 19 April 2010 11:28 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
Just add the other model as input in your transformation and activate the "allow inter model references" option.

Then you can do things like :

type <- UML2!Class.allInstancesFrom('MyOtherModel')->select(e | e.name = 'MyType')->first()
Re: [ATL] Load ressources in UML model [message #528412 is a reply to message #528102] Tue, 20 April 2010 12:38 Go to previous messageGo to next message
Damien Chapon is currently offline Damien ChaponFriend
Messages: 5
Registered: April 2010
Location: Toulouse - France
Junior Member
Thank you Sylvain!

Your solution seems great Sylvain, but unfortunately I didn't succeed to use it...

I adapted this code to my problem:
type <- UML2!Class.allInstancesFrom('MyOtherModel')->select(e | e.name = 'MyType')->first()
and when launching the transformation there is no mistake, but the types of my properties are still empty...

How can print in the console the value of "UML2!Class.allInstancesFrom('MyOtherModel')->select(e | e.name = 'MyType')->first()" in order to investigate what happens?

Regards,
Damien
Re: [ATL] Load ressources in UML model [message #528417 is a reply to message #528090] Tue, 20 April 2010 13:00 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
UML2!Class.allInstancesFrom('MyOtherModel')->select(e | e.name = 'MyType')->first().debug('debug')

debug is a function that takes self as input and returns self while printing self to the console.

Have you activated the allow inter model references option ? This option allows a model to reference others (MyOtherModel here). If it's off then it won't work.
Re: [ATL] Load ressources in UML model [message #528422 is a reply to message #528417] Tue, 20 April 2010 13:24 Go to previous message
Damien Chapon is currently offline Damien ChaponFriend
Messages: 5
Registered: April 2010
Location: Toulouse - France
Junior Member
It works!

My mistake was that I was referencing the .di2 (Papyrus UML diagram) and not the .uml. Shame on me Sad
Your tip with the debug function helps me discovered this mistake.

Thank you very much Sylvain!!

Previous Topic:[QVTO] Extending a transformation does not work together with disjuncts (bug?)
Next Topic:QVT GMF Integration
Goto Forum:
  


Current Time: Tue Oct 15 21:46:05 GMT 2019

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

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

Back to the top