Introduction
Scripting is one of the most powerful capabilities in enterprise architecture tools. It allows architects to go beyond static diagrams and automate tasks such as model validation, metadata enrichment, reporting, and integration. Two popular tools in this space — Archi and Sparx Enterprise Architect (EA) — offer scripting, but their approaches, capabilities, and underlying technologies are quite different.
In this post, we compare scripting in Archi and Sparx EA, covering use cases, languages, APIs, performance, limitations, and real-world examples. Sparx EA training
1. Supported Scripting Languages
| Tool | Languages Supported | Environment |
|---|---|---|
| Archi | JavaScript (via GraalVM), Groovy, Nashorn (deprecated) | Archi Scripting Plugin / jArchi |
| Sparx EA | VBScript, JavaScript, JScript, Python (with integration) | Built-in Script Editor in EA GUI |
2. Scripting Use Cases
Both tools allow scripting for tasks like:
- Generating model reports (CSV, XML, Excel)
- Finding orphaned elements or structural gaps
- Bulk tagging or stereotype application
- Automated diagram layout or creation
- Exporting models for external processing
Archi Example Use Case
Using
jArchi
, a user can script the extraction of all ArchiMate elements with a specific tag and export them to CSV:
var nodes = model.find("element").filter(e => e.type == "ApplicationComponent");
nodes.forEach(function(n) {
console.log(n.name + "," + n.get("owner"));
});
Sparx EA Example Use Case
Using the built-in scripting engine in EA:
sub ListRequirements()
dim element as EA.Element
for each element in Repository.GetElementsByType("Requirement")
Session.Output(element.Name & " - " & element.Alias)
next
end sub
3. API Access and Integration
Sparx EA exposes a rich automation API (COM-based) that can manipulate every aspect of the model: packages, diagrams, elements, connectors, tagged values, etc. Sparx EA best practices
Archi, with jArchi, also exposes the full model via scripting — but is Java-based, and best suited for iterative manipulation of lightweight ArchiMate models. ArchiMate relationship types
4. Performance and Scalability
- Sparx EA: Suitable for scripting in repositories with tens or hundreds of thousands of elements, especially when using .qea/.qeax or SQL-based backends
- Archi: Performs well with medium-sized models (under 10k elements), but performance may degrade for large-scale operations depending on JVM tuning
5. Execution Environment
- Sparx EA: Scripts are written and run inside EA’s GUI, with support for logging to a console, output window, or document. Scripts can be stored at project or group level.
- Archi: jArchi scripts are often embedded within the model and run via the plugin. They can be saved as part of the repository or loaded externally. Batch mode execution is possible via CLI with GraalVM.
6. Community and Libraries
- Archi: Strong scripting community on GitHub, especially for CSV import/export, validation, and doc generation.
- Sparx EA: Scripting examples are less centralized but widely used in enterprise consulting. Prolaborate and Add-In development offer powerful extensions beyond scripting.
7. Limitations
- Archi: Limited to ArchiMate metamodel. Not ideal for complex, cross-domain modeling or real-time integration.
- Sparx EA: VBScript can feel outdated. Python support requires setup. Scripting is not always version-controlled.
Conclusion
If you're working in a lightweight ArchiMate environment, Archi scripting (especially with jArchi and GraalVM) is elegant, fast, and simple to use. For larger organizations modeling complex systems, integrations, or using multiple notations (BPMN, UML, SysML), Sparx EA offers far deeper scripting control and scalability — albeit with a steeper learning curve. ArchiMate relationship types
Keywords/Tags
- Sparx EA scripting
- Archi jArchi scripting
- Archi vs Sparx automation
- Scripting in enterprise architecture
- EA scripting API examples
- ArchiMate scripting plugin
- Model automation in Sparx EA
- Archi model export script
- EA COM automation API
- Bulk tagging and model transformation EA
If you’d like hands-on training tailored to your team (Sparx Enterprise Architect, ArchiMate, TOGAF, BPMN, SysML, or the Archi tool), you can reach us via our contact page.
Getting more from your Sparx EA investment
Most organizations use less than 20% of Sparx Enterprise Architect's capabilities. Three underutilized features deliver disproportionate value when activated: model validation, document generation, and the automation API. free Sparx EA maturity assessment
Model validation checks every element and relationship against metamodel rules, catching errors that human reviewers miss. Enable ArchiMate validation under Specialize → Technologies to prevent invalid relationships (for example, a Composition between elements in different layers). Add custom validation scripts that enforce your organization's naming conventions, required tagged values, and maximum elements per diagram.
Document generation produces Word or PDF reports directly from the model. Configure templates that pull element properties, tagged values, relationships, and diagrams into formatted documents. When the model changes, regenerate the document — it is always synchronized. This eliminates the manual document maintenance that typically consumes 30-40% of architect time.
The automation API (JavaScript, VBScript, or .NET) enables bulk operations that would take hours manually: updating tagged values across hundreds of elements, generating traceability matrices, exporting element catalogs to Excel, or validating naming conventions. A single validation script that runs nightly catches more errors than a monthly manual review.
Frequently Asked Questions
What is Sparx Enterprise Architect used for?
Sparx Enterprise Architect (Sparx EA) is a comprehensive UML, ArchiMate, BPMN, and SysML modeling tool used for enterprise architecture, software design, requirements management, and system modeling. It supports the full architecture lifecycle from strategy through implementation.
How does Sparx EA support ArchiMate modeling?
Sparx EA natively supports ArchiMate 3.x notation through built-in MDG Technology. Architects can model all three ArchiMate layers, create viewpoints, add tagged values, trace relationships across elements, and publish HTML reports — making it one of the most popular tools for enterprise ArchiMate modeling.
What are the benefits of a centralised Sparx EA repository?
A centralised SQL Server or PostgreSQL repository enables concurrent multi-user access, package-level security, version baselines, and governance controls. It transforms Sparx EA from an individual diagramming tool into an organisation-wide architecture knowledge base.