如何解决在 Plantuml 中嵌套 if 语句
我正在尝试在 plantuml 中执行嵌套的 if 语句。代码如下:
@startuml
start
:Search for File;
if(Is in local cache?) then (yes)
:Finish;
stop
else (no)
:Check Cached SearchObjectToNodeTb;
if(Find in SearchObjectToNodeTb) then (yes)
:Send refresh req. SO to SN;
else(No)
:Send SO query to closest SymbolToNodeCacheTb match;
if(Symbol in Table) then (yes)
switch(What role am I?)
case(SearchNode)
:Send out Query to SN and get SearchObject;
case(FileNode)
:Return results;
else(No)//can't find the if statement for here
switch(What role am I?)
case(client)
:Send to Node with closest result;
case(SearchNode)
:Perform alg. for tablesym. creation;
@enduml
它看不到 else 的最后一个 if 语句。是否可以在plantuml中嵌套if else语句?
解决方法
据我所知,endswitch
(参见例如 https://plantuml.com/activity-diagram-beta)缺少以下对我而言的作品:
@startuml
start
:Search for File;
if(Is in local cache?) then (yes)
:Finish;
stop
else (no)
:Check Cached SearchObjectToNodeTb;
if(Find in SearchObjectToNodeTb) then (yes)
:Send refresh req. SO to SN;
else(No)
:Send SO query to closest SymbolToNodeCacheTb match;
if(Symbol in Table) then (yes)
switch(What role am I?)
case(SearchNode)
:Send out Query to SN and get SearchObject;
case(FileNode)
:Return results;
endswitch
else(No)
switch(What role am I?)
case(client)
:Send to Node with closest result;
case(SearchNode)
:Perform alg. for tablesym. creation;
endswitch
@enduml
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。