Book a Demo

Author Topic: Creating a Script Fragment Not Working for me  (Read 2195 times)

aniforatos

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Creating a Script Fragment Not Working for me
« on: April 23, 2024, 09:03:42 pm »
Hello,

I have been trying to follow an example from this site: https://sparxsystems.com/enterprise_architect_user_guide/16.1/model_publishing/custom_script_fragments.html

I have been able to run my script through the scripting window but it does not generate anything when I incorporate it into a document template.

I copy and pasted the code from here: https://sparxsystems.com/enterprise_architect_user_guide/16.1/model_publishing/example_rtf_template_fragment_.html

And my document fragment custom query (I chose the scripting option) looks like this:
MyRtfData(#DIAGRAMID#);

My fragment then looks like this:
custom>
{DateGen}
<custom

Again, running this manually works just fine but it generates nothing when I go to add it as a fragment within my document template.

Please let me know if you need any additional information!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Creating a Script Fragment Not Working for me
« Reply #1 on: April 23, 2024, 09:46:50 pm »
And did you select your script in your template?

Otherwise the first thing to figure out is whether or not your script is actually executed.
Add some logging to a file or something similar (outside of EA's control, so no Session.output) to make sure the script has actually been executed.

Geert

aniforatos

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Creating a Script Fragment Not Working for me
« Reply #2 on: April 23, 2024, 11:31:41 pm »
Thanks for the response! I did select the script in the template. I can add some logging. I will report back.