Arrow description for while loop

0 votes
asked Oct 6, 2020 in Wanted features by wro02922 (780 points)

This topic is continuation of https://forum.plantuml.net/12180/unable-to-add-arrow-text-description-after-backward-keyword.
I would like to ask you to add arrow description to object 'data available?'. The description back to the 'data available?' action can be executed as for elsif, i.e. (incoming description) elseif (condition) else (outgoing description).

P.S.
Could you check why dsc_5 ovrrides dsc_4?

@startuml
start
->dsc_1;
(incoming description from backward) while (data available?)
  ->dsc_2;
  :read data;
  ->dsc_3;
  :generate diagrams;
  ->dsc_4;
backward :Warning; 
->dsc_5;
endwhile
stop
@enduml

1 Answer

0 votes
answered Oct 12, 2020 by plantuml (295,760 points)

We are still looking for a clear syntax.

With last official release, you have to use:

@startuml
start
->dsc_1;
while (data available?)
  ->dsc_2;
  :read data;
  ->dsc_3;
  :generate diagrams;
  (->dsc_4) backward :Warning; (->dsc_5)
endwhile
->dsc_6;
:eof;
@enduml

What do you think about this one ?

commented Oct 19, 2020 by The-Lu (73,540 points)

Hello PlantUML,

Here is a collateral question or an observed question, not link directly by this improvement:

  • How to color the arrow after the "BB" box?
    it is good after the "CC" box: if there is another action after the box (like 'end'), but for the other...
Thanks for your support,
Regards,
Th.
commented Oct 20, 2020 by plantuml (295,760 points)
Thanks for the report !

This issue has just been fixed in last beta http://beta.plantuml.net/plantuml.jar and in the online server.

Tell us if it's not working for you.

Regards,
commented Oct 20, 2020 by The-Lu (73,540 points)

Hello PlantUML,

The issue of wro02922 with ";" or without ";" seems to be always occur.

@startuml
start
repeat :Enter data;
:Submit;
-[#blue]-> dsc_5
(-[#red]-> aaa) backward :Warning;
note right: Note
repeat while (Valid?) is (No) not (Yes)
stop

start
repeat :Enter data;
:Submit;
-[#blue]-> dsc_5;
(-[#red]-> aaa) backward :Warning;
note right: Note
repeat while (Valid?) is (No) not (Yes)
stop
@enduml

Regards,
Th.

commented Oct 20, 2020 by The-Lu (73,540 points)

Hello all,

In fact, if we add texts to arrow: the ';' is mandatory [-> label;]
And without label, we can omit the ';' [-[#blue]->]
Unless with backward where '(...)' replace ';'. wink

Regards,
Th.

...