Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] Involve Java code?
[QVTO] Involve Java code? [message #460796] Sun, 02 August 2009 09:44 Go to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Is it possible to let some computations be done by Java code? So it must
be possible to invoke Java methods in a mapping - a kind of pre- or
post-processor. I'm thinking of that because in my model one can specify
a address to a wsdl or wadl file. It would be nice if I could implement
a method evaluating the address and by that generate some other elements
in my model. If it isn't possible with QVTO but with another
transformation language I would appreciate hints as well.

best regards
Gilbert
Re: [QVTO] Involve Java code? [message #463034 is a reply to message #460796] Sun, 02 August 2009 15:44 Go to previous messageGo to next message
Krzysztof Kowalczyk is currently offline Krzysztof KowalczykFriend
Messages: 113
Registered: July 2009
Senior Member
Gilbert Mirenque pisze:
> Is it possible to let some computations be done by Java code? So it must
> be possible to invoke Java methods in a mapping - a kind of pre- or
> post-processor. I'm thinking of that because in my model one can specify
> a address to a wsdl or wadl file. It would be nice if I could implement
> a method evaluating the address and by that generate some other elements
> in my model. If it isn't possible with QVTO but with another
> transformation language I would appreciate hints as well.
>
> best regards
> Gilbert

I am not sure about QVTo(I think it does not work yet), but it should be
easy in Xtend from M2T Xpand project and ETL from Epsilon project.

To read about Epsilon and ETL check the link:
http://www.eclipse.org/gmt/epsilon/

Xtend is a M2M language based on OCL but differs a lot from QVTo. It is
a part of M2T Xpand project so it is hard to find ;)

In Xtend you can define function that call Java static function in any
place of the transformation. You can also load XML file with XML Schema
in similar way you handle EMF models. So it should be possible to create
one function that load the WSDL file and then you could use Xtend to
analyse that file and transform your model.

Xpand / Xtend was a mature product, but it has just migrated to Eclipse
and now have really bad documentation (http://wiki.eclipse.org/Xpand)
and you need to look information in different places:
- eclipse.modelling.m2t newsgroup to ask questions
- you use update site or install Eclipse distribution from itemis.eu for
newest version (as the one that comes with Eclipse Modelling Package
does not have documentation)
- you use old Xpand documentation if you want to check how it looks like
but don't want to install it
http://www.openarchitectureware.org/pub/documentation/4.3.1/ html/contents/

Regards,
Krzysztof Kowalczyk
Re: [QVTO] Involve Java code? [message #463637 is a reply to message #460796] Sun, 02 August 2009 17:26 Go to previous messageGo to next message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 171
Registered: July 2009
Senior Member
Hi Gilbert ,

QVTo supports black-box libraries externally implemented in Java.
This is described in Help in "QVT Operational Developer Guide/Black-box
implementation support" section.

Also there's an example of such Java library available with
'Examples/Operational QVT Transformation/Black-box Library Definition'
wizard. Given that example plug-in is deployed in platform it can be
accessed from QVTo transformation source as follows:

import m2m.qvt.oml.ExampleJavaLib;

modeltype ecore uses "http://www.eclipse.org/emf/2002/Ecore";

transformation NewTransformation() access UtilLib;

main() {
var date : ecore::EDate := createDate('2008-10-31');
var isBefore := date.before(createDate('2008-11-01'));

var eClass := object ecore::EClass {};
var qname := eClass.getQualifiedName();
}


Regards,
Sergey


Gilbert Mirenque wrote:
> Is it possible to let some computations be done by Java code? So it must
> be possible to invoke Java methods in a mapping - a kind of pre- or
> post-processor. I'm thinking of that because in my model one can specify
> a address to a wsdl or wadl file. It would be nice if I could implement
> a method evaluating the address and by that generate some other elements
> in my model. If it isn't possible with QVTO but with another
> transformation language I would appreciate hints as well.
>
> best regards
> Gilbert
Re: [QVTO] Involve Java code? [message #464494 is a reply to message #463637] Sun, 02 August 2009 19:09 Go to previous messageGo to next message
Krzysztof Kowalczyk is currently offline Krzysztof KowalczykFriend
Messages: 113
Registered: July 2009
Senior Member
Sergey Boyko pisze:
> Hi Gilbert ,
>
> QVTo supports black-box libraries externally implemented in Java.
> This is described in Help in "QVT Operational Developer Guide/Black-box
> implementation support" section.
>

Nice to know that black-box operations are supported.
QVTo lack some online documentation so one could check it to know what
is supported without need of downloading each new version.

Regards,
Krzysztof Kowalczyk
Re: [QVTO] Involve Java code? [message #464677 is a reply to message #464494] Sun, 02 August 2009 20:04 Go to previous messageGo to next message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 171
Registered: July 2009
Senior Member
Hi Krzysztof ,

You're absolutely right, our wiki is quite scant at the moment. We're
going to improve it for the Helios release.

Btw, there's link to QVTo N&N:
http://wiki.eclipse.org/M2M/QVTO/New_and_Noteworthy/Galileo

Regards,
Sergey

Krzysztof Kowalczyk wrote:
> Sergey Boyko pisze:
>
> Nice to know that black-box operations are supported.
> QVTo lack some online documentation so one could check it to know what
> is supported without need of downloading each new version.
>
> Regards,
> Krzysztof Kowalczyk
Re: [QVTO] Involve Java code? [message #467868 is a reply to message #463637] Mon, 03 August 2009 09:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Thanks Sergey, sounds perfect. I will check it out.
Re: [QVTO] Involve Java code? [message #468141 is a reply to message #463637] Tue, 04 August 2009 10:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Sergey Boyko wrote:
> Hi Gilbert ,
>
> QVTo supports black-box libraries externally implemented in Java.
> This is described in Help in "QVT Operational Developer Guide/Black-box
> implementation support" section.

where do I find this help?
Re: [QVTO] Involve Java code? [message #468145 is a reply to message #468141] Tue, 04 August 2009 10:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Gilbert Mirenque wrote:
> where do I find this help?

I'm interested in it because I want to read for example about what does
"@Operation(contextual=true)" mean exactly.
Re: [QVTO] Involve Java code? [message #468152 is a reply to message #463637] Tue, 04 August 2009 11:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Sergey,
thanks a lot for that hint. It is perfect. But a link with further
information would be nice.

best regards
Gilbert
Re: [QVTO] Involve Java code? [message #468264 is a reply to message #468145] Tue, 04 August 2009 18:31 Go to previous messageGo to next message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 171
Registered: July 2009
Senior Member
Just open menu "Help / Help Contents". When opened in Contents section
there'll be "QVT Operational Developer Guide".

Of course running Eclipse platform should have QVTo installed.

Gilbert Mirenque wrote:
> Gilbert Mirenque wrote:
>> where do I find this help?
>
> I'm interested in it because I want to read for example about what does
> "@Operation(contextual=true)" mean exactly.
Re: [QVTO] Involve Java code? [message #468269 is a reply to message #468264] Tue, 04 August 2009 18:41 Go to previous messageGo to next message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 171
Registered: July 2009
Senior Member
Just copy-paste from the guide:

Contextual operation
--------------------
Operation 'physically' owned by the defining library but having a
contextual type to be used as the source object of operation calls. It
is defined as a public Java operation of which the first argument is
reserved for passing the source object (contextual instance) of the
call. This is indicated by marking the operation by the predefined
annotation @Operation(contextual=true).
Remark:
At the moment, the java operation is required to be static, however in
the future, the non-static variant will be support as well, thus
offering the benefit of access to a state shared per library instance.


Sergey Boyko wrote:
> Just open menu "Help / Help Contents". When opened in Contents section
> there'll be "QVT Operational Developer Guide".
>
> Of course running Eclipse platform should have QVTo installed.
>
> Gilbert Mirenque wrote:
>> Gilbert Mirenque wrote:
>>> where do I find this help?
>>
>> I'm interested in it because I want to read for example about what does
>> "@Operation(contextual=true)" mean exactly.
Re: [QVTO] Involve Java code? [message #468354 is a reply to message #468264] Wed, 05 August 2009 08:40 Go to previous message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Sergey Boyko wrote:
> Just open menu "Help / Help Contents". When opened in Contents section
> there'll be "QVT Operational Developer Guide".
Damn it. I'm a so don't-into-the-Eclipse-help-looker. Sorry
Previous Topic:write a atl rule
Next Topic:[QVTO] building OCL Query in qvto
Goto Forum:
  


Current Time: Wed Feb 05 14:52:48 GMT 2025

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

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

Back to the top