Book a Demo

Author Topic: Can I find how Report Templates use Template Fragments?  (Read 2921 times)

malcolmK102

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Can I find how Report Templates use Template Fragments?
« on: October 08, 2020, 02:06:41 am »
Based on this help topic ( see example 5): https://sparxsystems.com/enterprise_architect_user_guide/15.2/model_publishing/custom_sql_fragments.html
I have this SQL:
Code: [Select]
SELECT
t.DocName AS TemplateName,
t.DocID as docID,
t.Author AS TemplateLocation,

SWITCH
(
t.isActive  = 1, '01 Template',
t.isActive  = 0, '02 Fragment',
t.isActive  = 5, '03 Dynamic',
t.isActive  = 3, '06 StyleSheet',
t.isActive  = 4, '05 ToC',
t.isActive  = 2, '04 Cover Sheet'
) as TemplateType

FROM t_document t

WHERE  t.DocType = 'SSDOCSTYLE'
order by t.isActive, t.DocName

However, what I want to get is Fragment usage, i.e. which Fragments (t.isActive = 0) are used in the Templates (t.isActive = 1)
Is this possible using SQL? (I did look at the Tables directly suing SQL Maestro, but can't figure out how they are connected as I am assuming they do not use t_connector.)
Reason for this is because we now have a large inventory of Templates and Fragments and I want to specifically see where either a Fragment is no longer being used or is being used in multiple Templates.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Can I find how Report Templates use Template Fragments?
« Reply #1 on: October 08, 2020, 04:01:55 am »
I'm not sure if you can find template fragment usage using SQL.
The problem is that the usage is probably embedded somewhere in the RTF code of the template.

This content is stored in the column BinContent. You might be able to decode that content in some kind of script, but probably not using only SQL.

Geert