Introduction: Why Document Generation Still Matters
Despite the rise of agile practices and continuous delivery, documentation remains essential — especially in regulated industries, large-scale transformation programs, and enterprise architecture initiatives. Stakeholders need understandable, traceable, and timely documentation that reflects the design, requirements, traceability, and progress of systems.
Sparx Enterprise Architect (EA) offers advanced document generation capabilities, yet many teams struggle to produce high-quality outputs efficiently. In this guide, we dive into how to master document generation in EA using RTF templates, scripting, model views, and automation — with real-world examples from our client projects.
Overview of Document Generation in EA
Key Capabilities
- Generate Word/RTF documents, PDFs, and HTML from model content
- Create reusable templates for requirements, architecture, traceability, and impact analysis
- Customize layout, formatting, and content filtering
- Automate report generation using scripts or Pro Cloud Server jobs
Template Types and Structure
1. RTF Template
RTF templates allow structured documentation using elements, connectors, and child packages. The basic flow:
-
Create a template in
Resources → Document Templates
-
Use
{Element}
and{Package}
sections to include model data -
Apply the template via
Document Generator
or script
2. Fragment Templates
- Smaller reusable pieces used inside a master template
- Ideal for including use cases, components, or requirements selectively
3. Style Templates
- Define fonts, headings, colors, and layout
- Use company branding and structure standards
Client Use Case #1: Requirements Specification for 14,000+ Items
One of our public sector clients needed a requirements specification covering:
- Business-level and system-level requirements
- Traceability to tests and components
- Classification and version history
Our Solution
-
Created requirement stereotypes:
BR
,SR
,COMP
-
Tagged with
Priority
,Status
,TestCoverage
- Used fragment templates for each stereotype and inserted in a main RTF template
- Automated generation per module and version using PowerShell scripts
Client Use Case #2: GDPR and Risk Documentation
A finance client requested end-to-end documentation for data protection elements modeled in EA:
- Data Stores and Flows
- Risks and Controls
- Security Classifications
Our Solution
-
Tagged all DataObjects with
Sensitivity
,LegalBasis
- Created separate templates: Data Inventory , Risk Register
- Linked risks and mitigations and documented relationships in the output
Client Use Case #3: Architecture Decision Records (ADR)
A transportation client tracked their architecture decisions using ADR elements linked to concerns and stakeholders.
We Delivered
-
Custom stereotype:
ADR
-
Tags:
Decision
,Status
,Justification
- Template grouped decisions by status (Proposed, Accepted, Deprecated)
- Output to Word, PDF, and posted to SharePoint using automation
Advanced Filtering and Output Techniques
Using Model Views as Input
- Create Model Views that filter by status, stereotype, or tag
- Use these as the scope for your document generation
Conditional Sections
Apply conditional logic to include/exclude based on element type or tag values:
{If Tag = Priority High}
This requirement is business critical.
{EndIf}
Dynamic Titles and Headings
-
Use
{Element.Name}
,{Element.Alias}
to auto-generate section titles
Image and Diagram Handling
- Include specific diagrams by name or stereotype
- Control image size, scaling, and format (JPG, EMF)
Scheduling and Automation
1. Manual with Document Generator
- Right-click package → Documentation → Generate
- Select template and output type
2. Scripted Output
Use VBScript or JScript to generate documentation programmatically:
Session.Packages.GetByGuid("...").DocumentGenerator.Run("MyTemplate", "output.docx")
3. Automated Jobs (Pro Cloud Server)
- Schedule weekly exports
- Email stakeholders or upload to document repository
Lessons Learned from Our Clients
- Structure your repository to match documentation needs
- Don’t mix too many element types in a single template
- Document what each tag means and standardize it
- Validate before generation — broken links break output
- Use fragments to simplify reuse across outputs
Governance and Quality Control
- Automate completeness checks: missing tags, empty notes, unlinked elements
- Run document previews for validation before final output
- Train stakeholders on how models turn into documents
Conclusion: Documentation at Scale is Possible
Sparx EA offers one of the most flexible and scalable document generation platforms in the modeling world. From simple reports to fully governed specifications and compliance packs — it’s all possible with templates, scripts, and structure.
Our client projects have shown that EA can meet even the toughest documentation demands — when used with best practices, automation, and clear modeling standards.
Keywords/Tags
- Sparx EA document generation
- Enterprise Architect documentation best practices
- requirements export Sparx EA
- GDPR documentation EA
- generate specification from Sparx
- EA RTF templates example
- architecture decision records EA
- EA documentation automation script
- model to document in Enterprise Architect
- architecture traceability reports EA