Apart from the request above, I do have an issue with templates and class hierarchies:
in my meta-model diagram I have a BaseEntity, then a DerivedEntity which inherits from the former:
- ClassInheritanceDiagram.png (5.25 KiB) Viewed 58998 times
They have one associated template each, BaseEntityTemplate and DerivedEntityTemplate.
BaseEntityTemplate selects by means of Build.allBaseEntity. DerivedEntityTemplate by means of Build.allDerivedEntity.
They both produce an output file with the same "rules", say: output/path/xxxEntity.name.java.
- BaseEntityTemplate.png (8.03 KiB) Viewed 58998 times
- DerivedEntityTemplate.png (8.62 KiB) Viewed 58998 times
In my specific "instantiated" model, I have and instance of BaseEntity (MyBase) and an instance of DerivedEntity (MyDerived).
When I generate output starting from empty target folder, everything goes fine:
- Code: Select all
*** Generate for scope ClassInheritance - src @ 11/06/11 14.10
Processing template com.example.classinheritance.templates.BaseEntityTemplate ...
MyBase -> output/path/MyBase.java ... (Created)
MyDerived -> output/path/MyDerived.java ... (Created)
Processing template com.example.classinheritance.templates.DerivedEntityTemplate ...
MyDerived -> output/path/MyDerived.java ... (Overwritten)
*** End Generate for scope ClassInheritance @ 11/06/11 14.10 after 0.076 sec
*** processed 3 files, 2 new files, 1 file overwritten, wrote a total of 411 bytes.
scanning folder P/ClassInheritance for project config files..
But when I try to generate again the output without emptying the target folder, e.g. normally after some saved change, I got the following error:
- Code: Select all
*** Generate for scope ClassInheritance - src @ 11/06/11 14.12
Processing template com.example.classinheritance.templates.BaseEntityTemplate ...
MyBase -> output/path/MyBase.java ... (No Changes)
Generation Error in template com.example.classinheritance.templates.BaseEntityTemplate:
Attempted to overwrite the file src/output/path/MyDerived.java which was generated by another template!
Context stack:
- Build.allBaseEntity: BaseEntity=MyDerived
*** End Generate for scope ClassInheritance @ 11/06/11 14.12 after 0.017 sec
!!! 1 error, processed 1 file, 1 file unchanged, wrote a total of 0 bytes.
... and I suspect that after this error the output generation interrupts and does not update the remaining files. In this case, DerivedEntityTemplate is not run at all, as BaseEntityTemplate has encountered an error.
Anyway, how do I avoid this?
Thanks for your attention again.
Cheers
PS Please find attached the eclipse-exported project