Book a Demo

This webinar has completed, the recording will be posted shortly.


Scott Hebbard, Communications Manager at Sparx Systems, provides an introduction to the new Document Fragments capability introduced in Enterprise Architect 10.

Scott's presentation shows how:


Don't miss this opportunity to learn more about Enterprise Architect

Session 1

Melbourne Wed 05 Dec 08:00 am
New York Tue 04 Dec 16:00 pm
Los Angeles Tue 04 Dec 13:00 pm
London Tue 04 Dec 21:00 pm
Auckland Wed 05 Dec 10:00 am

Session 2


Scott HebbardCommunications Manager
Sparx Systems

Explore the webinar resources

Questions & Answers


Enterprise Architect 10. (Released December, 2012)
Document Fragments are available in all editions of Enterprise Architect.

Note:This demonstration also included an example of embedding a Model Script in a Document Fragment template. To create and edit Model Scripts in Enterprise Architect, you must use the Corporate (or above) edition.
When an element is processed during document generation, a start and end bookmark is automatically inserted into the document. When you insert a hyperlink to that element, the hyperlink binds to the first matching bookmark.

Tip: If you wish to report on elements multiple times in a single document, you need to make use of the "No Bookmarks" option. Simply check the "No Bookmarks" option in all templates, except those that contain the information you want to jump to. (By default, "No Bookmarks" is unchecked.) You access the "No Bookmarks" option from the Document Template Designer by clicking the Document Options icon; the "No Bookmarks" option is listed under the first tab.
These information items are not available via the built-in template editor, as they are not owned by elements in the model hierarchy. The information is stored in the Enterprise Architect repository however, and is available via the API. Since it can be useful to include such information in reports, we chose to extract it using a Model Script invoked from a Document Fragment.

In general, Document Fragments do not require you to use or develop Model Scripts - that's just a convenient option we took advantage of.
You can also pass a PackageID. We plan to support DiagramID as well, but this capability is not available in the current release (10.0.1004).
We'll assume that the table has a heading row and that a Document Fragment defines a custom query to populate one row of the table based on the input element. For the Document Fragment to operate on each reported element, it must be invoked from within the Element section of a parent template. The table header is also defined in the parent template. In this scenario the Document Fragment will be called for each element one after another, thus filling out one row after another.

Note: When using Document Fragments in this way, the current release of Enterprise Architect generates an extra space between rows. This will be addressed in a future release of Enterprise Architect.
Yes. To do so, include each column that will populate your table in your Custom (SQL) Query. In your Document Fragment, right-click within the Custom Section and choose the menu option: Insert Custom Field. Type the appropriate column name when prompted for the name of this field. Repeat this for every column returned by your custom SQL query.

Note:You can use the "AS" construct in your SQL query to assign an alias to each column. For example: SELECT DocName AS TemplateName, Author AS TemplateLocation FROM t_document. In that case you may use the column alias for the template field name instead.
Currently there are no plans to implement add-in support for template fragments. However, Sparx Systems would welcome feedback from users on specific needs or use cases for this capability.
Headers and Footers can be created using the built-in templates, whether as part of a Document Fragment, or generic template. To add these to your RTF template:
  1. Open the top-level or master template
  2. Right-click and choose the menu option: Edit > Edit Page Header/Footer
  3. This allows you to edit the header and footer areas. Make the necessary changes.
  4. You may want to have a different header/footer on the first page of the generated document, or delete it entirely from that page.
To do this use the option: Edit > First Page Header/Footer.

Note: To simply view the header/footer, open the template, right-click and use the menu option: View > Page Header/Footer

In our example, we edited a header and footer in the master template called "ATM Project Specification". These will override any header and footer that may be specified in Document Fragment templates.
Document Fragments and Virtual Documents provide two different approaches to structuring generated reports. Document Fragments exist at the template-level to provide greater flexibility in:
  1. what information can be reported. For example Document Fragments may report information obtained from Model Scripts, SQL Queries or Element Filters.
  2. how that information is structured. For example you can use multiple fragments to report on the same set of elements multiple times.
Virtual Documents provide a visual, model-driven approach to structuring and sequencing reports. Like Document Fragments, they also allow you to aggregate templates, but operate on a predefined set of input packages. This makes Virtual Documents useful when you have a particular report, or set of reports, to execute in a given model.

Neither capability is a replacement for other - rather they are complementary. It is entirely feasible, for example, that a Virtual Document's template calls one or more Document Fragments to extract necessary information for the report.
Yes. We intend to provide a library of examples that can be used for common reporting needs. This will likely be included in the Enterprise Architect Base Model, as well as being importable into existing model files/repositories.
share this page share by email share on linkedin share on X share on facebook