Book a Demo

Author Topic: Transform attribute to table  (Read 3586 times)

novikovigor

  • EA User
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
Transform attribute to table
« on: June 13, 2013, 09:44:04 pm »
Hello! Sorry for my bad English!

I need to write transformation script.
This script must transform attribute, tagged with a specific value, to separate table. One attribute (with a specific tagged value) => one table.
I don't understand which template should be modified ("Attribute", "Class" or other) and code that i must write.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Transform attribute to table
« Reply #1 on: June 14, 2013, 08:52:05 am »
You need to modify the Attribute template (because that's where the template looks at source attributes).

Something like this will get you going.
Code: [Select]
%if attTag:"isTable" == "True%
Class
{
name=%qt%%attName%qt%
}
%endTemplate%

Normal attribute code here

novikovigor

  • EA User
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
Re: Transform attribute to table
« Reply #2 on: June 14, 2013, 06:38:43 pm »
Thanks a lot, Simon! It helps!
And now there is another trouble. I need to create xref element for new table. If I write
Code: [Select]
%TRANSFORM_REFERENCE("Table")%xref has source id the same as parent class, so I need to create xref with unique source GUID to realize relationship between new table (aka attribute-table) and parent.
« Last Edit: June 14, 2013, 06:39:09 pm by novikovigor »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Transform attribute to table
« Reply #3 on: June 17, 2013, 09:05:05 am »
Code: [Select]
%TRANSFORM_REFERENCE("Table",attGUID)%

novikovigor

  • EA User
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
Re: Transform attribute to table
« Reply #4 on: June 17, 2013, 05:39:52 pm »
Thanks! It helps too!
Sorry for so stupid quiestions, I'm new in EA.