Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: zalbina on September 13, 2012, 07:33:35 pm
-
Hello,
I would like to ask how can I call my user defined template from Class or Attribute templates for example. I tried %myTemplate%, but it did not worked.
Thanks.
-
That's the way it is supposed to 'call' templates. I guess there's either something wrong inside your template or the path where it's called is not reached. Did you try something simple 1st (as just outputtting some comment text)?
Best regards,
Günther
-
I see. The Code inside the template is fine, but when I'm putting it inside the custom template it looks like the template was not called at all. How can I check the pass or what ever can I check?
Thanks.
-
Type of master (calling) template and custom template need to match.
What did you try? Executing the code directly in the master template works, but replacing it with %custom_template% doesn't? Can you show (excerpts) of the template code?
Best regards,
Günther
-
From class template I call my custom template:
%Class_DDlCLASSG%.
-
Can you show a bit more please, that's not helpful for an analysis (use code formatting for your post).
Although I can see that template types seem to be correct.
-
%if classStereotype == "Error" %
%Class_DDLFROMCLASS%
CREATE TABLE %qt%%CONVERT_NAME(className, "Pascal Case","Camel Case")%%qt%
(\n
%list="Attribute" @separator="\n" @indent=" "%
)GO
%endTemplate%
%ClassNotes%
%PI=" "%
%ClassDeclaration%
%ClassBody%
-
So do you see the follow up statements after
%Class_DDLFROMCLASS%
as expected? Can you show, what you've got inside your custom template?
-
Double underscore.
-
Thanks Simon, I didn't spot that. I rarely use custom templates if it can be avoided.
-
Ooh, I see. That's my mistake.
Thanks for everybody.