Book a Demo

Author Topic: Need to add to Notes during transformation  (Read 3654 times)

Rollie

  • EA User
  • **
  • Posts: 22
  • Karma: +0/-0
    • View Profile
Need to add to Notes during transformation
« 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"%
« Last Edit: December 03, 2008, 02:20:23 pm by Rollie »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8107
  • Karma: +119/-20
    • View Profile
Re: Need to add to Notes during transformation
« Reply #1 on: December 04, 2008, 09:07:23 am »
The problem is that there is no such macro as %notes%.  You'll need to use %classNotes%.

Rollie

  • EA User
  • **
  • Posts: 22
  • Karma: +0/-0
    • View Profile
Re: Need to add to Notes during transformation
« Reply #2 on: December 04, 2008, 10:10:08 am »
Thanks Simon.  Worked like a charm!

Gary W.

  • EA User
  • **
  • Posts: 139
  • Karma: +0/-0
    • View Profile
Re: Need to add to Notes during transformation
« Reply #3 on: December 06, 2008, 11:25:40 am »
Quote
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

Rollie

  • EA User
  • **
  • Posts: 22
  • Karma: +0/-0
    • View Profile
Re: Need to add to Notes during transformation
« Reply #4 on: December 07, 2008, 06:25:26 pm »
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

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8107
  • Karma: +119/-20
    • View Profile
Re: Need to add to Notes during transformation
« Reply #5 on: December 08, 2008, 08:01:32 am »
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.