Book a Demo

Author Topic: Help with writing Transformations  (Read 2679 times)

Fred Bevan

  • EA User
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
Help with writing Transformations
« on: August 15, 2011, 11:33:24 pm »
I am struggling a bit with writing Transformation templates. In general, I am wondering if there are any better or more detailed descriptions and examples of how to write them than is found in the help?

Here is my specific question. I am trying to transform a Conceptual Data Model to a Logical Data Model. As part of the transformation, I want to change the stereotype for all attributes to “Attribute - Logical Data Model” except for attributes that currently have stereotypes of “Primary Key”, which should remain the same.

My code is below. The result I am getting is that all attributes are changed to “Attribute - Conceptual Data Model” (i.e. only the “else” code runs). Does anyone know what I am doing wrong?

Thanks,

Fred

Code: [Select]
Attribute
{
      %TRANSFORM_REFERENCE()%
      %TRANSFORM_CURRENT("stereotype")%
      %if attStereotype == "Primary Key"%      
            stereotype="Primary Key"
      %else%
            stereotype="Attribute - Logical Data Model"
      %endif%
}

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Help with writing Transformations
« Reply #1 on: August 16, 2011, 08:42:20 am »
The reference in the help is fairly comprehensive, but it doesn't include examples.

If only the else clause is running for you, then I'd say that the most likely cause is that you don't have any attributes with the stereotype of "Primary Key".