Activity Diagram - Swimlanes - Issue with vertical alignment of activity labels

+1 vote
asked Apr 5, 2024 in Question / help by swimmer
edited Apr 5, 2024

Hi Everyone,

I'm struggling to understand why activity labels are not vertically aligned when building activity diagram using swimlanes. 

Here mi my example:

@startuml
skinparam style strictuml
|Team A|
start
:init;
|Team B|
if (valid?) is (yes) then
    if (special case?) is (yes) then
        :send question;
        |Team A|
        :provide info;
        |Team B|
        :special object created;
    else (no)
        :object created;
    endif
        :finishing;
else (no)
    |Team B|
    :reject;
    stop
endif
    |Team A|
    :use new object;
    end
@enduml

The issue here is that "provide info" label is for some reason brought to the left side in "Team A" swimlane. 
If I remove "provide info" label then all labels in "Team A" are perfectly horizontally aligned.

Am I doing something wrong or is there any trick to fix that?

1 Answer

0 votes
answered Mar 7, 2025 by dickmaley (4,160 points)

The problem is the |Team A| before :provide info; which causes :provide info; to be displayed in the Team A swimlane.

image

@startuml
skinparam style strictuml
|Team A|
start
:init;
|Team B|
if (valid?) is (yes) then
    if (special case?) is (yes) then
        :send question;
        :provide info;
        |Team B|
        :special object created;
    else (no)
        :object created;
    endif
        :finishing;
else (no)
    |Team B|
    :reject;
    stop
endif
    |Team A|
    :use new object;
    end
@enduml

...