Home » Archived » M2M (model-to-model transformation) » [QVTO] transformation reuse by extension?
[QVTO] transformation reuse by extension? [message #101313] |
Mon, 09 March 2009 05:29  |
Eclipse User |
|
|
|
Hi all,
In slide 25 of [1] it says that transformations can be reused:
transformation MMaToMMbExt(in ma : MMa, out mb : MMb)
extends transformation MMaToMMb(in MMa, out MMb);
But this does not work for me:
transformation testTransf(in library : Library, out myLib : MyLib)
extends transformation testTransf_basic(in library : Library, out myLib : MyLib);
Eclipse tells me that 'Transformation module usages not supported'.
The transformation works with the extends-line.
Did I miss something or is it indeed not yet supported?
Cheers
Patrick
[1] http://www.eclipse.org/m2m/qvto/doc/M2M-QVTO.pdf
|
|
|
Re: [QVTO] transformation reuse by extension? [message #101347 is a reply to message #101313] |
Mon, 09 March 2009 06:21   |
Eclipse User |
|
|
|
Hi Patrick,
Reuse by extension is not ready yet, the slide is about QVTO in general,
so it may happpen that something is still missing ;).
However, you can use composition of transformations.
Just use the statement for import of a compilation unit and
explicit instantiation of the aggregated transformation.
In case you declare a module usage like " access ComposedTransf(...",
you still get the problem reported,
but the import statement is enough to make things work.
We will fix this misbehaviour soon.
Regards,
/Radek
On Mon, 09 Mar 2009 10:29:19 +0100, Patrick Könemann <pk@imm.dtu.dk> wrote:
> Hi all,
>
> In slide 25 of [1] it says that transformations can be reused:
>
> transformation MMaToMMbExt(in ma : MMa, out mb : MMb)
> extends transformation MMaToMMb(in MMa, out MMb);
>
> But this does not work for me:
>
> transformation testTransf(in library : Library, out myLib : MyLib)
> extends transformation testTransf_basic(in library : Library, out
> myLib : MyLib);
>
> Eclipse tells me that 'Transformation module usages not supported'.
> The transformation works with the extends-line.
>
> Did I miss something or is it indeed not yet supported?
>
>
> Cheers
> Patrick
>
>
> [1] http://www.eclipse.org/m2m/qvto/doc/M2M-QVTO.pdf
|
|
|
Re: [QVTO] transformation reuse by extension? [message #101369 is a reply to message #101347] |
Mon, 09 March 2009 06:50   |
Eclipse User |
|
|
|
Hi Radek,
Allright, thanks for hint! It almost works - but only almost:
Transformation testTransfA imports testTransfB, instantiates it and calls transform().
That works fine. However, I override some some mappings and this produces an exception:
----------> testTransfA <----------
import testTransfB_basic;
transformation testTransf(in library : Library, out myLib : MyLib)
extends transformation testTransfB_basic(in library : Library, out myLib : MyLib);
main() {
new testTransfB_basic(library, myLib).transform();
}
-- this is the critical mapping which produces the exception
mapping SpecialBook::toMyBook() : MyBook inherits Book::toMyBook {
...
}
----------> testTransfB <----------
transformation testTransfB_basic(in library : Library, out myLib : MyLib);
main() {
...
}
mapping Book::toMyBook() : MyBook {
...
}
-----------------------------------
If I remove 'mapping SpecialBook::toMyBook()', then the transformation works.
If I put all mappings into one single transformation, the transformation also works.
But the files as shown above produce a NPE in the error log:
java.lang.NullPointerException
at org.eclipse.m2m.internal.qvt.oml.ast.env.QvtOperationalEvalu ationEnv.createInstance(QvtOperationalEvaluationEnv.java:428 )
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.createInstance(QvtOperationalEvaluationVi sitorImpl.java:1963)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.getOutOwner(QvtOperationalEvaluationVisit orImpl.java:1812)
....
Any ideas?
Patrick
On 09-03-2009 11:21, Radek Dvorak wrote:
> Hi Patrick,
>
> Reuse by extension is not ready yet, the slide is about QVTO in general,
> so it may happpen that something is still missing ;).
>
> However, you can use composition of transformations.
> Just use the statement for import of a compilation unit and
> explicit instantiation of the aggregated transformation.
>
> In case you declare a module usage like " access ComposedTransf(...",
> you still get the problem reported,
> but the import statement is enough to make things work.
> We will fix this misbehaviour soon.
>
>
> Regards,
> /Radek
>
>
>
> On Mon, 09 Mar 2009 10:29:19 +0100, Patrick Könemann <pk@imm.dtu.dk> wrote:
>
>> Hi all,
>>
>> In slide 25 of [1] it says that transformations can be reused:
>>
>> transformation MMaToMMbExt(in ma : MMa, out mb : MMb)
>> extends transformation MMaToMMb(in MMa, out MMb);
>>
>> But this does not work for me:
>>
>> transformation testTransf(in library : Library, out myLib : MyLib)
>> extends transformation testTransf_basic(in library : Library, out
>> myLib : MyLib);
>>
>> Eclipse tells me that 'Transformation module usages not supported'.
>> The transformation works with the extends-line.
>>
>> Did I miss something or is it indeed not yet supported?
>>
>>
>> Cheers
>> Patrick
>>
>>
>> [1] http://www.eclipse.org/m2m/qvto/doc/M2M-QVTO.pdf
|
|
|
Re: [QVTO] transformation reuse by extension? [message #101379 is a reply to message #101369] |
Mon, 09 March 2009 07:16  |
Eclipse User |
|
|
|
Thanks for finding this, I will investigate the problem.
/Radek
On Mon, 09 Mar 2009 11:50:30 +0100, Patrick Könemann <pk@imm.dtu.dk> wrote:
> Hi Radek,
>
> Allright, thanks for hint! It almost works - but only almost:
>
> Transformation testTransfA imports testTransfB, instantiates it and
> calls transform().
> That works fine. However, I override some some mappings and this
> produces an exception:
>
> ----------> testTransfA <----------
> import testTransfB_basic;
> transformation testTransf(in library : Library, out myLib : MyLib)
> extends transformation testTransfB_basic(in library : Library, out
> myLib : MyLib);
>
> main() {
> new testTransfB_basic(library, myLib).transform();
> }
>
> -- this is the critical mapping which produces the exception
> mapping SpecialBook::toMyBook() : MyBook inherits Book::toMyBook {
> ...
> }
> ----------> testTransfB <----------
> transformation testTransfB_basic(in library : Library, out myLib :
> MyLib);
>
> main() {
> ...
> }
>
> mapping Book::toMyBook() : MyBook {
> ...
> }
> -----------------------------------
>
> If I remove 'mapping SpecialBook::toMyBook()', then the transformation
> works.
> If I put all mappings into one single transformation, the transformation
> also works.
> But the files as shown above produce a NPE in the error log:
>
> java.lang.NullPointerException
> at
> org.eclipse.m2m.internal.qvt.oml.ast.env.QvtOperationalEvalu ationEnv.createInstance(QvtOperationalEvaluationEnv.java:428 )
> at
> org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.createInstance(QvtOperationalEvaluationVi sitorImpl.java:1963)
> at
> org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.getOutOwner(QvtOperationalEvaluationVisit orImpl.java:1812)
> ...
>
> Any ideas?
>
> Patrick
>
>
> On 09-03-2009 11:21, Radek Dvorak wrote:
>> Hi Patrick,
>>
>> Reuse by extension is not ready yet, the slide is about QVTO in general,
>> so it may happpen that something is still missing ;).
>>
>> However, you can use composition of transformations.
>> Just use the statement for import of a compilation unit and
>> explicit instantiation of the aggregated transformation.
>>
>> In case you declare a module usage like " access ComposedTransf(...",
>> you still get the problem reported,
>> but the import statement is enough to make things work.
>> We will fix this misbehaviour soon.
>>
>>
>> Regards,
>> /Radek
>>
>>
>>
>> On Mon, 09 Mar 2009 10:29:19 +0100, Patrick Könemann <pk@imm.dtu.dk>
>> wrote:
>>
>>> Hi all,
>>>
>>> In slide 25 of [1] it says that transformations can be reused:
>>>
>>> transformation MMaToMMbExt(in ma : MMa, out mb : MMb)
>>> extends transformation MMaToMMb(in MMa, out MMb);
>>>
>>> But this does not work for me:
>>>
>>> transformation testTransf(in library : Library, out myLib : MyLib)
>>> extends transformation testTransf_basic(in library : Library, out
>>> myLib : MyLib);
>>>
>>> Eclipse tells me that 'Transformation module usages not supported'.
>>> The transformation works with the extends-line.
>>>
>>> Did I miss something or is it indeed not yet supported?
>>>
>>>
>>> Cheers
>>> Patrick
>>>
>>>
>>> [1] http://www.eclipse.org/m2m/qvto/doc/M2M-QVTO.pdf
>
|
|
|
Goto Forum:
Current Time: Fri Jun 06 01:42:15 EDT 2025
Powered by FUDForum. Page generated in 0.03738 seconds
|