Book a Demo

Author Topic: Code Template  (Read 4464 times)

KooT

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Code Template
« on: February 17, 2010, 01:21:39 am »
I have another problem in code generation.

I got <<interface>> class witch have in return type another class.
Becouse i need to have array structure in return.

How can i access to atributes of return class in template editor?
« Last Edit: February 17, 2010, 01:21:50 am by rafalkot »

Joshua.Lamorie

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Code Template
« Reply #1 on: February 20, 2010, 09:43:06 am »
I am unable to answer your question, but I have a simple one to add.

How can I insert a dollar-sign '$' into a code template?  I haven't been able to figure out the escape method.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code Template
« Reply #2 on: February 22, 2010, 08:31:27 am »
You can't access attributes of a return type from the code template editor directly.  If you need to do that you'll need to use an add-in call.  Do a search for EXEC_ADD_IN for examples.

%dl% - http://www.sparxsystems.com.au/uml_tool_guide/sdk_for_enterprise_architect/literaltext.html
« Last Edit: February 22, 2010, 08:35:23 am by simonm »

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Code Template
« Reply #3 on: February 22, 2010, 09:51:02 pm »
Quote
I am unable to answer your question, but I have a simple one to add.

How can I insert a dollar-sign '$' into a code template?  I haven't been able to figure out the escape method.
This one should help you:
http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1251291090/1#1

WBR
günther

KooT

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Code Template
« Reply #4 on: March 01, 2010, 08:35:00 pm »
Quote
You can't access attributes of a return type from the code template editor directly.  If you need to do that you'll need to use an add-in call.  Do a search for EXEC_ADD_IN for examples.

So the only way is to write adin? Should it be C# or Visual Basic? I need to compile it to dll? Where can i find samples? here on sparx web pages, or in google? :)



Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: Code Template
« Reply #5 on: March 01, 2010, 08:49:57 pm »
Quote
So the only way is to write adin? Should it be C# or Visual Basic? I need to compile it to dll? Where can i find samples? here on sparx web pages, or in google? :)

The add-in can be in either C#or VB and must be made available as a DLL. The online help has some valuable information on how to deply those. The only challenge here is the assembly registration.
Upon interest you can download the EA protocol handler from sourceforge including sources which has an addin including installer. You can base your work on this.

Oliver