Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: zalbina on July 25, 2012, 06:13:36 pm

Title: Code Generation Template
Post by: zalbina 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.
Title: Re: Code Generation Template
Post by: SomersetGraham on July 25, 2012, 06:33:03 pm
Generate some code and inspect it! :)
Title: Re: Code Generation Template
Post by: zalbina on July 25, 2012, 06:37:14 pm
I mean how can I run it an see the result?
Title: Re: Code Generation Template
Post by: SomersetGraham 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
Title: Re: Code Generation Template
Post by: zalbina 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.
Title: Re: Code Generation Template
Post by: SomersetGraham on July 26, 2012, 08:56:21 pm
Hi
I dont really know what you mean
Please expand your question
Title: Re: Code Generation Template
Post by: zalbina on July 26, 2012, 09:17:16 pm
<%classTag some variable, but how to check the type of the tagged variable?

thanks.
Title: Re: Code Generation Template
Post by: SomersetGraham on July 26, 2012, 09:23:47 pm
Is this in your code template?
in what language are you generating code
Title: Re: Code Generation Template
Post by: zalbina on July 26, 2012, 09:34:08 pm
java
Title: Re: Code Generation Template
Post by: Makulik 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
Title: Re: Code Generation Template
Post by: zalbina 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.
Title: Re: Code Generation Template
Post by: g.makulik 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.
Title: Re: Code Generation Template
Post by: zalbina on July 27, 2012, 04:00:24 pm
Thanks a lot. Now it's clear with Makulik answer.