Book a Demo

Author Topic: Model Transformation -- class model to DDL  (Read 3604 times)

siva02

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Model Transformation -- class model to DDL
« on: July 30, 2010, 03:58:26 am »
I could not get the entity / attribute names with spaces to become underscore as ERwin does.  At least could not find any intuitive way.

This is what I would like to do..
In Logical Class model
Class name : "PRODUCT Master"
Attribute names : "PROUCT MASTER ID", "PRODUCT Master NAME"
(intentionally having mixed case in logical class model)

While Tansforming I would like to get
Table --> Product_Master
Columns --> Product_Master_Id, Product_Master_Name

Tried Convert_name a bit.. could get Pascal case tohelp me in the upper/lower cases.  However Underscore could not work together with
that. Any one could help me here please?

Siva

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Model Transformation -- class model to DDL
« Reply #1 on: July 30, 2010, 08:21:55 am »
From the help file
Quote
Example 1: To capitalize the first letter of each word and separate multiple words with a space:

"Ht( )Ht" to output "My Variable Table"

Just change the space in there to an underscore.  So you want:
Code: [Select]
%CONVERT_NAME(attName, "Spaced", "Ht(_)Ht")%
« Last Edit: July 30, 2010, 08:22:55 am by simonm »

siva02

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Model Transformation -- class model to DDL
« Reply #2 on: July 30, 2010, 11:23:19 pm »
Simon,

Thanks... It works.  I was missing "Spaced" in the original format.

Regards,

Siva

siva02

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Model Transformation -- class model to DDL
« Reply #3 on: August 03, 2010, 12:24:22 am »
For everyone's benefit...  

I went to
Settings-->Transformation Templates
Picked "DDL" from the Language ( since I was transforming to DDL/Physical ER Model )
Selected(double click) templates which I would like to transform... For eg., in this case "Attribute", and Added one additional line for converting the name.  Template looked as below after the change:
********
Column
{
  %TRANSFORM_CURRENT("type", "stereotype", "collection", "constant", "containment", "ordered", "static", "volatile")%
  name=%qt%%CONVERT_NAME(attName, "Spaced", "Ht(_)Ht")%%qt%
  type=%qt%%CONVERT_TYPE(genOptDefaultDatabase,attType)%%qt%
}
********

The line I added as per Simon's response is
  name=%qt%%CONVERT_NAME(attName, "Spaced", "Ht(_)Ht")%%qt%

Hope this is helpful.

Regards,

Siva