Book a Demo

Author Topic: Code template generation failure and reference data (STM_C++)  (Read 2710 times)

bknoth2

  • EA User
  • **
  • Posts: 129
  • Karma: +2/-0
    • View Profile
I've been modfying and using the STM_C++ code generation templates and the process worked fine until about January. As of then, when I change a code generation template the generated code does not change (I've experimented on two different computers and with V13.5 and 14.1 of EA and removed and reinstalled EA).

Today, I exported the STM_C++ templates as reference data and discovered that an exported file contains many copies of a modified template (for example "Stm Context Include"), each with a different GUID. My modifications will show up in one copy of a template but they don't show up in generated code. Also, I can make simple edits to the exported reference data and re-import it, but those modifications don't show up in EA's template editor, so the imported reference data isn't overwriting whatever EA considers to be the live template. I've bulk-changed all entries in the exported templates, re-imported them, and they still don't show up in EA's template editor or in the generated code.

I'm completely blocked. Any insights, anyone?
Thanks in advance.
Bruce

Here's a link to my post where I described the problem originally: https://www.sparxsystems.com/forums/smf/index.php/topic,42056.msg251409.html#msg251409

bknoth2

  • EA User
  • **
  • Posts: 129
  • Karma: +2/-0
    • View Profile
Re: Code template generation failure and reference data (STM_C++)
« Reply #1 on: May 15, 2019, 06:35:36 am »
I dug into the database and here's the subsequent bug report I submitted to Sparx:

Version 14.1 with a Postgres database. I model in 14.1 and generate code with 13.5.

When I make edits to the STM_C++ templates and generate code, the changes do not show up in the edited code. I've rebooted, reinstalled EA, etc.

I now know the root cause of the problem. The t_template table in the EA database has 44 copies of each template! Each has the same template name and template type but a different templateid. The template editor edits one of the entries in the table but a different entry is used to generate the code (I know that's true because I changed a template directly in the database and those changes show up in the generated code. When I change the template in the template editor, the changes show up in a different template entry in the database).