In my first blog posting, I described the method by which a sequence diagram described using PlantUML script can be imported into Sparxs Enterprise Architect. The solution utilised a set of VBScripts which I hacked together to parse the input, search for existing objects, create new elements and then layout the diagram object and links.
Model Management however is not just about being able to import sequence diagrams. The use case may exist in your organisation where diagrams require to be validated against some Enterprise standards, checking for duplicates within the model, for duplication against an Application Portfolio, naming standards, organisational context; all metadata which extends beyond the basic sequence diagram which has been described.
Hence these diagrams and/or the underlying modelling elements may well be updated within Modelling environment and there is a need to refresh one or more PlantUML scripts.
Follow the installation instructions as per per the Create a sequence diagram post and create a new VBScript called “Generate PlantUML script” using the code from https://github.com/gobravedave/Enterprise-Architect.
The following steps outline the process of generating a PlantUML script from a sequence diagram within EA:
- open up an existing sequence diagram
- add a note element to the sequence diagram
- right click the Note element and select “Generate PlantUML script”
- the script will parse the diagram objects and links with the results loaded into the note object.

This script preceded the import script and was the basis of discovering where various information about the diagram and underlying modelling objects are stored within EA.
Simliar to the Import script, there are a number of backlog items I am considering to introduce including:
- support other diagram types e.g. use case, class diagrams
- publish directly to confluence pages
- support titles, dividers and notes
One thought on “Generate PlantUML Script using Enterprise Architect”