activity diagram group repeat backward } "cannot find group"

0 votes
asked Sep 16 in Bug by jp324 (120 points)
edited Sep 16 by jp324

I'm not sure if this is a supported intended use or not, but I wanted to make an activity diagram using both a 'group' and a 'repeat'/'backward' loop.  When I tried to close the group element with a '}' it errors with a message 'Cannot find group'.  

@startuml
start
group collection1 {
repeat : first;
:second;
backward :third;
' closing "}" here causes problems
:fourth;
group collection2
:fifth;
}
' closing "}" here also causes problems
@enduml

https://www.plantuml.com/plantuml/uml/ROqn3eCm34NtdC9YwToEOU4gnXY8Qc9aE-fGSVVIhdJx-azwR_10YxP9-esqcBOTI4MOecYzmpiPxum16UPY7dtApgHrwjE8z7oXJP1ZBNOUDo1HBtM1xkXWPMCWRCuEk-ael7dAipQBjR-K7YSgyvSS_pmehXVPm7Lgctm0

1 Answer

0 votes
answered Sep 16 by The-Lu (70,400 points)
selected Sep 17 by jp324
 
Best answer

Hello J.,

It seems `repeatwhile` is missing...

See doc. here:

Then to close `group` you must use `end group` as:

@startuml
start
group collection1
repeat : first;
:second;
backward :third;
repeatwhile (condition)
end group
:fourth;
group collection2
:fifth;
end group
@enduml

Enjoy,
Regards,
Th.

commented Sep 16 by jp324 (120 points)

Okay, I see now I missed "end group".  Originally I had started this diagram using "rectangle" which the "Group, Partition, Package, Rectangle or Card" example (copied here) shows using the "{...}" pattern and not "end group" specifically.  FWIW, using "end group" works to close a rectangle.  "end rectangle" doesn't seem to be legal syntax though.

@startuml
start
group Group
  :Activity;
end group
floating note: Note on Group

partition Partition {
  :Activity;
}
floating note: Note on Partition

package Package {
  :Activity;
}
floating note: Note on Package 

rectangle Rectangle {
  :Activity;
}
floating note: Note on Rectangle 

card Card {
  :Activity;
}
floating note: Note on Card
end
@enduml

Looking at the rest of my question, I do see now I have to use either pattern "repeat ... backward ... repeat while" or "while ... backward ... endwhile".

Is there a syntax that doesn't force the conditional (diamond shape) split and still allows a backward/repeat-like arrow?

Thanks for your clarification.

...