Switch/Case not working if there something before it

0 votes
asked Feb 15, 2023 in Question / help by Stepan Ponomarev
If there some activity before switch/case block, it won't work. Or am I doing something wrong?

```plantuml

@startuml

(*) --> "Some begining"

switch (whatever)
  case (first case)
    :foo;
  case (other case)
    :bar;
endswitch
-->(*)
@enduml

```

1 Answer

+1 vote
answered Feb 15, 2023 by albert (3,520 points)

I think you are mixing different syntaxs see e.g. https://plantuml.com/activity-diagram-beta

So probably the following will be better for you:

@startuml

start

switch (whatever)
  case (first case)
    :foo;
  case (other case)
    :bar;
endswitch

stop
@enduml
commented Feb 20, 2023 by Stepan Ponomarev

Thanks, I didn't notice that plantuml has 2 versions with different syntaxes

...