uml - 如何用PlantUML实现直接箭头?

标签 uml plantuml

我正在尝试使用 PlantUML 创建一个事件图,其中确实包含返回现有节点的箭头。

我正在寻找的是一个图表,其中包含下图中的两个箭头“箭头 1”和“箭头 2”: plantuml diagram with the desired arrows

我尝试使用 PlantUML beta syntax for Activity diagrams 创建它.

我实现了下图:

plantuml diagram without the desired arrows

通过编写以下 PlantUML 代码:

@startuml

start

:new - please check;

while (check sucessful?) is (is an error)
  :to solve;
  :in progress;
  :solved;
endwhile (not an error)

:erledigt;
note left
    reason:
     * done
     * not an error
     * not fixable
end note
stop

@enduml

有人知道如何实现这一点吗?结果是否通过使用 beta 语法或 the older syntax 实现对我来说并不重要.

最佳答案

你不能有多个流从一个 Action 开始,也不能有多个流去一个 Action

对于UML的观点所以你需要添加:

  1. 在“解决”操作之后的决策节点有两个流,每个流都有一个守卫

  2. 在“erledigt”操作之后的决策节点有两个流,每个流都有一个守卫

  3. 在 Action “解决”之前的合并节点接收来自决策节点“检查成功”和 Action “erledigt”的流。

对于 (1) 在 PlantUML 中使用“if-else”或“split”

start

:new - please check;

while (check sucessful?) is (is an error)
  :to solve;
  if (duration) then (long)
    :in progress;
  else (immediat)
  endif
  :solved;
endwhile (not an error)

:erledigt;
note left
    reason:
     * done
     * not an error
     * not fixable
end note
stop

@enduml

enter image description here

对于 (3),您可能可以使用“重复同时”来管理 (2),但不确定您是否可以在 PlantUML 中不重复这三个 Action (解决 - 进行中 - 解决)或在另一个中执行它们您调用的事件。在 PlantUML 中,代码是从控制结构中提取的,除了“goto”,它允许不交叉线,但你需要一个“goto”交叉线。请注意,执行“检查成功”决定而不是执行“解决”操作没有问题

关于uml - 如何用PlantUML实现直接箭头?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60615999/

相关文章:

uml - 用于专业 UML 建模的 Dia

uml - UML 中的 {readonly}\{query} 是什么意思?

Eclipse插件: ObjectAid UML Explorer Class Diagram: export in higher resolution

plantuml - 有没有办法在 PlantUML 组件图中包含一列元素?

gradle - 从 Gradle 创建 PlantUML 图

uml - 组件换行

c++ - 它将是哪种类关系[特定于 C++]?

plantuml - PlantUML 文档如何指定其图表类型?

plantuml : grouping sequence makes actor appears

UML:控制流和对象流