Search code examples
templatesenterprise-architectdocumentation-generation

Sparx EA Templates & Template fragment Document Generation approach questions


Trying to build template (with possibly included template fragments, but anyway) in Sparx EA.

Struggled to find answers in Internet (but I tought it would be popular thou)

First:

Is there are way to output(or even prevent output), as example, packadge properties in different styles depends on packadge level (root, first level packs, second level etc)?

Let say I don't want to ouput name of root packadge, but I want to output name of child packadges. If I remove tag {Pkg.Name} inside child packdages it will proceed each child packadge data as described in template above, but if I leave it like in this picture - it will output only names of child packadges

enter image description here

Second:

Is there a way, for template fragment scripting, to get currently processing object data (lets say Diagram.Note) and construct table from it?

(lets say I got some html markup or wiki markup inside and I want to render it as table)

P.S.

I know that I can achieve all this by writing my own document generation addin, only fetching data from Sparx Ea project and render it by some third-party library, but still wondering, maybe built-in features could replace that type of solution

UPD

Well, article by mr. Geert Bellekens (link in his answer) & this article helped me to find solution of first problem!


Solution

  • You can do almost anything with the current built-in document generator and fragments.

    Just don't try to make one big template for your complete document. Instead make small manageable templates and use virtual documents to tie all to the pieces together.

    With Custom Script template fragments, Custom SQL template fragments and Document Script template fragments you really have all the freedom you need to make professional document using only standard document generation features.

    I used to build my own generators in the past, and loved it, but I can't honestly defend the business case anymore with the current state and flexibility of the built-in document generator.

    For an example template and model see Tutorial: Generate complex documents from Enterprise Architect with a two-step semi-automated approach