Author Topic: Code Generation Template  (Read 4733 times)

zalbina

  • EA User
  • **
  • Posts: 149
  • Karma: +0/-0
    • View Profile
Code Generation Template
« on: July 25, 2012, 06:13:36 pm »
Hi!

I've created my own custom template. How can I check if it works fine?

Thanks.

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: Code Generation Template
« Reply #1 on: July 25, 2012, 06:33:03 pm »
Generate some code and inspect it! :)
Using V12

zalbina

  • EA User
  • **
  • Posts: 149
  • Karma: +0/-0
    • View Profile
Re: Code Generation Template
« Reply #2 on: July 25, 2012, 06:37:14 pm »
I mean how can I run it an see the result?

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: Code Generation Template
« Reply #3 on: July 25, 2012, 06:40:00 pm »
Create a class for and generate the code - select the class on the diagram and press F11
Using V12

zalbina

  • EA User
  • **
  • Posts: 149
  • Karma: +0/-0
    • View Profile
Re: Code Generation Template
« Reply #4 on: July 26, 2012, 08:48:00 pm »
How to check class tag type (string for example) and change it if it's needed?

Thanks.

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: Code Generation Template
« Reply #5 on: July 26, 2012, 08:56:21 pm »
Hi
I dont really know what you mean
Please expand your question
Using V12

zalbina

  • EA User
  • **
  • Posts: 149
  • Karma: +0/-0
    • View Profile
Re: Code Generation Template
« Reply #6 on: July 26, 2012, 09:17:16 pm »
<%classTag some variable, but how to check the type of the tagged variable?

thanks.

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: Code Generation Template
« Reply #7 on: July 26, 2012, 09:23:47 pm »
Is this in your code template?
in what language are you generating code
Using V12

zalbina

  • EA User
  • **
  • Posts: 149
  • Karma: +0/-0
    • View Profile
Re: Code Generation Template
« Reply #8 on: July 26, 2012, 09:34:08 pm »
java

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Code Generation Template
« Reply #9 on: July 27, 2012, 12:32:26 am »
What do you mean with 'type of the tagged variable'??
If you have a tagged value applied to a variable (attribute) you should use %attTag% to lookup the tagged attributes and %attType% to get their type.
If you mean the type of the tagged value itself, there's no such thing, the values are all of type 'string'

HTH
Günther

zalbina

  • EA User
  • **
  • Posts: 149
  • Karma: +0/-0
    • View Profile
Re: Code Generation Template
« Reply #10 on: July 27, 2012, 04:06:05 am »
You are right, but what about tagged value applied to a variable (CLASS NOT AN ATTRIBUTE)? Can I have their type like %classType%? I did not found it.

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Code Generation Template
« Reply #11 on: July 27, 2012, 05:39:50 am »
Either I still don't get your intend or we have some semantical problem.
Let's try the other way round:
Could you please specify more details of your custom template, at wich context level it should be applied (class, operation, attributes, ...) show us the code you have and what you want to achieve as result.
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

zalbina

  • EA User
  • **
  • Posts: 149
  • Karma: +0/-0
    • View Profile
Re: Code Generation Template
« Reply #12 on: July 27, 2012, 04:00:24 pm »
Thanks a lot. Now it's clear with Makulik answer.