plantuml - draw note above activity diagram

Viewed 8942

I found a good activity diagram at here but no source code.it looks like below: enter image description here

I try to draw it with plantuml, below is my code:

@startuml
skinparam linetype ortho

(*) -down-> "clone repository"
note right
A:git clone url/to/repository
scp -p url/to/hooks/commit_msg repository/.git/hooks
end note
-down->[get an assignment] "coding"
-down-> "commit locally"
note right
B:git add xxx
git commit
end note
-down-> "review"
note right
C:git push origin refs/for/<branch>
end note
if "" then
  -left->[rejected] "rework"
  -up-> "recommit"
'note left
'D:git add xxx
'git commit --amend
'end note
  -right-> "review"
else
  --right-->[approved] "submit"
note right: E:click "submit" on on corresponding gerrit page
  -up-> "update local repository"
note right
F:git pull --rebase
end note
  -left->[get another task(a new cycle)] "coding"
@enduml

The output is: enter image description here

Obviously, still not as original diagram:

  1. Notes above/below doesn't work, not sure how to do it (such as E note should below)
  2. The center flow not in straight line.
  3. The "submit" to "update local repository" has changed 2 times.

How can I improve it just the same as original output?

2 Answers

Is this what you need actuelly? enter image description here

There is no magic to create this kind of pic but to adjust the length of arrow carefully. You can fullfill " " to extend the arrows.

source code:

@startuml
skinparam linetype ortho

(*) -down-> "clone repository"
note right
A:git clone url/to/repository
scp -p url/to/hooks/commit_msg repository/.git/hooks
end note
-down->[get an assignment] "coding"
-down-> "commit locally"
note right
B:git add xxx
git commit
end note
-down-> "review"
note right
C:git push origin refs/for/<branch>
end note
if "" then
  -left->[ rejected] "rework"
  -up-> "recommit"
'note left
'D:git add xxx
'git commit --amend
'end note
  -right-> [       ]"review"
else
  --right-->[                              approved                              ] "submit"
note right: E:click "submit" on on corresponding gerrit page
  -up-> "update local repository"
note right
F:git pull --rebase
end note
  -left->[              get another task(a new cycle)] "coding"
@enduml
Related