Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Invoking java code modules within an ATL transformation
Invoking java code modules within an ATL transformation [message #106991] Tue, 23 June 2009 10:16 Go to next message
Philipp Simon is currently offline Philipp SimonFriend
Messages: 26
Registered: July 2009
Junior Member
Hi,

we need to call java code during a transformation to determine the value
of some attributes. It seems to be generally possible but the solution
suggested in
http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg00519.html
looks pretty wild considering that this probably is not an usual use case?
Since it the post dates to 2007 and i can't seem to find any updates on
that topic i would like to know if there have been enhancements to the atl
environment covering this topic?

Thanks a lot in advance for any replies!

Philipp
Re: Invoking java code modules within an ATL transformation [message #107086 is a reply to message #106991] Wed, 24 June 2009 15:16 Go to previous messageGo to next message
Guillaume Hillairet is currently offline Guillaume HillairetFriend
Messages: 97
Registered: July 2009
Member
Hi,

What you can do is to define EOperation in your ecore model. Then use the
EMF code generator to get Java classes for your model. Now you can add
external method calls in methods corresponding to the EOperation.
You have to launch your transformation from Java code with the EMF VM
launcher.
In your transformation, you simply call EOperation like this
object.methodName() and it will execute your java code.

Regards,
Guillaume.


Philipp Simon wrote:

> Hi,

> we need to call java code during a transformation to determine the value
> of some attributes. It seems to be generally possible but the solution
> suggested in
> http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg00519.html
> looks pretty wild considering that this probably is not an usual use case?
> Since it the post dates to 2007 and i can't seem to find any updates on
> that topic i would like to know if there have been enhancements to the atl
> environment covering this topic?

> Thanks a lot in advance for any replies!

> Philipp
Re: Invoking java code modules within an ATL transformation [message #107162 is a reply to message #107086] Thu, 25 June 2009 07:59 Go to previous message
Philipp Simon is currently offline Philipp SimonFriend
Messages: 26
Registered: July 2009
Junior Member
Thanks alot for that explanation. While qvt's blackbox mechanism would
somehow be more desireable i guess the two mentioned ways will somehow
give us a way to do what we desire :).

Thanks again,
Philipp
Previous Topic:[ATL] Lazy rules & resolveTemp?
Next Topic:NoSuchMethodError: org.eclipse.m2m.atl.core.emf.EMFInjector.inject()
Goto Forum:
  


Current Time: Thu Apr 25 20:21:48 GMT 2024

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

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

Back to the top