Skip to main content



      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 06:22 Go to next message
Eclipse UserFriend
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 07:28 Go to previous messageGo to next message
Eclipse UserFriend
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 08:38 Go to previous messageGo to next message
Eclipse UserFriend
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 09:00 Go to previous messageGo to next message
Eclipse UserFriend
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 09:24 Go to previous message
Eclipse UserFriend
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: Fri Jul 04 21:13:25 EDT 2025

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

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

Back to the top