Book a Demo

Author Topic: Creating Attributes within Connector Template  (Read 3082 times)

dannodj

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Creating Attributes within Connector Template
« on: January 29, 2010, 03:53:54 am »
Hi,
What I would like to do is create an attribute for a Foreign Key within the target end of an association.  I can see how the DDL template works, but it is creating columns, rather than attributes - I think this makes a difference.  I am trying the following code, but the Attribute tag is unexpected when I run the transform.

     Target
      {
        %TRANSFORM_REFERENCE("XSDClass",connectorDestElemGUID)%
        %TRANSFORM_CURRENT("Target","Direction", "Multiplicity","role", "Constraint")%
                  Multiplicity=%qt%$destMult%qt%
                  role=%qt%%CONVERT_NAME(connectorDestElemName,"Underscored", "Pascal Case")%%qt%
                  
                  Constraint=""
                  
                  Attribute
                  {
                        name="TESTID"
                        type="xs:integer"
                  }
      }


Can I include an attribute this way, if so how does it work in a template?
Thanks
Dan

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Creating Attributes within Connector Template
« Reply #1 on: February 01, 2010, 01:38:35 pm »
Foreign keys are a special case because they link to particular columns.  You can't do this for regular connectors.  However, if you modify the class template to list over the connectors within the class type, you could add the attribute creation outside the connector from the connector template.

dannodj

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Creating Attributes within Connector Template
« Reply #2 on: February 02, 2010, 02:05:13 am »
thanks, I've modified the Class template to create an attribute for specific types of association.

Cheers for the help