PlantUML sequence diagram

2023. 6. 22. 09:20Env/Tools

    목차
반응형

1. arrow

@startuml

header page1
title Test
footer page %page% of %lastpage%

== sycn call and return ==
A -> B : a()
A <-- B : response

== self message ==
A -> A : a()
A <- A : a()

== arrow styles ==

A ->x B
A -> B : sync call
A ->> B : async call
A -\ B : async call
A <-- B :return

== arrow color == 
A -[#red]> B : red
A <-[#0000FF]- B: blue

== auto number ==

autonumber
A -> B : 1
A <-- B : 2

autonumber 20
A --> B : 20


newpage

== now page 1 ==

A -[#red]> B: b()

@enduml

2. note, alt/group/loop/ref, activate

@startuml

header page2
title group
footer page %page% of %lastpage%

== note and alt/group/loop/ref example == 

alt if passed
    A -> B : success
    activate A

    A -> B : self message
    activate A #FFCCBB
    deactivate A


    deactivate A

    rnote left : ok

    ...
    ...

    ref over A: sequence diagram for success scenario
else
    A -> B : failure
    activate A

    hnote right : failure

    note over A, B #BBEEBB
        do fallback scenario A
    end note

    group fallback_a [fallback 1]
        loop until recovered
            A -> B : do fallback scenario
        end
    end

    deactivate A
end

note across
    note acroll all the components
end note

@enduml

@startuml

A -> B --++ : a()
return

A -> B ++ : a()
B -> B ++ : b()

@enduml

autoactivate

@startuml

header page2
title group
footer page %page% of %lastpage%

== autoactivate == 

autoactivate on

A -> B : a()
B -> B : b()
return res
return ok

A -> C ** : new
A -> C ++ : activate
return

A -> C !! : delete
...

@enduml

 

 

반응형

'Env > Tools' 카테고리의 다른 글

Confluence: Deck of cards, link  (0) 2023.07.14
Docker로 파일 복사 (copy files to the Docker container)  (0) 2023.06.26
pushd, popd  (0) 2023.06.12
git stash  (0) 2023.06.02
Mac Screen Brush (스크린 브러시)  (0) 2023.05.30