Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Extending template with dynamic overriding and class inheritance
[Acceleo] Extending template with dynamic overriding and class inheritance [message #879652] |
Thu, 31 May 2012 15:34 |
Michaël Melchiore Messages: 47 Registered: April 2012 |
Member |
|
|
Hi,
I have been experimenting with template dynamic overriding for a few days. It is a very convenient feature that was worth switching to Acceleo 3 for.
Yet, there is one case I cannot make to work :
Metamodels
Metamodel MM1
-- Package mm1
-- -- Class ModelRoot --containing C1 and C2 instances--
-- -- Class C1
-- -- Class C2
Metamodel MM2
-- Package mm2
-- -- Class RandomClass
-- -- Package addon
-- -- -- Class C3 extends C1
-- -- -- Class C4 extends C2
Acceleo
Module M1 based on MM1
template T0(ModelRoot) --main template=entry point
template T1(C1, String, String) --called by T0
template T2(C2, String, String) --called by T0
Module M2 extending module M1 and based on MM1 and MM2
template T1(C3, String, String) overriding T1
template T2(C4, String, String) overriding T2
MM2 and M2 are part of an addon that can specialize the output of M1 generator for some specific instances of C1 and C2. To do so, the addon features a M2M transformation that processes ModelRoot and replaces targeted instances of C1 and C2 with instances of C3 and C4. Then, M2 provides overriding versions of T1 for those specific classes.
This works... mostly. For a reason that still escapes me, T1(C3) is never activated while T2(C4) is. The editor does show the following error:
template T1(C3, String, String) overriding T1
^^
No public template 'T1' found.
If I replace C3 with C1, the error disappears. This seams to indicate that C3 is not recognized as a subclass of C1. This is strange since the editor let me access inherited C1 attributes from the template body !
I cannot send the project I am working on. Worse, I have been unable to reproduce the behavior on an example. Could you guys have directions as to where I should investigate ?
Michaël
Edit: I am using Acceleo 3.2.1.v20120511-0335 with Eclipse 3.6.2.M20110210-1200
[Updated on: Fri, 01 June 2012 06:50] Report message to a moderator
|
|
| | | |
Goto Forum:
Current Time: Mon Sep 23 20:56:00 GMT 2024
Powered by FUDForum. Page generated in 0.03812 seconds
|