Activity diagramming aliasing

0 votes
asked May 26, 2017 in Closed question / help by tex (180 points)
Hello,

I asked a question before, but I believe I provided a weak sample activity diagram. This activity diagram is more representative.

In the following example, I am drawing a map using an activity diagram, and connecting via directions. The problem is that sometimes I want to have the same label on multiple boxes, in the below example, "cellar1, cellar2, cellar3, cellar4" should appear as "cellar", which obviously isn't a unique id. Therefore I would like to provide unique ids as per this example but be able to override what actually appears on the box (cellar).

Is this possible?

@startuml

(*) --> study

study --> [e] livingroom

livingroom -->  [e] lounge

lounge -->  [s] kitchen

kitchen --> [w] hallway

hallway --> [n] study

hallway --> [d] cellar1

cellar1 --> [n] cellar2

cellar2 --> [e] cellar3

cellar3 --> [s] cellar4

cellar4 --> [w] cellar1

@enduml

1 Answer

+1 vote
answered May 29, 2017 by Serge Wenger Work (15,620 points)
selected Jun 1, 2017 by tex
 
Best answer

Hello,

Use the "as" keyword:

@startuml
(*) --> study
study --> [e] livingroom
livingroom -->  [e] lounge
lounge -->  [s] kitchen
kitchen --> [w] hallway
hallway --> [n] study
hallway --> [d] "cellar" as c1
c1 --> [n] "cellar" as c2
c2 --> [e] "cellar" as c3
c3 --> [s] "cellar" as c4
c4 --> [w] c1
@enduml
commented Jun 1, 2017 by tex (180 points)
I can't believe it is that easy. I guess I was reading it backwards.
...