How to show Start element outside partitions in activity diagrams?

0 votes
asked Aug 1 in Question / help by anonymous

Hi,

I have a case where the Start element is connected directly to a partition. It seems that Start is always drawn inside the partition.

Is there any way to show Start outside the partition?

Regards

commented Aug 1 by albert (2,340 points)
To make it easier for others please include the used code in the question.

2 Answers

0 votes
answered Aug 2 by anonymous

This is an example using the old syntax:

@startuml
partition Conductor {
  (*) --> "Climbs on Platform"
  --> === S1 ===
  --> Bows
}
@enduml

(*) appears inside the partition but I want to show it outside, only this (*) element.

Thank you.

0 votes
answered Aug 2 by albert (2,340 points)
edited Aug 6 by albert

How about:

@startuml
partition Conductor {
  "Climbs on Platform"   --> === S1 ===
  --> Bows
}

(*) --> "Climbs on Platform"

partition Audience #LightSkyBlue {
  === S1 === --> Applauds
}

partition Conductor {
  Bows --> === S2 ===
  --> WavesArmes
  Applauds --> === S2 ===
}

partition Orchestra #CCCCEE {
  WavesArmes --> Introduction
  --> "Play music"
}
@enduml

There was as subsequent question in the comment how about:

@startuml
partition Orchestra {
 play -[hidden]-> play
}
(*) --> play

play --> end
@enduml

commented Aug 6 by anonymous
Thank you. It works. The connection (*) --> "Climbs on Platform" is defined after the partition.

But there is another case, when the partition contains only one element. With the previous solution,  the partition remains empty. Do you have any idea how to solve it?

Example:

@startuml
partition Orchestra {
(*) --> play
}

play --> end

@enduml
commented Aug 6 by Serge Wenger Work (9,810 points)
Hello,
I am not sure to understad your problem, but you can put an hidden transition to self:

@startuml
partition Orchestra {
play -[Hidden]-> play
}
(*) --> play

play --> end
@enduml
commented Aug 6 by albert (2,340 points)
@Serge Werner see my already updated answer.
commented Aug 6 by Serge Wenger Work (9,810 points)
Answer at same time. Serge Wenger
commented Aug 7 by anonymous
Great! it works with hidden connections. Thank you.
...