Author Topic: Example of Custom SQL template fragment  (Read 884 times)

michielper

  • EA User
  • **
  • Posts: 120
  • Karma: +1/-0
    • View Profile
Example of Custom SQL template fragment
« on: August 31, 2018, 09:16:04 pm »
I am trying to create a custom SQL template fragment to be included in a report template. The purpose of the fragment is to show dependency sequences of a certain length starting from the current element. The query works fine as a custom search but I get stuck in trying to get any result at all from the fragment when I make a template fragment out of it. So I would like to see an example of a working custom SQL fragment and the report template that includes it.

Thanks for any help!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9285
  • Karma: +252/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Example of Custom SQL template fragment
« Reply #1 on: August 31, 2018, 09:25:08 pm »
Michiel,

Check out https://bellekens.com/2015/11/12/tutorial-generate-complex-documents-from-enterprise-architect-with-a-two-step-semi-automated-approach/
In the MDG that you can download, you'll find the template UCD_Linked Requirements as an example of an SQL fragment template.

Geert

michielper

  • EA User
  • **
  • Posts: 120
  • Karma: +1/-0
    • View Profile
Re: Example of Custom SQL template fragment
« Reply #2 on: August 31, 2018, 09:45:44 pm »
Michiel,

Check out https://bellekens.com/2015/11/12/tutorial-generate-complex-documents-from-enterprise-architect-with-a-two-step-semi-automated-approach/
In the MDG that you can download, you'll find the template UCD_Linked Requirements as an example of an SQL fragment template.

Geert

Thanks for the quick assistance! I downloaded an EAP and an XML file. What does the MDG mean?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9285
  • Karma: +252/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Example of Custom SQL template fragment
« Reply #3 on: August 31, 2018, 10:01:51 pm »
MDG is a way to bundle things such as templates, scripts, profiles etc... as an excel file.

Most modelling languages in EA are distributed as an MDG.

The .eap file already has the MDG imported, so you should find the template I mentioned there.

Geert

michielper

  • EA User
  • **
  • Posts: 120
  • Karma: +1/-0
    • View Profile
Re: Example of Custom SQL template fragment
« Reply #4 on: August 31, 2018, 11:35:21 pm »
MDG is a way to bundle things such as templates, scripts, profiles etc... as an excel file.

Most modelling languages in EA are distributed as an MDG.

The .eap file already has the MDG imported, so you should find the template I mentioned there.

Geert

Ok, I see. However, in the fragments there is no substantial custom SQL. Only in BFR_ElementDiagramFragment there is one line: MyRtfData(#OBJECTID#)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9285
  • Karma: +252/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Example of Custom SQL template fragment
« Reply #5 on: August 31, 2018, 11:55:51 pm »
Ok, I see. However, in the fragments there is no substantial custom SQL. Only in BFR_ElementDiagramFragment there is one line: MyRtfData(#OBJECTID#)
You might be looking in the wrong place.
The templates from an MDG are stored at a different location.
In this case look in Resources | Document Generation | Bellekens Docgen | Bellekens UCD

The templates are readonly and you can only see their properties if you copy them to a new template (EAUI :-\).

Geert