当前位置:网站首页>Plantuml Usage Summary
Plantuml Usage Summary
2022-07-28 08:03:00 【The galloping snail has been occupied】
I have used this tool before , I saw 2 Very good plantuml teaching , But I didn't summarize , So after a while, I forgot . I've been doing nothing for a long time , So let's write a summary ;
Of course , First, install the plug-in , stay idea Very convenient , Directly in plugins On the search plantuml That's all right. ;
plantuml There are many uses ( I reprinted an article about plantuml A tutorial for Connection address , There are many fancy usages , Those who are interested can study ), This article is just an introduction , If it is only used to draw flow charts , It's enough for work ;
uml Structure
@startuml
xxxxx
xxxx
xxx
@enduml
As shown in the figure above ,uml All the grammar , All wrapped in @startuml @enduml Between ; Next , Let's take a look at uml The grammar of
Basic grammar 1 :XXXX;
Don't talk much , Look at the renderings :
The main structure of the flow chart is probably such a thing ; So this is the most basic and important grammatical structure ;
Speaking of which, I would also like to introduce 2 individual , Compare basic keywords start ,end; this 2 Words mean the process Start and end , this 2 Words can be used separately ;
Look at the usage and effect pictures :
In fact this 2 Key words , It can make the flow chart look clearer , Because when the flow chart is very complex and there are many branches , Use end, It allows people to see more intuitively where a specific branch ends
Basic grammar 2 :if structure
Because a lot of times , We draw a flow chart , It will inevitably involve the situation of branches , therefore if Structure is also very common ; Learning this should actually feel familiar , Because the structure of programming language is too similar , After reading it, you can write it immediately ;
2.1 Simple if structure
@startuml
if(conditon1)then(yes)
: Satisfy conditon1, Take the branch 1;
else
:no, Take a branch 2;
endif
@enduml
design sketch :
2.2 multiple if structure
usage : When there are many branches , Different conditions must be met before entering the corresponding branch , This time , You should use multiple if structure
grammar :
if(condition1)then(yes)
: event 1;
: event 2;
: event 3;
end
elseif(condition2)then(yes)
: event 1;
elseif(condition3)then(yes)
: event 1;
elseif(condition4)then(yes)
: event 1;
endif
design sketch :
Here you can see , I added end, Keyword indicates that the process enters condition1 in , The whole process is over , Very intuitive ; So use when appropriate end keyword , It will make the flow chart more suitable for people to view ;
2.3 if Nesting of structures
above 2 The first grammatical structure is uml Of if Basic usage of structure ; occasionally , Maybe we will encounter a situation , Is in a branch , There are other branches , At this time, it can be nested in a branch if structure ;
Pictured :
Basic grammar 3 : Loop structure while
start
while(conditon)is(not empty)
:read file;
endwhile(empty)
:close file --> End of the process ;
stop
When use , No keywords :start,stop, You can also use , However, it is recommended to add , Use a complete structure , Don't talk much , Look at the renderings :
One more word here , stay while In circulation It can also be added if Structural , Actually in uml In the grammar of , Any structure can be nested in any structure , Can be in if In structure , set while, And vice versa ,( There are other structures behind , In fact, they can be nested with each other ) This nesting is widely used , You can find it by yourself ;
Draw one here :
In this way, various nested combinations can cope with most workflow diagrams ;
Basic grammar 4 : Parallel structure fork
Use this structure , You can simplify some flow charts , When there is no sequence of events , This structure can be used ; Let's talk about grammar first , And the renderings
fork
:;
fork again
:;
fork again
:;
end fork
there fork again You can add as many as you like , This sum if The structure is very similar

Use scenario suggestions : When the flow chart is long , Consider classifying processes
such as :
ad locum : Thing 1, Thing 2, Thing 3 Between , There is no order of precedence ( There's no connection ), If you draw the flow chart in such a straightforward way , It's not intuitive , It also seems difficult ; If you use fork The structure is different ;
In the use of fork After structure , The whole process is much clearer than before ;
Many say , there fork structure , Can also be combined with if,while nesting ;
Basic grammar five : notes
When drawing the flow chart , In order to make it easier for people to understand, sometimes , Some notes will be marked to explain some terms or processes , Or important data, etc ...
So annotation is also very important
grammar :
grammar 1:
floating note left: Left note
grammar 2:
note right
Note on the right
end note
design sketch :

Let's emphasize here , To annotate a line , Write the comment structure just below this line ;
5.1 Other syntax for comments
In the comments
note right
XXXX
end note
Can be used in the structure of
- html grammar
- ====( You can split rows )
- "*" Represents a list
Pictured :
Grammar 6 : Color syntax
This grammar is also very interesting , Is to mark a line with a color ;
grammar :
# english ( Or hexadecimal ):XXXXX;
Here is a color conversion website , Please refer to this website for the colors you need Color website links
design sketch :
The English words here , And hexadecimal codes are recommended Color website links You can try to check on ;
That's all uml Basic grammar , There are other grammars , But it doesn't seem to be very useful , So I won't summarize ; If you want to see other grammars , You can see the connection uml Tutorial recommendation
边栏推荐
- Clion debugging redis6 source code
- Basic dictionary of deep learning --- activation function, batch size, normalization
- 【活动报名】云原生技术交流 Meetup,8 月 6 日广州见
- 解析树形结构 js
- Digital management insight into retail and e-commerce operations -- Introduction to digital management
- C语言犄角旮旯的知识之指针
- 【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(八)
- Opencv's practical learning of credit card recognition (4)
- How to analyze the taxi business problem of didi SQL interview question
- Adjust the array order so that odd numbers precede even numbers - two questions per day
猜你喜欢

Disassemble Huawei switches and learn Basic EMC operations

使用FFmpeg来批量生成单图+单音频的一图流视频

Flowable workflow all business concepts

Digital management insight into retail and e-commerce operations -- Introduction to digital management

Industry standards and certification of common electronic products

Discrimination coverage index / index coverage / Samsung index

DNA deoxyribonucleic acid modified platinum nanoparticles ptnps DNA | scientific research reagent

win系统添加打印机

The underlying principles of RDB persistence and AOF persistence of redis
![[event registration] cloud native technology exchange meetup, see you in Guangzhou on August 6](/img/08/b892bd6c14d5ba3691f9b7def29c35.png)
[event registration] cloud native technology exchange meetup, see you in Guangzhou on August 6
随机推荐
Flowable workflow all business concepts
Qt多线程中槽函数在哪个线程里执行分析
Disassemble Huawei switches and learn Basic EMC operations
Adjust the array order so that odd numbers precede even numbers - two questions per day
Awk from introduction to earth (16) discussion on the types of awk variables -- about the two types of numbers and strings
【13】加法器:如何像搭乐高一样搭电路(上)?
win系统添加打印机
华为高级工程师---BGP路由过滤及社团属性
@The role of documented
解析树形结构 js
铜铟硫CuInSe2量子点修饰DNA(脱氧核糖核酸)DNA-CuInSe2QDs(齐岳)
对spark算子aggregateByKey的理解
Synthesis of dna-ag2sqds DNA modified silver sulfide Ag2S quantum dots
Matplotlib绘图笔记基础直线、折线、曲线
How to understand the adjective prefix of socket: "connection oriented" and "connectionless"
Understanding of spark operator aggregatebykey
Swm32 series tutorial 5-adc application
mysql,我们如何得到受查询影响的行数?
EMC rectification ideas
Basic dictionary of deep learning --- activation function, batch size, normalization