Workflow: PlantUML Prototypes -> Enterprise Architect

# Workflow: PlantUML Prototypes -> Enterprise Architect

PlantUML for fast prototyping and iteration; transfer the matured diagrams to EA as the ASPICE work products (SYS.3 / SWE.2). Source: UDS Security example (`Examples/Diagrams/`).

## 1. Prototype in PlantUML
- Diagrams as `.puml` text files next to the project (`Diagrams/SYS/`, `Diagrams/SW/`), versionable, diffable.
- Follow the layout rules (see Joplin note "PlantUML Layout Rules").
- Render locally: `java -jar plantuml.jar -tpng -charset UTF-8 <files>` (jar cached at `C:\Users\jan\AppData\Local\Temp\kilo\plantuml.jar`, v1.2024.7).
- Verify layout without eyeballing: `-ttxt` ASCII render (note: crashes on `note` elements in L2R mode; PNG unaffected).

## 2. Decide the transfer path per diagram type
| Diagram type | Transfer path | Why |
|---|---|---|
| Structure (component, context, class, state) | EA Automation script (JScript) | PlantUML XMI for these is UML 1.3 - imports poorly into EA |
| Sequence / interaction | XMI 2.1 import | PlantUML `-txmi` emits clean UML 2.1 Interactions; EA imports directly |

## 3. Transfer structure via EA script
1. Generate/reuse an EA JScript (`Diagrams/EA/*_Import_EA.js` pattern):
   - `pkg.Elements.AddNew(name, type)` with stereotype + notes (notes carry the SYS-RQ/SWRQ IDs = traceability hook)
   - `src.Connectors.AddNew(label, "Dependency"/"Transition")`, set `.SupplierID`
   - `diagram.DiagramObjects.AddNew` + left/top/right/bottom coordinates (copy from the verified PlantUML layout)
   - `diagram.DiagramLinks.AddNew` + `.ConnectorID`
2. In EA: Scripting window (Specialize -> Scripts) -> group -> **Add Script**, Language = **JScript** (not JavaScript), paste source, Save.
3. Select target package in Project Browser, **Run** (F5), check System Output.
4. One-shot alternative: paste whole script into the Scripting **Console** + Enter.

## 4. Transfer sequences via XMI
1. Export: `java -jar plantuml.jar -txmi -charset UTF-8 -o <outdir> <file.puml>`
2. EA: right-click target package -> Import/Export -> Import Model from XMI -> pick the `.xmi`.
3. Verify lifelines/messages, auto-layout if needed.

## 5. Housekeeping
- Scripts create duplicate packages on re-run - delete old ones first.
- After import, cross-check against the PNG renders; adjust frames for font overflow.
- Consider EA tagged values on elements for requirement IDs (traceability reports).
- Keep the `.puml` sources as the working copy during iteration; EA holds the released architecture.

## References
- Joplin: "PlantUML Layout Rules (diagram style guide)" (c070e8144cd34d859e6521ab9edaab85)
- Joplin: "EA Import Guide - UDS Security Example" (5e634876c359468e83c41e2534c5db94)
- Example kit: `Examples/Diagrams/EA/` (SYS_Import_EA.js, SW_Import_EA.js, sequence .xmi files)

id: 3717a4aa65e64ddfa05c36cc4b14ad1e
parent_id: 111595e632f1437d8c451eb73811d9c2
created_time: 2026-08-25T08:14:42.671Z
updated_time: 2026-08-25T08:14:42.671Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author: 
source_url: 
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data: 
order: 1787645682671
user_created_time: 2026-08-25T08:14:42.671Z
user_updated_time: 2026-08-25T08:14:42.671Z
encryption_cipher_text: 
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id: 
conflict_original_id: 
master_key_id: 
user_data: 
deleted_time: 0
is_locked: 0
extracted_resource_ids: 
type_: 1