Skip to content

Diagram Management Policy

๐ŸŽฏ PlantUML Diagram Standards

๐Ÿ“‹ Diagram Creation Process

  1. Source files: All diagrams MUST be created as .puml files in diagrams/ directory
  2. PNG generation: Run java -jar plantuml.jar -tpng diagrams/*.puml to generate PNG files
  3. Documentation references: Markdown files MUST reference PNG files, not PUML source
  4. Version control: Both .puml source and .png output files are tracked in git

๐Ÿ—‚๏ธ Directory Structure

diagrams/
โ”œโ”€โ”€ *.puml                      # PlantUML source files
โ”œโ”€โ”€ *.png                       # Generated PNG images (auto-generated)
โ””โ”€โ”€ plantuml.jar               # PlantUML processor (if local)

๐Ÿ“ Documentation Reference Pattern

When referencing diagrams in documentation:

![Diagram Title](../diagrams/diagram-name.png)

*Figure: Description of the diagram and its purpose.*

๐Ÿ”„ Regeneration Command

To regenerate all PNG files from PlantUML sources:

# From repository root
java -jar plantuml.jar -tpng diagrams/*.puml

๐Ÿšซ Prohibited Diagram Formats

  • โŒ Mermaid charts - All Mermaid must be converted to PlantUML
  • โŒ Inline SVG - Use PNG files for better compatibility
  • โŒ External diagram tools - Use PlantUML for consistency

โœ… Required PlantUML Structure

All PlantUML files MUST include:

@startuml diagram-name

' Your diagram content here

@enduml

๐Ÿ“Š Quality Standards

  • Clear titles: Each diagram must have a descriptive title
  • Proper naming: Use kebab-case for file names (e.g., bss-signal-flow.puml)
  • Consistent styling: Follow existing color and styling patterns
  • Documentation: Include diagram purpose in referencing markdown

๐Ÿ› ๏ธ Maintenance Workflow

Adding New Diagrams

  1. Create .puml file in diagrams/ directory
  2. Generate PNG: java -jar plantuml.jar -tpng diagrams/new-diagram.puml
  3. Reference PNG in documentation
  4. Commit both .puml and .png files

Updating Existing Diagrams

  1. Modify the .puml source file
  2. Regenerate PNG: java -jar plantuml.jar -tpng diagrams/updated-diagram.puml
  3. Verify documentation references are correct
  4. Commit updated files

Removing Diagrams

  1. Remove references from documentation first
  2. Delete both .puml and .png files
  3. Commit changes

๐Ÿ“‹ Current Diagram Inventory

Architecture Diagrams

  • abs-hub-ecosystem.puml - ABS platform ecosystem overview
  • dirac-framework.puml - DIRAC framework architecture
  • entities-erd.puml - Entity relationship diagram

Business Model Diagrams

  • bss-signal-flow.puml - Battery Swap Service signal flow

State Diagrams

  • customer-state.puml - Customer state machine
  • asset-owner-state.puml - Asset owner state machine
  • iot-asset-state.puml - IoT asset state machine

Integration Diagrams

  • messaging-platform.puml - Messaging platform architecture
  • inter-platform.puml - Inter-platform communication

๐Ÿ”„ Migration Status

โœ… Completed

  • Converted Mermaid sequence diagram to PlantUML (bss-signal-flow.puml)
  • Updated documentation to reference PNG files
  • Established diagram management workflow

๐Ÿ“‹ Future Tasks

  • Generate missing PNG files for all PlantUML diagrams
  • Validate all diagram references in documentation
  • Establish automated PNG generation in CI/CD

Last Updated: January 2025 Maintained By: Documentation Team