How to show Start element outside partitions in activity diagrams?

0 votes
asked Aug 1, 2018 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, 2018 by albert (3,520 points)
To make it easier for others please include the used code in the question.

2 Answers

0 votes
answered Aug 2, 2018 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, 2018 by albert (3,520 points)
edited Aug 6, 2018 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, 2018 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, 2018 by Serge Wenger Work (15,620 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, 2018 by albert (3,520 points)
@Serge Werner see my already updated answer.
commented Aug 6, 2018 by Serge Wenger Work (15,620 points)
Answer at same time. Serge Wenger
commented Aug 7, 2018 by anonymous
Great! it works with hidden connections. Thank you.
...