Hi Sebastian,
Here's a way to duplicate a set of code generation templates. It's a little involved, so if you've just got one or two individual templates to duplicate, copy/paste works better.
So let's say you've got a language A which you've written a bunch of templates for, and a language B which you want to duplicate the templates to.
First off, each language you write code generation templates for must have at least one datatype defined, otherwise EA won't recognize it as a language at all. You can do this in Settings -- Code Engineering Datatypes, or by clicking New Language in the code template editor; they both open the same dialog. So the A language already exists, but you must also add a B language.
Next, export your templates to XML (Project -- Model Import/Export -- Export Reference Data).
Open the XML file in a text editor and locate the string
<DataSet name="A_Code_Template"That's the beginning of the XML node that holds all the templates for language A. (There are more attributes, so I've omitted the closing bracket intentionally.)
Make a copy of that entire XML node with all its child nodes (<DataRow> nodes containing four <Column> nodes each). In the copy, change the DataSet name to "B_Code_Template".
Within each <DataRow> in the "B_Code_Template" DataSet, change the value of the Column named TemplateType from "A_Code_Template" to "B_Code_Template", and create a new GUID for each TemplateID Column.
Reimport the XML file to EA.
A very similar approach can be applied to duplicate a set of transformation templates, except there's no need to define a new language for those, and instead of "(language)_Code_Template", the string to look for is "(transform)_Transform_Template".
You should be aware that only templates which have been modified are included in the export, so you can't duplicate EA's built-in templates this way.
HTH,
/Uffe