首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PlantUML活动选择IF/ELSE在菱形上显示问题并在测试之间共享目标

问PlantUML活动选择IF/ELSE在菱形上显示问题并在测试之间共享目标
EN

Stack Overflow用户
提问于 2021-11-19 21:18:11
回答 1查看 133关注 0票数 0

我正在对活动图使用Plantuml图。

我想要有一系列的选择,在每个选择‘菱形’上,我想要显示查询。

然而,我也希望能够从不同的结果选择钻石链接到相同的活动形状。

在旧的活动图中,我不能让查询显示在菱形上,但我可以共享来自不同选择菱形的目标活动形状。

在新的活动测试版中,情况正好相反:我可以在菱形选项上显示问题,但我不能获得不同的选择来共享目标!

新的:

代码语言:javascript
复制
@startuml
header Minimum Reproducible Example
title Can't point two queries to same activity
start
!$shared = SHARED
!$nonShared = NON-SHARED

:Minimum Reproducible Example;
if (Test Question) then (yes)
:$shared;
else (no)
    if (Second Test Question) then (yes)
        :$shared;
    else
    :$nonShared;
stop
@enduml

​

​

旧的:

代码语言:javascript
复制
@startuml
header Minimum Reproducible Example
title "Can't put test query text in condition diamond"

!$shared = "SHARED"
!$nonShared = "NON-SHARED"

(*) -down-> "Minimum Reproducible Example:"
if "TEST QUESTION" then
-DOWN-> [yes] $shared
else
-RIGHT-> [no] if "SECOND TEST QUESTION" then
-DOWN-> [yes] $shared
else
-RIGHT-> [no] if "THIRD TEST QUERY" then
-DOWN-> [yes] $nonShared
-> (*)
@enduml

​

​

也可以在https://forum.plantuml.net/15026/want-to-show-test-query-in-diamond-and-share-target-activity上发帖

https://gist.github.com/systemsincode/591f86597efff9fd9cf279ab486ece0b

EN

回答 1

Stack Overflow用户

发布于 2021-11-20 18:20:25

滥用标签为我解决了这个问题:

代码语言:javascript
复制
@startuml
header Minimum Reproducible Example
title Can't point two queries to same activity
start
!$shared = SHARED
!$nonShared = NON-SHARED

:Minimum Reproducible Example;
if (Test Question) then (yes)
  label sp_lab0
  label lab
  :$shared;
else (no)
    if (Second Test Question) then (yes)
    label sp_lab
        goto lab
    else
    :$nonShared;
    endif
endif
stop
@enduml
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70041006

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档