Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: jarnold30 on July 06, 2022, 03:57:46 am
-
Hi all.
I have created a new language (prolog) for code generation.
The elements I am trying to generate off are classes with stereotypes.
I have created stereotyped overrides using 'add new stereotypes override'. I have set the language for each element to 'prolog'.
When I try to generate code, nothing happens. No files are created.
What am I doing wrong?
-
Set aside that I would not use that strange macro stuff, what are your exact steps? Just "it does onot work" is not enough for debugging.
q.
-
When I select 'Generate', it claims success but no files are created.
I know that's not much to go on, but it's what I have.
John
-
Did you actually create the code generation templates?
Geert
-
I created a number of stereotype overrides
-
I created a number of stereotype overrides
On the templates for which language?
IIRC you first have to define the templates for your language, and then change the templates to match your language.
You can use stereotype overrides, to differentiate between different type of classes within your language.
Geert
-
I don't understand what you mean. I have defined some stereotype overrides, what more do I need to do?
Sorry, I'm definitely a noob at this
-
When you create the stereotype override, what do you see in the dropdown on the top that says "Language"?
Geert
-
It says 'prolog'
-
You need to create templates to transform the model into Prolog otherwise you won't get any output.
This link explains about the code templates.
https://sparxsystems.com/enterprise_architect_user_guide/16.0/modeling_domains/codetemplates_2.html (https://sparxsystems.com/enterprise_architect_user_guide/16.0/modeling_domains/codetemplates_2.html)
-
Thanks. I have read this doc, but it's still not clear to me what I need to do to actually generate code. Are there any examples anywhere?
-
OK, I found out how it all works by looking at the java templates. Phew!
Thanks for your help everyone