Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: Rollie on December 03, 2008, 02:18:44 pm
-
I am trying to add @Model to the beginning of the Notes of Classes that are being transformed into Interfaces. In my transformation, @Model ends up in the transformed Interface, but the original notes from the source Class object are lost. I have tried several different things, but nothing seems to work.
Here is my transformation code for the Class macro:
%if elemType != "Class" and elemType != "Interface"%
%endTemplate%
Interface
{
%TRANSFORM_REFERENCE("Class")%
%TRANSFORM_CURRENT("language", "notes")%
language="Java"
notes=%qt%@Model\n%notes%%qt%
%list="ClassBase" @separator="\n" @indent=" "%
%list="ClassInterface" @separator="\n" @indent=" "%
%list="InnerClass" @separator="\n" @indent=" "%
%if elemType=="Class"%
%list="Attribute" @separator="\n" @indent=" "%
%endIf%
%list="Attribute__AsProperties" @separator="\n" @indent=" " attScope=="Public"%
%list="Operation" @separator="\n" @indent=" "%
}
%list="Connector" @separator="\n"%
-
The problem is that there is no such macro as %notes%. You'll need to use %classNotes%.
-
Thanks Simon. Worked like a charm!
-
The problem is that there is no such macro as %notes%. You'll need to use %classNotes%.
Sooo, is there any place that lists all the macros?
Or how to refer to a property from another element? My specific example is the "Alias" value from the "Domain Model" package. I wish to prefix all DDL Tranformed tables with this value, as part of the Tranformation.
TIA
Gary
-
I found a good list by searching for "Field Substitution Macros" in EA's Help Contents, and then selected the topic that displayed named "Field Substitution Macros." I think you will find your alias in that list.
Rollie
-
You can't directly access properties from a different element in the templates. (Except for direct information about elements at the end of a connector.)
The only way to do this, is to write an add-in and call EXEC_ADD_IN to get your add-in to find any information you want.