UML做業第六次:分析系統,繪製順序圖學習
1、活動圖語法測試
活動標籤(activity label)以冒號開始,以分號結束,文本格式支持creole wiki語法。,活動默認安裝它們定義的順序就行鏈接。this
@startuml :Hello world; :This is on defined on several **lines**; @enduml
可使用關鍵字start
和stop
表示圖示的開始和結束。code
@startuml start :Hello world; :This is on defined on several **lines**; stop @enduml
也可使用 end
關鍵字。orm
@startuml start :Hello world; :This is on defined on several **lines**; end @enduml
在圖示中可使用關鍵字if
,then
和else
設置分支測試。標註文字則放在括號中。對象
@startuml start if (Graphviz installed?) then (yes) :process all\ndiagrams; else (no) :process only __sequence__ and __activity__ diagrams; endif stop @enduml
也可使用關鍵字elseif
設置多個分支測試。blog
@startuml start 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 @enduml
可使用關鍵字repeat
和repeatwhile
進行重複循環。ip
@startuml start repeat :read data; :generate diagrams; repeat while (more data?) stop @enduml
可使用關鍵字while
和end while
進行while循環。ci
@startuml start while (data available?) :read data; :generate diagrams; endwhile stop @enduml
還能夠在關鍵字endwhile
後添加標註,還有一種方式是使用關鍵字is
。it
@startuml while (check filesize ?) is (not empty) :read file; endwhile (empty) :close file; @enduml
可使用關鍵字fork
,fork again
和end fork
表示並行處理。
@startuml start if (multiprocessor?) then (yes) fork :Treatment 1; fork again :Treatment 2; end fork else (monoproc) :Treatment 1; :Treatment 2; endif @enduml
文本格式支持creole wiki語法。
A note can be floating, using floating
keyword.
@startuml start :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 @enduml
顏色
能夠爲活動(activity)指定一種顏色。
@startuml start :starting progress; #HotPink:reading configuration files These files should edited at this point!; #AAAAAA:ending of the process; @enduml
使用->
標記,能夠給箭頭添加文字或者修改箭頭顏色。
同時,也能夠選擇點狀 (dotted),條狀(dashed),加粗或者是隱式箭頭
@startuml :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; @enduml
可使用括號定義鏈接器。
@startuml start :Some activity; (A) detach (A) :Other activity; @enduml
經過定義分區(partition),你能夠把多個活動組合(group)在一塊兒。
@startuml start partition Initialization { :read config file; :init internal variable; } partition Running { :wait for user interaction; :print information; } stop @enduml
你可使用管道符|
來定義泳道。
還能夠改變泳道的顏色。
@startuml |Swimlane1| start :foo1; |#AntiqueWhite|Swimlane2| :foo2; :foo3; |Swimlane1| :foo4; |Swimlane2| :foo5; stop @enduml
可使用關鍵字detach
移除箭頭。
@startuml :start; fork :foo1; :foo2; fork again :foo3; detach endfork if (foo4) then :foo5; detach endif :foo6; detach :foo7; stop @enduml
經過修改活動標籤最後的分號分隔符(;
),能夠爲活動設置不一樣的形狀。
|
<
>
/
]
}
@startuml :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; @enduml
二、到定貨界面,接收客戶信息,接收貨品信息,顯示貨品信息
三、到定貨管理器,建立客戶,取貨品信息,建立訂單
四、建立客戶到客戶區,取貨品信息到貨品區,建立訂單到訂單區