每一個普通節點:冒號開頭,分號結尾
活動圖的起始和結尾:start、end或stopthis
start :case1; :case2; end
start if(predicate?) then (yes) :case yes; else (no) :case no; endif end
plaintUML裏沒有switch語法,只能使用elseif代替spa
start note right:多分支條件語句,實現switch if (condition A) then (yes) :Text 1; elseif (condition B) then (yes) :Text 2; stop elseif (condition C) then (yes) :Text 3; elseif (condition D) then (yes) :Text 4; else (nothing) :Text else; endif stop
start note right:do while循環 repeat :read data; :generate diagrams; repeat while (more data?) is (yes) stop
while後面能夠跟is表達式來標識箭頭
3d
start note right:while do循環 while (check filesize ?) is (not empty) :read file; endwhile (empty) :close file; end
while後面能夠跟is表達式來標識箭頭
endwhile後跟括號表達式來標識箭頭
code
start note right:並行處理fork if (multiprocessor?) then (yes) fork :Treatment 1; fork again :Treatment 2; end fork else (monoproc) :Treatment 1; :Treatment 2; endif end
start note right:添加註釋 :foo1; floating note left: This is a note :foo2; note right This note is on several //lines// and can contain <b>HTML</b> ==== * Calling the method ""foo()"" is prohibited end note stop
一行註釋可在note聲明後跟冒號
多行註釋須要換行,並用end note語句標識結束
浮動註釋可以使用floating關鍵字
note聲明後可標識方位:僅支持left和right
文本格式支持creole wiki語法
orm
start note right:配置節點顏色 :starting progress; #HotPink:reading configuration files These files should edited at this point!; #AAAAAA:ending of the process; end
#開頭,可以使用色值或文字描述,須要放在語句前方
blog
start note right:修改箭頭顏色樣式 :foo1; -> You can put text on arrows; if (test) then -[#blue]-> :foo2; -[#green,dashed]-> The text can also be on several lines and **very** long...; :foo3; else -[#black,dotted]-> :foo4; endif -[#gray,bold]-> :foo5; end
start note right:鏈接器 :Some activity; (A) detach (A) :Other activity; end
start note right:組合:定義分區 partition Initialization { :read config file; :init internal variable; } partition Running { :wait for user interaction; :print information; } stop
start note right:分離 fork :foo1; :foo2; fork again :foo3; detach endfork if (foo4) then :foo5; detach endif :foo6; detach :foo7; stop
用其餘符號代替分號結尾,可修改節點樣式ip
|
<
>
/
]
}
start note right:特殊領域語言(SDL) :Ready; :next(o)| :Receiving; split :nak(i)< :ack(o)> split again :ack(i)< :next(o) on several line| :i := i + 1] :ack(o)> split again :err(i)< :nak(o)> split again :foo/ split again :i > 5} stop end split :finish; end
泳道比較特殊,整個代碼必須以泳道標識開頭
相似於節點顏色,在語句前方能夠設置顏色;後設置的顏色會覆蓋以前設置的get
|Swimlane1| start :foo1; |#AntiqueWhite|Swimlane2| :foo2; :foo3; |Swimlane1| :foo4; |Swimlane2| :foo5; stop