Skip to content

Instantly share code, notes, and snippets.

@v-rudkov
Last active January 29, 2020 14:50
Show Gist options
  • Save v-rudkov/084feac7583baed5771f563f935b5480 to your computer and use it in GitHub Desktop.
Save v-rudkov/084feac7583baed5771f563f935b5480 to your computer and use it in GitHub Desktop.
PlantUML templates for most used diagrams

PlantUML templates for most used diagrams

Use Case Diagram

http://plantuml.com/use-case-diagram

@startuml
left to right direction

' it's a comment

header
This is Header
endheader

User --> (Use Case #1)
note right of (Use Case #1)
    note right of (Use Case #1)
    other options:
        - note left of
        - note top of
        - note bottom of
end note

User --> (Use Case #2)

(Use Case #1) <. (Use Case #2): <<extend>>

@enduml
$ plantuml use_cases_diagram.txt

use_cases_diagram

Sequence Diagram

http://plantuml.com/sequence-diagram

@startuml

' it's a comment

actor User
participant "<Visualforce Page>\nPage" as Page
participant "<Apex Class>\nPageController" as Controller
participant "<Apex Class>\nService" as Service
participant "<Apex Class>\nBatch" as Batch

group Group #1
    User -> Page: click "Submit"
    Page -> Controller: submit()
end

Controller -> Service: process()
note left
    multiline
    note
end note

group Group #2
    Service -> Batch: executeBatch()
    note right: one line note
    loop
        Batch -> Batch: execute()
    end
end

@enduml
$ plantuml sequence_diagram.txt

sequence_diagram

Entity Relationship Diagram

http://plantuml.com/ie-diagram

@startuml

hide circle
hide empty members

' it's a comment

entity Account {
    Id
}

entity Contact {
    Id
    AccountId
}

entity Opportunity {
    Id
    AccountId
}

Account --{ Contact
Account --{ Opportunity

@enduml
$ plantuml entity_relationship_diagram.txt

entity_relationship_diagram

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment