Book a Demo

Author Topic: Attributes of LinkedAttribute  (Read 3265 times)

Richard D Vodden

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Attributes of LinkedAttribute
« on: June 02, 2015, 02:54:43 am »
Hey all,

I'm stuck on getting some code gen to work. I'm trying to generate a yaml file from a class diagram, and I want to show the properties of linked attributes. I'm only going to one level - so I shouldn't get any loop problems.

In my project I have a class - called Super. This has an aggregation to part link to another class, called Sub. The Sub class has two attributes - att1 and att2.



I have a Class Body template which runs through all the attributes and linked attributes just fine:

Code: [Select]
%list="Attribute" @separator="\n" @indent="    "%

I've created a new Custom Template called Class__ClassParameters, this is called from my linked attribute class as follows:

Code: [Select]
   %qt%%linkAttRole%%qt% {
          %qt%type%qt%: %qt%object%qt%,
          %qt%description%qt%: %qt% %LinkedAttributeNotes%%qt%,
          %qt%properties%qt%: {
$type=%linkAttName%
          %list="Class__ClassParameters" className==$type %
          }


This calls the template exactly as i expect, but when I get it to report the $className from the Class__ClassParameters template:

Code: [Select]
ClassName: %className%

It returns Super - not Sub. Has anyone got any idea what I'm doing wrong?