Book a Demo

Author Topic: Code Generation  (Read 3528 times)

rlopezpe

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Code Generation
« on: October 19, 2007, 06:25:08 am »
I've been working with EA and am trying to get some code done for ColdFusion. I modified some templates that someone else already created and so far so good.

But now I'm trying to generate code based on the relationship of two classes. For instance if I have a BaseClass with a Generalization link to a ChildClass ...I want to know that I have to extend BaseClass on ChildClass.

Can someone tell me how? I have tried lots of different ways and can't get the parent name through the templates.  It's sad that EA does no provide good documentation on code generation.

Thanks for any help you can provide.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code Generation
« Reply #1 on: October 21, 2007, 01:15:56 pm »
You're after linkParentName or linkParentQualName and these can be found at http://www.sparxsystems.com.au/EAUserGuide/index.html?fieldsubstitutionmacros.htm or in any existing template.

rlopezpe

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Code Generation
« Reply #2 on: October 25, 2007, 05:52:13 am »
Thank you for your response but I have tried that and the var linkParentName ??? is empty

Is there anything else that i have to do besides establishing the relationship?

Thanks for your help!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code Generation
« Reply #3 on: October 25, 2007, 12:56:42 pm »
Sorry, let me clarify further.

If you actually have a Generalization link to another class EA will execute the Linked Class Base template instead of the Class Base template, and that macro will be available.  If you don't have a generalization, but have a parent marked on the class it will use the Class Base template and you will need to use classBaseName.